Copyright: This file was created by Don Funk


Access KB Help File
Microsoft Access Knowledge Base

Welcome to the Microsoft Access Knowledge Base help file.  This help system includes 1313 articles that relate to the Microsoft Access  for Windows.  These articles were developed by Microsoft's Product Support Engineers.  This help file is a snapshot of the Knowledge Base as of April 13, 1994.  New and updated articles can be found on both CompuServe, GENIE and Internet.  This help file also lists Training Centers in your local area, third party application and developers,  and User Groups.  This help file contains helpful tips, programming examples(INF), known problems(PRB, PRA), References, FastTips and other information that may not be addressed in the manuals.

Please feel free to distribute this information in compliance with the terms of Microsoft.

Fast Tips

Forms (Specific)

Forms/Reports (Common)

General

Import/Export/Attach

Interoperability

Macros

Non-Product/Non-Technical

Programming

Queries

Reports (Specific)

Security

Setup

Tables

Windows Issue

Printing


Printing
Microsoft Access Knowledge Base

Welcome to the Microsoft Access Knowledge Base help file.  This help system includes 1313 articles that relate to the Microsoft Access  for Windows.  These articles were developed by Microsoft's Product Support Engineers.  This help file is a snapshot of the Knowledge Base as of April 13, 1994.  New and updated articles can be found on both CompuServe, GENIE and Internet.  This help file also lists Training Centers in your local area, third party application and developers,  and User Groups.  This help file contains helpful tips, programming examples(INF), known problems(PRB, PRA), References, FastTips and other information that may not be addressed in the manuals.

Please feel free to distribute this information in compliance with the terms of Microsoft.

Fast Tips

Forms (Specific)

Forms/Reports (Common)

General

Import/Export/Attach

Interoperability

Macros

Non-Product/Non-Technical

Programming

Queries

Reports (Specific)

Security

Setup

Tables

Windows Issue

Printing

Access Specific Printing

ADK Printing specific

General Win Trouble Shooting

Specific Win3.1 Drivers


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.  MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.  SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

COPYRIGHT Microsoft Corporation, 1992.


Common problems articles are articles perceived to be problems by the customer (for example, common user errors). Unconfirmed bugs and documentation error articles also fall into this category.  These articles are easily identified by the "PRB:" code in the title of the article.


Information articles describe undocumented features and  sample programs, or elaborate on topics that are already documented. These articles are easily identified by  the "INF:"code in their titles.


Bug articles are articles that are confirmed to be problems . These articles are similar in format to the common problems articles and are easily identified by the "PRA:" code in the title of the article.


Microsft FastTips is an automated fax and voice service that provides technical product support information about Microsoft Access at the following phone number 24 hours a day, 7 days a week (including holidays): (206) 635-7051.  You can use FastTips with your touch-tone phone.  The Microsoft Access FastTips service includes a comprehensive map for easy navigation and a Technical Library catalog, which contains the most popular customer support information.  For your convenience, we recommend that you request a map and catalog during your first call.  If you do not have direct access to a fax machine, many convenience stores and private mailbox companies provide local FAX services that can be used to receive information from FastTips.


Useful Resources to Make the Most Out of Access

User Groups

Many groups are already established and more are starting.  They are a great way to learn more about the features and power of Microsoft Access.  Microsoft keeps in close contact with these groups, sending them sample applications, code, tips and tricks, as well as other information.  Plus, representatives from Microsoft make visits and speak at user group events around the country.  To join or start a Microsoft Access user group or special interest group, call (206) 936-3729.

Training

If you are interested in digging deeper into Microsoft Access or want to come up to speed quickly, training may be the answer.  To find a Microsoft Access training site near you, call (800) 426-9400.  If youre interested in becoming a trainer for Microsoft Access, call (800) 227-4679 to request an application.

Periodicals

Access Advisor

Data Based Advisor	Data Based Solutions, Inc.

DBMS Client/Server Computing	M&T Publishing Inc.

Inside Microsoft Access

Smart Access

Books

ABC's of Microsoft Access	Sybex

Absolute Beginner's Guide To Access	Sams Publishing

Access Consulting	Prima Publishing

Access for Windows Hot Tips	Que

Access for Windows Power Programming

Access from the Ground Up	Prima Publishing

Access Programmer's Reference	Que

Access Programming Cookbook	Addison-Wesley

Access Workshop	Brady Books

Critical Information Network

Guide to Access

Help! Microsoft Access	Ziff-Davis Press

Inside Microsoft Access	New Riders Publishing

Microsoft Access 1.1	Bantam Computer Books

Microsoft Access Bible	IDG Books Worldwide

Microsoft Access Developer's Guide	Sams

Microsoft Access Inside & Out	Osborne McGraw Hill

Microsoft Access Instant Reference	SYBEX

Microsoft Access Programming	Windcrest/McGraw Hill

Microsoft Access Running Start	SYBEX

Microsoft Access Step by Step	Microsoft Press

MS Access Handbook	Bantam Books

PC Learning Labs Teaches Access	Ziff-Davis Press

PC World Access Handbook	IDG Books

Running Microsoft Access	Microsoft Press

Teach Yourself Access	MIS Press

Understanding Microsoft Access	SYBEX

Using Access 1.1 for Windows	Que

Using Access for Windows, Special Edition	Que Publishing

Your Access Consultant


Access for Windows Power Programming

Advanced

by Persohke & Liozbanski

Access for Windows Power Programming is aimed at the advanced user, developer and network administrator who is interested in developing powerful and effective applications for Microsoft Access.  The book contains advice on the planning and design of databases and applications, as well as tips and techniques for creating effective reports, forms and queries.  Coverage of programming in the Access Basic language and creating macros is included, along with detailed information about variables, arrays, fields and other programming structures in Microsoft Access.  An Xbase programmers survival guide, a quick command and function reference, and a complete sample application are a few key elements in this book.  All code discussed in the book is included on a disk, plus you get a disk containing valuable utility software.  Price:  $44.95 (book with two disks).

Order Information:  Available April 1993.  Call (800) 528-5331.  Que Publishing.


Access from the Ground Up

Beginning/Intermediate

by Martin S. Matthews with Edward Hartmann and William E. Lloyd

This fast-paced introduction to Microsofts database program for Windows is the perfect starting point for anyone who is learning to use Microsoft Access for the first time.  An expert team of authors begins by teaching readers basic database design concepts.  Then, readers learn to customize forms, perform queries, print reports and labels, use macros, and more.  Highly illustrated.  Price:  $19.95.

Order Information:  Available February 1993.  Prima Publishing, Inc.


Critical Information Network

Beginner/Advanced  (Application developers, MIS)

by Thomas P. McAuliffe & Carolyn S. Shamlin

Critical Information Network is a new book that dispels the myths of online management reporting and offers a complete set of guidelines to avoid failed applications.  Based on 20 years of both technical and non-technical experience, the book provides the authors unique view of the relationship between critical information and the management process.  Many long-standing industry issues are clearly addressed:

1.	The real added value of information technology for management reporting.

2.	The keys to sustained management interest.

3.	The elusive link between reporting applications and corporate priorities.

4.	How groupware will impact the executive world.

5.	A blueprint for successful computer use by management.

Price $29.95 plus $2.00 for shipping

Order Information:  Call (617) 247-2460.  McAuliffe & Company, Inc.


Guide to Access

Beginning/Intermediate/Advanced

by Miriam Liskin

Now users at all skill levels can gain access to the complete feature set of Microsofts leading-edge database program by following best-selling author Miriam Liskins clear explanations.  In 20 exhaustive chapters Liskin covers just about every aspect of Microsoft Access from beginning to advanced subjects.  Topics covered include designing and creating databases, defining simple queries, performing calculations, working with external data, using Access on a network, building menu-driven applications, and more.

1.	Covers all aspects of database use and introduces database programming to nonprogrammers.

2.	Turns beginning and intermediate users into masters.

3.	Includes a disk containing the sample databases presented in the text, saving readers hours of input.

Price: $29.95.

Order Information:  Available April 1993.  Call (800) 688-0448 or fax (510) 601-2155.  Ziff-Davis Press.


Inside Microsoft Access

Beginning/Intermediate

by Richard Wagner, Helen Feddema, Michael Groh, Greg Reddick

Inside Microsoft Access provides a complete description of Microsoft Access database version 1.0 from the conceptual and implementation perspectives.  The book covers the fundamentals of database design and creation using Microsoft Access.  Everything from using the Microsoft Access environment to constructing macros and Access Basic modules are discussed in detail.  Throughout Inside Microsoft Access, practical examples illustrate each topic and concept.

The bonus disk contains HomeFinder, a sophisticated application produced with Microsoft Access.  HomeFinder comes complete with tables, forms, queries, and macros.  HomeFinder, a highly interactive application, demonstrates the many advanced features of Microsoft Access, including query by example, OLE embedding, image handling, and report generation.

Order Information:  Call (800) 428-5331.  New Riders Publishing,  Prentice-Hall Computer Publishing.


Microsoft Access Inside & Out

Beginner/Intermediate

by Mary Campbell

Microsofts exciting new database for the IBM PC and compatibles is sure to be a challenger for the lead database for Windows.  Find out all about this revolutionary software in Mary Campbells new book.  Youll get an insiders introduction to this powerful, feature-loaded relational database management system (DBMS), from fundamentals to intermediate-level skills and then on to some advanced topics.  If youre a beginning database user, youll soon learn how to set up a database and use it productively.  If you already know database software, youll learn all about the unique features of Microsoft Access, such as three-dimensional color graphics, object linking and embedding (OLE), multimedia and network capabilities, and other features that make this software a powerful new contender.  Price:  $27.95.

Order Information:  Available now at most booksellers, or by calling (800) 227-0900.  Osborne McGraw-Hill.


Microsoft Access Programming

Beginner/Intermediate/Advanced

by Namir Shammas

Microsofts first database for Windows, Microsoft Access, is a program powered by easy-to-use visual programming techniques.  It appeals to seasoned programmers and users who want to create their own customized database applications.

Namir Shammas latest book is an accessible, hands-on introduction to database programming for anyone who is familiar with the Basic language.  Shammas relaxed, friendly style leads the reader gently but thoroughly through the fundamentals of Access Basic programming to using the host of powerful database extensions.  Its a practical tutorial approachloaded with ready-to-use program code and peppered with professional tips, tricks, and warningsthat has proven successful in the authors previous books.  Price:  $32.95.

Order Information:  Call (800) 822-8138 or fax (717) 794-2080.  Tab/McGraw-Hill.


PC Learning Labs Teaches Access

Beginner

by PC Learning Labs

PC Learning Labs, world leader in hands-on computer instruction, has now added Microsoft Access to their successful book/disk learning series.  This innovative learning tool will aid first-time users in learning this powerful Windows-based database program.  Years of classroom teaching and lab research into how people best learn to use computers are the basis of this integrated package.  No other book is better suited to the needs of beginning users of Microsoft Access.

1.	Covers start-up and basic operations as well as forms, query techniques, reports, and much more.

2.	Assumes no prior computer experience.

3.	Includes a Practice Examples Disk with exercises that work hand in hand with instructions in the text.

Price:  $22.95.

Order Information:  Available February 1993.  Call (800) 688-0448 or fax (510) 601-2155.  Publisher Ziff-Davis Press.


PC World Microsoft Access Handbook

Beginner/Intermediate

by Cary Prague and Michael Irwin

Discover the full power and ease of use of Microsoft Access from expert authors.  This book/disk combination is a hands-on tutorial reference that walks you through the process of creating powerful applications for Microsoft Access.  Key topics include installation, database design, creating tables, creating and printing professional-looking reports, using logic and math functions, data validation, database publishing, using pictures, graphs and OLE objects, creating switchboards, dialogs, and menus, and more!  Bonus 3.5-inch disk contains customizable examples.  Price:  $34.95.

Order Information:  Available (first quarter 93) at all major booksellers or order direct at (800) 762-2974.  IDG Books Worldwide, Inc.


Running Microsoft Access

Intermediate

by John Viescas

Running Microsoft Accessthe Microsoft guide to the long-awaited Windows-based relational database softwareis now available from Microsoft Press.

This example-packed, hands-on tutorial and users guide incorporates tips and strategies not covered in the product demonstration.

Author John Viescas provides database concepts and terminology, a comprehensive product overview, and step-by-step instructions. Anyone who needs access to datafrom a small business manager to an enterprise-wide information system administratorwill learn how to use the powerful capabilities of Microsoft Access to build database applications from scratch or to make existing data more accessible.  Price:  $29.95.

Order Information:  Available wherever books and software are sold or by calling
toll-free (800) MSPRESS.


teach yourself... Access

Beginning/Intermediate

by Steve Davis

Teach yourself everything you need to know about Microsofts new database software, Microsoft Access.  Take the Weekend Tour of Microsoft Access and jump right into:

1.	understanding and creating databases and reports

2.	indexing

3.	creating screen forms, queries, and labels.

With teach yourself...Access, youll also learn to modify databases, customize forms and reports, use queries, filters, and macros, and even program in Access Basic.  Price:  $21.95.

Order Information:  Available February 1993.  Call (800) 628-9658 (Telemarketing) or (800) 488-5233 (Individual Sales).  MIS:Press.


Using Access for Windows, Special Edition

Beginning/Intermediate/Advanced

by Roger Jennings and Ron Person

Using Access for Windows, Special Edition addresses the needs of all those using Microsoft Access, whether secretaries or small business owners or application developers.  The book is formatted as a tutorial for beginners, but also explains advanced database concepts and programming techniques to intermediate users, and provides material on the Access Basic macro and programming language for advanced users.

Using Access for Windows, Special Edition combines step-by-step lessons with real-world power-user techniques and examples.  Features covered include: queries, graphics, forms, reports, multiuser capabilities, networking features, macros and programming.  Information on SQL, dynamic data exchange (DDE), and object linking and embedding (OLE) is also presented.  Other key features of the book include the QuickStart Tutorial format with use of tips, notes, and cautions throughout the text.  Price:  $29.95.

Order Information:  Call (800) 528-5331.  Que Publishing.


Your Access Consultant

Intermediate/Advanced

by Martin S. Matthews with Edward Hartmann and William E. Lloyd

When youre ready for the next step, let the experts at Matthews Technology become your Access consultants.  This object-oriented approach to database design with Microsoft Access illustrates general principles and tricks that can be customized and applied to an infinite variety of situations.  All code in the book is included on a high-density disk, along with fully operational database systems that have been developed with Microsoft Access.  An incredible bargain!  Price:  $39.95.

Order Information:  Available June/July 1993.  Prima Publishing Inc.


Access Advisor

Access Advisor is the magazine that teaches you how to use all the power of Microsoft Access.  Each issue is crammed with information for users of all types, from novice to expert developer.  As a Charter subscriber, youll receive a one-year subscription (6 issues) for only $29 (plus shipping charges outside the U.S.).  This is 25% off the cover price.  A companion disk is available for an additional $60 (50% savings).  Dont miss an issue!

Order Information:  Call (800) 336-6060 or (619) 483-6400.  Advisor Communications International, Inc.


Inside Microsoft Access

If you want to gain a complete understanding of Microsoft Access, Inside Microsoft Access, a monthly publication from The Cobb Group, will provide you with the skills you need.  The articles in Inside Microsoft Access will give you vital information you cant find in books and manualstips and techniques you can use right away to work smarter and faster with Microsoft Access.

The Cobb Group publishes a wide-range of respected software journals including Inside Visual BasicTM for Windows, The Microsoft C/C++ Developers Journal, and Inside Microsoft Windows. A one-year subscription to Inside Microsoft Access (12 issues) costs $49.

Order Information:  To request a free issue of any publication, call (800) 223-8720.  The Cobb Group.


Smart Access

Smart Access, Pinnacle Publishings monthly technical journal for Microsoft Access users, will help you make the most of your Microsoft Access databases from day one.  Our expert authors will show you the ins and outs of queries, macros, forms, reports, and Access Basic code (ABC), as well as how to make the move to Microsoft Access from other database platforms.  You wont have to spend tedious hours digging through the manuals for solutionsand youll save enough time and money to pay for your subscription many times over!

Order Information:  Subscribe to Smart Access today12 monthly issues for just $79youll receive the accompanying source code disks (a $60 value) FREE!  Call (206) 251-1900, (800) 231-1293, or fax (206) 251-5057.  Pinnacle Publishing, Inc.,
P.O. Box 888, Kent, WA 98035-0888.


Title

GoTo


Compuserve
Getting Started on the MSACCESS Forum

GEnie

GEnie access requires a personal computer, an asynchronous modem (300, 1200, or 2400 baud), and a communications package (such as the one in Microsoft Works). For information about GEnie, call GEnie Client Services at (800) 638-9636.

Accessing Software Library/RoundTable/Knowledge Base on GEnie

Internet

The Microsoft Support Network is a new program designed to provide a range of technical and product support options to developers that will go into effect on October 1, 1993. It consists of three support plans and an entire suite of electronic services. The Standard plan offers free support for 90 days. The Priority and Premier plans provide additional individualized support services for specific fees.  The Microsoft Support Network is a new program designed to provide a range of technical and product support options to developers that will go into effect on October 1, 1993. It consists of three support plans and an entire suite of electronic services. The Standard plan offers free support for 90 days. The Priority and Premier plans provide additional individualized support services for specific fees.  The Support Network makes the Knowledge Base and Microsoft Software Library available via an anonymous ftp server on the Internet, as well as providing additional features. The Internet is a network that spans over 100 countries, reaching as many as 20 million people. The Support Network makes the Knowledge Base and Microsoft Software Library available via an anonymous ftp server on the Internet, as well as providing additional features. The Internet is a network that spans over 100 countries, reaching as many as 20 million people.

Accessing the Knowledge Base on Internet

CompuServe

Microsoft Forums on CompuServe. A variety of forums are facilitated by Microsoft and provide interactive dialog with a worldwide community of Microsoft customers. You can exchange information with peer users and Microsoft support engineers. There is no support charge, but CompuServe connect charges do apply. For sales information, call CompuServe at (800) 848-8199, representative 230.

How to Search the CompuServe Knowledge Base on CompuServe

Microsoft Forums on CompuServe. A variety of forums are facilitated by Microsoft and provide interactive dialog with a worldwide community of Microsoft customers. You can exchange information with peer users and Microsoft support engineers. There is no support charge, but CompuServe connect charges do apply. For sales information, call CompuServe at (800) 848-8199, representative 230.

Membership Announcement

Introduction

Hard and Fast Rules

Manners and Ambience

      3.1  Manners

      3.2  Who's Microsoft and who isn't

      3.3  What to do if you're upset

Emoticons and Acronyms

      4.1  Emoticons

      4.2  Acronyms

Forum Organization -- Messages, Threads, Sections

      5.1  Message Traffic and Scroll Rate

      5.2  What the Heck All This Means to You

Asking Questions

      6.1  Phrasing Your Question

      6.2  Uploading Files

      6.3  Responding to Answers

      6.4  Acknowledgments

      6.5  If You Don't Get an Answer

Tips for the Active Participant

      7.1  Thread Integrity and Continuity

      7.2  Message Etiquette

      7.3  On-line vs Off-line

Sysops

Libraries

      9.1  Compressed Files

      9.2  Uploading files

Afterword - The Spirit of Contribution


Compuserve Membership
Membership Announcement

To join the MS Access Forum, select option #8 from the Forum menu or type JOIN at any Forum command prompt or choose Join from the appropriate menu. Your first and last name is all that is required. There are no special fees or dues other than your normal CompuServe connect charges.

Membership privileges are enabled automatically, and allow you full participation within the forum. All privileges remain in effect unless specifically deleted by the SYSOPS as long as you access the Forum periodically. The membership file is regularly (90 days) purged of inactive members to improve system operation. If this should occur, all you need to do is sign up again and your membership privileges will be enabled.

Forum members may access the Conferencing area, Libraries, and Message Board, which has been broken down into various sections. To see a listing of the Message section names, Library names, or Conference Rooms available, please type "NAMES" upon entry to the Forum.

Online help is available at virtually every level of the Forum. When in doubt, try entering a "?" or the word "HELP". If you are new to the CompuServe Forum environment, please be sure to visit the Forum INSTRUCTIONS area.


INTRODUCTION

Welcome to the Microsoft Access Support Forum! Welook forward to your questions and contributions.

The MSACCESS Forum is an extraordinary resource for people who use, or are considering using, Microsoft products. Forum members are knowledgeable,  unselfish, and available virtually 24 hours a day, 7 days a week to assist you. They will not only provide you with the information and help you need, but they'll do so with a generosity of spirit that truly means "support."

The forum is a place to get your questions answered -- Microsoft tech support is here (Monday through Friday) as well as many people who are very knowledgeable in Microsoft products, hardware, other software, and just about everything else (e.g. music, Star Trek, medieval literature, the list goes on and on).

Yet the forum also offers more than a place to come for help...

-	you can learn about new trends in the industry and the philosophy of database approach in general

-	you can share your thoughts about Microsoft and our line of  products, request changes and enhancements, and gripe if you need to

-	you can contribute your own knowledge and have the satisfaction of helping others

-	and you can just hang out and chat with people who might become some of your best friends.

Our main purpose here is to provide information, guidelines and tips to help you get "up to speed" as quickly as possible.

Although we have a responsibility to watch this forum and see that questions are answered, problems resolved, and concerns are addressed, we hope that you will play an active part participating in the process.  The forum works best when we all contribute and help each other.  Not only does this make for good technical support, it also helps us to determine where the product can stand some improvement in order to prevent questions in the first place.  We also get a good idea of who our customers are and what they need to be more productive.


Rules
HARD AND FAST RULES

These are simple.

This forum requests that you use your full name in your CompuServe (CIS) identification. If you have omitted your first name or last name, please change it.

  To change your name, get on-line in CompuServe and type GO MSACCESS to

  get to the CompuServe prompt. Then type OPTIONS which will show you a

  menu of options you can change. Choose option 4 (name), enter the new

  name, press <RETURN> and then tell CIS to make the change permanent.

  You can also do this quickly by typing "OPT;N <newname>;P" which will

  bypass the menus.

  If you normally use a company CompuServe account with the company name

  but plan to be a regular participant, please change the identification

  (at least locally in this forum) to your name and enclose the company

  name (or abbreviation) in brackets after your name. If several

  people will be using the *same* account, each individual should include

  his or her complete name in the body of the message.

Please refrain from using profanity, being abusive, advocating illegal actions, or performing any act that may injure another. Microsoft reserves the right to deny access to the forum to anyone posting offensive

messages.

This isn't a "hard and fast rule" but it is highly recommended -- please do not type your messages all in upper case (use mixed case as you would in a letter).  Upper case is hard to read and is considered "SHOUTING" on CompuServe -- you'll see what I mean if you read enough messages.

There are no other "rules" but there are some conventions of behavior that will ease your life in the forum. Please see the "Manners and Ambience" section, next.


Manners
MANNERS AND AMBIENCE

This is the MSACCESS forum, so naturally what brings people together is an interest in Microsoft products -- most of the people here are working with Microsoft Access. These include developers, people using the products to manage their own data, and hobbyists. The range of skill and expertise is very wide -- from the loftiest Access Basic guru to the absolute beginner. Experts and beginners are equally valued -- beginners sometimes ask the best questions!

In addition to the people who write messages on the forum, there is another group we (affectionately) call "lurkers" -- people who monitor the forum (reading messages, downloading files) but for one reason or another haven't chosen to write any messages to us. We might tease lurkers from time to time

 but we value them as well.

Although intended as a "working" forum for sharing information and professional expertise, this forum is also a friendly and informal place.  People here can become quite close -- and a newcomer will hopefully find him/herself quickly accepted. When you join the forum, "old timers" will treat you

as a friend as long as you behave yourself (smile).

As with any group of friends, you'll find that there are lots of "in" jokes, many teasing comments, heated debates, occasional spats and feuds, people having a bad day who may be cranky -- the usual stuff of human interaction.  You'll find the reason we're friends is because we share common interests, are working in generally the same field, and appreciate the opportunity to communicate. For some of us who are isolated, the forum members are the only people we know who understand what we're talking about (grin).

So, when you "walk" into the forum, it will be more like walking into a large party with people who share professional interests than like walking into an office or a professional association. It's kind of like a user's group with no specific agenda.   As with all CompuServe forums, forum members range widely in personality, geography, race, sex, religion, etc. and this is *definitely* an equal opportunity forum.

3.1 Manners

So, now to manners. Basically all we ask is that you be considerate of everybody else. When I say "considerate", I mean *consider* that the person on the other end of your message is a human being with ups and downs, strong and weak points, good days and bad days. Consider that a person may reside

in a non-English speaking country and use English as a second language.  Consider that a person might be handicapped or that a person may not be the sex you *think* he or she is based on his or her name.

Also, *please* consider that people here represent different nationalities, races, ethnic groups, religions, abilities/disabilities, and sexes, and *respect* these differences. In this forum, it is important to us that we provide an environment where we *all* feel safe. If any one of us is ridiculed or insulted, we all lose since we lose their enthusiasm to participate with us and contribute to the work we do.

Consideration can be most important when you are upset. Within the bounds of consideration, you can complain, whine or throw tantrums, if you need to -- I think we all have at one time or another. But it takes a certain amount of skill to complain, whine or throw a tantrum politely and with consideration

for others. If you're upset, consider how your message might affect *you* if you were to receive it.

If you're considerate, you shouldn't run into too many problems here. But I must warn you that you are subject to teasing (because you're considered a *friend* from the beginning -- please don't take this personally) and if you should stray beyond the bounds of what's considered "appropriate" behavior,

you may receive a gentle admonition. If you are really out of line, a Sysop may decide to step in -- a Sysop is a final authority on behavior, and even long-term forum members quake before a Sysop's pronouncements (smile).

As a rule of thumb, a belligerent attitude is frowned upon -- it tends to make us uncomfortable because it upsets the balance of friendliness and consideration, retards the free flow of communication, and, frankly, we seem to be able to have very "loud" arguments without resorting to this approach.

3.2 Who's Microsoft and who isn't

People on the forum who work for Microsoft tech support have [MSFT] or  "Sysop" after their names in their identification. If somebody doesn't have [MSFT] or "Sysop" after his or her name, s/he is *not* an employee of the company and is just being helpful. Some forum members are so helpful, people sometimes assume they work for Microsoft even if they don't.

You may be interested to know that senior managers and many of the staff at Microsoft review the forum messages every day. They are all paying attention to what you have to say and their products reflect this interest. Also various Microsoft staff members will contribute to the forum from time to time. They will either have (Microsoft) after their name or identify themselves in their signature.

3.3 What to do if you're upset

It's not uncommon for people to log onto the forum for the first time because they're upset

-	because they've spent hours and hours working on a problem and can't solve it

-	because something about Access doesn't work the way it should or the way they think it should (often there's a difference)

-	because they've tried calling tech support and haven't received an acceptable answer yet

-	because they had something working in one product that suddenly doesn't work in an upgrade.

We understand and sympathize -- and it just may be that we can help you if you give us a chance. If this is true for you, here's what we recommend: first, *consider* the other forum members (see Manners) and

second, start your message with "I'm upset" (this lets us know that you're upset and we'll be sympathetic - that's a promise). Then try to explain your problem as succinctly as possible (for further guidelines -- see Asking Questions, section 6.0).


Emoticons
EMOTICONS AND ACRONYMS

You may have noticed that humorous comments have so far been expressed with such things as (grin) or (smile). One of the things that most puzzles newcomers is the use of acronyms and what are called "emoticons".  Here is an explanation of the important ones.

4.1 Emoticons

In an electronic medium such as the forum, it's pretty hard to get across certain elements of face to face communications that would otherwise be expressed with tone of voice, inflection or body language -- elements like humor, irony, sadness and various non-verbal "comments" on what is being discussed. Consequently, certain conventions have arisen to express this kind of thing.

Technically, an emoticon is an "icon designating emotions" depicted with symbols. Perhaps the most common of which is:

 :-)   	a smiling face on its side (tilt your head to the left to read it).

 grin	either the previous comment was meant humorously or one is responding with a laugh to somebody else's humorous comment -- perhaps the most widely used symbol on this forum.

 smile	usually means that one is smiling at somebody else's comment or could refer to one's own comment that is slightly humorous.

<gd&r>	grinning, ducking and running -- the previous comment was a "tease" and the person issuing the tease is now hiding out from his or her target.  Some variations of this are a simple <gd> (grinning and ducking) or <gd&rvvf> (grinning, ducking and running, very very fast).

<rofl> or <rof,l>	rolling on the floor laughing -- the ultimate acknowledgement of somebody else's humor or an indication that you think you just said something yourself that is pretty ridiculous.

* or _ 	as in *emphasize* or _emphasize_    equivalent to italics or underlining.

(There are literally hundreds of others.) However, the term is also being used to apply to text-based equivalents which are more commonly used on this forum.

Creative people on the forum will sometimes make up their own emoticons from time to time but they almost always explain them since nobody would otherwise know what they're talking about <g>.

4.2 Acronyms

Many acronyms have also become standard -- mainly to save typing. Some of the common ones are explained here. Any others you encounter, you'll have to figure out for yourself, but once you've got the "trick" down, it's kind of fun.

General CIS-wide acronyms:

BTW	By the way

CIS	CompuServe Information Service

FWIW 	For what it's worth

IAC   	In any case (also IAE -- in any event)

IANAL 	I am not a lawyer

IMO   	In my opinion

IMHO  	In my honest/humble opinion (in the latter case a sure sign the opinion is not going  to be humble at all <g>)

IOW   	In other words

JIC   	Just in case

KOW   	Knock on wood

OIC   	Oh, I see!

OTOH  	On the other hand

PITA  	Pain in the "acronym"

POV   	Point of view

PPN   	Programmer project number, i.e. a CIS user's id#

RSN   	Real soon now (computer lingo for "don't hold your breath")

RTFM  	Read the f* manual (variously interpreted for public consumption as read the fine manual, read the fabulous manual, you figure it out <g>).

TIA   	Thanks in advance

TSR   	Terminate and stay resident program

WYSIWYG 	What you see is what you get

YA...   	Yet another .... (as in YAA -- yet another acronym)

Here are some other product-related acronyms:

API   	Application programming interface

DD    	Data dictionary

ER    	Enhancement request (request for an enhancement to the product or documentation)

GUI   	Graphical user interface

MU    	Multi-user

OO, OOP	Object oriented, object oriented programming

SU    	Single user

UDF   	User defined function

UG    	Users Guide

In addition there are a large number of platform specific acronyms and abbreviations such as QEMM, DV, WIN, INIT, CDEV, DA, which you'll either know or can ask about.


Organization
FORUM ORGANIZATION -- MESSAGES, THREADS, SECTIONS

The forum is comprised of individual messages from one forum member to another. These messages are organized by thread -- a "thread" is simply a string of related messages and replies brought together under a "thread topic", which serves as the "message header" for every message in that thread. Here's an example of a message header:

#: 83761 S1/Non Tech Services    	* message number, section

    06-Dec-92  11:38:01        	* date and time

Sb: #83591-#Access is Way Cool...	* responding to message#, topic

Fm: Kevin Costner 72230,2664  	* from forum member

To: Phil Collins 72261,640   	* to forum member

Threads begin when an individual creates a new message (not replying to a previous message) and grow as other individuals reply. A new thread may also be created when replying to a previous message by changing the topic or posting the reply to a different section.

Threads are further organized by forum section (such as Queries or Forms -- a list or sections is included in Message Etiquette, section 7.2. New threads should be posted to the section appropriate to the topic.

Messages themselves may be either public or private (see below) and cannot exceed about 2,000 characters in length. For assistance in composing and posting messages, please refer either to the CIS help files or to the documentation provided with your communications software. Further information as relates specifically to this forum will be included in this document in appropriate places.

5.1 Message Traffic and Scroll Rate

Message traffic is the number of messages which get posted to a forum in a day. The volume on the MSACCESS is very high -- ranging from about 100 messages a day when a lot of folks are at Comdex to as many as 500 messages a day when something really interesting happens. Message traffic probably averages about 200-300 per day.

A CIS forum is limited to a certain number of message "slots" or total number of messages at any one time. As messages are posted, the message slots fill up. When they are full, messages begin to "scroll off" (disappear) on a First In, First Out basis (early messages scroll off before later ones). With message traffic (also called the scroll rate) of 300 messages a day, the first messages in the queue will disappear in about 6 days.

5.2 What the Heck All This Means to You

The nature of threads and the high scroll rate in this forum frequently have consequences for how you ask questions, how you formulate replies, and how you can help the forum function efficiently. Details will be included in later discussions where appropriate.


Asking
ASKING QUESTIONS

Forum members are very helpful, patient and forgiving -- no matter what level of expertise you have. You will almost certainly get an answer to your questions, if you are aware of certain facts of life.

Due to the high message volume on this forum, forum members who read all the messages (and there are many) are trying to keep up with forum traffic, be helpful, earn a living, and live something like normal lives -- all at the same time.

It's recommended that you check in again within two or three days after you leave a message and that you read all the messages in your thread -- otherwise you might 1) miss responses that have disappeared due to the high scroll rate and 2) miss responses that may not have been addressed *directly* to you -- people tend to reply to the most recent message in the thread rather than going back to your original inquiry. Any message sent  *directly* to you and not read before it scrolls will automatically be sent

to you via CompuServe Mail.

6.1 Phrasing your question

The way you phrase your question can make a big difference in the kind of response you get.

Here's the "worst case" question -- one that forum members will want to avoid (tech support will answer, of course, but you may be missing an opportunity to get a speedy reply from someone else):

   "I just got Access and it doesn't work. Can anybody help?"

Obviously, the first thing anybody has to ask is: What do you mean it "doesn't work"?  Just finding out the basics could take quite a bit of time.

So, here are some guidelines:

- 	Be SPECIFIC.  (and be sure to post your message in the appropriate section of the forum -- a list of orum sections is included later in Message Etiquette, section 7.2).

- 	Tell us whether you are writing a program or using Access interactively.

- 	Tell us exactly what error messages you are getting, if any.

-	Tell us what you are trying to do, what you did just before the problem occurred, and *exactly what happened*.

-	Please inlcude specific *step-by-step* instructions that will help use to reproduce your problem.

-	If it's a programming problem, post the actual bit of code or macro group that you think is causing the problem or a close approximation.

In addition:

Post your question to the proper forum section (see Message Etiquete for a list). Some forum members only read messages in specific sections -- if you post in the wrong place, the person with the answer might not see it. And  choose a suitable, informative, and specific *topic* for your message.

"Report Sum Question" in the Reports section will almost certainly get a better response than "HELP!."

Post any program code or formatted messages as UNFORMATTED. CompuServe normally "formats" or "word wraps" code that's uploaded to the forums -- i.e. it strings all the lines together if they are not separated by a completely blank line. This will turn your carefully indented code into a garbled mess which is very difficult to read. You can avoid this when you're on-line with CIS by using the "POST UNFORMATTED" command. With various programs such as TAPCIS or Navigator (that allow you to read and respond to messages off-line -- explained later in this document), use their "Unformatted" option. You may also insure proper indentation by preceding each line of code with one or more spaces or a tab.

Roughly, if you're having a problem which appears to involve the way Access interacts with your hardware such as loading or operating slowly, not loading at all, running out of memory or disk space, video display problems, running on a network, etc., please be as specific as possible about your operating environment, perhaps including your operating system (Windows 3.1, DOS 5.0), your DOS CONFIG.SYS, AUTOEXEC.BAT,  type of network, network settings, and so on and so on <g>.

6.2 Uploading files

If you have a very difficult or complex problem, it may eventually be resolved only by sending it to someone else for review. There are two approaches:

1) If tech support *SPECIFICALLY* requests that you send them your problem (and at no other time), upload it to the forum libraries. Problems sent this way will be treated as private communications -- however, if you want to have the problem reviewed by non-Microsoft folks, you may specifically ask the sysops to post it publicly to the libraries. Uploading to forum libraries is free of connect charges so this is definitely the most efficient way to send things to Microsoft. More information about uploading files to libraries can be found in Uploading Files, section 9.2.

2) If a non-Microsoft forum member has been assisting you, you can send your problem to him or her via CompuServe mail. However, there _is_ something like a "rule" about this:

DO NOT UPLOAD ANYTHING TO ANYBODY WITHOUT THEIR *SPECIFIC* PRIOR APPROVAL.

Downloading something from CompuServe costs the recipient money in phone and CIS connect charges. Many active forum members use automated programs to download their messages and files and these programs do not give them the chance to refuse a download -- anything in their box is downloaded automatically. It's simply not fair to impose this burden on them without their consent. The above rule also means that if somebody has been kind enough to look at something before, it doesn't necessarily mean they want to look at it again, no matter how great it is now <g>. It's a simple matter to request and receive permission before you upload -- do it!

In EITHER CASE, when you upload something to somebody, be considerate again -- send them the minimum that's necessary to "get the job done", i.e. give them the information they need to assist you and compress the file (using PKZIP  -- more on this later) to reduce transmission time.

6.3 Responding to answers

If you have asked a question and someone has replied with an answer, read what they have to say carefully. If they've solved your problem, great! If they haven't, but are trying to help, *answer their questions*. Remember they may be in a hurry, or have misunderstood your question or situation, or

may even be telling you something incorrect (not on purpose, of course), so if you don't understand something they say, don't be afraid to say "I don't understand."

6.4 Acknowledgments

If somebody helps you out, a simple "Thanks!" is appreciated.

If you've had a particularly knotty problem that appears to have been a challenge to resolve and/or if many people have made a lot of different and possibly conflicting suggestions -- when you've finally got it working, we'd appreciate knowing what exactly you did that worked. The reason we appreciate

this kind of summary is because many of us may have or anticipate having the same kind of problem, and we'd like to know the answer too! In addition, it may be a valuable addition to Microsoft's Knowledge Base - a tool that we use to help you solve your problems.

6.5 If you don't get an answer

If you leave a message and nobody responds, it may be because it "just happens" that nobody has time to respond, because everybody simultaneously decides that "somebody else will answer", or because your message was unclear and nobody knew *how* to respond.

You can increase your chances of having a response to your message by:

-	Posting your message again -- and saying that your original message was not addressed.

-	Posting your message directly to a sysop or to "all".

-	Rephrasing your message.


Tips
TIPS FOR THE ACTIVE PARTICIPANT

As mentioned earlier, the message traffic on the MSACCESS is very high. It can be quite a chore to manage this volume of communication and keep CIS connect charges to a minimum. Here are a variety of hints that may prove useful.

7.1 Thread Integrity and Continuity

All forum members, experienced and novice, benefit from the forum threads.  Often a thread will address a problem that many other forum members have or anticipate having. Consequently, it is important that all messages that contribute to the thread remain available during its lifetime (thread integrity). In addition, it's extremely useful if relevant messages are contained _within_ the thread and in the proper order (continuity). With this in mind:

-	public messages should not be deleted if they contribute to the thread.

-	relevant responses to existing messages should be generated by *replying* to the message rather than starting a new message.

-	multiple part messages, as much as possible, should be kept together (more on this a little later in Message Etiquette).

Related to this issue is the "other side of the coin" where messages are no longer relevant to the topic. It is possible on CIS to scan available messages by "message header" or thread topic. This can be a useful approach if you're trying to save on connect charges. However, this is not *guaranteed* to be a foolproof approach. Threads on this forum tend to wander, and strict adherence to a thread topic is not rigorously enforced.  Consequently if you're downloading a thread whose topic looks interesting, you may discover:

-	the messages have wandered off the thread topic

-	the messages have deteriorated into a series of jokes

At a rough guess, some of us estimate that the really relevant messages in a thread are the first 1 to 10, although that is not necessarily the case -- when a topic is complicated, messages may still be useful during the thread's entire life or, OTOH, a thread may deteriorate into jokes almost immediately. Unfortunately, due to the high message traffic, the beginning of a thread may scroll off so that all that remains in the forum are the less relevant messages. This is not to say that the messages which aren't

relevant to the topic aren't useful <g> -- indeed, they are frequently useful -- and the jokes are often good, too.

-	Please use upper and lower-case for your name and messages. Upper case words indicate EMPHASIS and a message in all capitals looks as though you are "SHOUTING."

-	All Message Subtopics correspond to the same Libraries and Conference Rooms.

-	If you upload a file in the public libraries, please upload it into New Uploads Library.  Files uploaded into New Uploads will remain for about one month and will be moved to their permanent location

-	We do NOT make any guarantees regarding freeware or shareware available for downloading from this forum.

Section Leaders cannot provide the following:

1.   Sample code or macros with responses; however, Microsoft may request sample code or macros for bug verification

2.   Private responses to questions or private phone calls

3.   Source code or macro debugging, design review, in-depth discussion of Windows internals, or bench marking of code

4.   A guarantee of question RESOLUTION

5.   Any proprietary, philosophical, or third-party recommendation information.

7.2 Message Etiquette

In consideration of forum members who do not read all the messages (those who download the threads whose topics sound interesting) and to support thread integrity and continuity, please observe the following suggestions:

   Please post your message to the most applicable section. MSACCESS

   sections are (note that these sections will change from time to time):

1. Non Tech Services

2. Tables/DB Design

3. Queries

4. Forms

5. Reports/Printing

6. Macors/Modules

7. Import/Export

8. Multi-user/Networks

9. OLE/DDE

10. SQL Server/ODBC

11. Security

12. Setup

13. Suggestions/Mktg

14. User's Groups

15. Third Party

 When starting a new thread, try to name it something that captures the

 essence of your message and be as specific as possible -- unless it's the

 Chatter section where you can name it anything you like <g>.

 When replying to a message, if your reply is substantially changing the

 subject, please post it under a different topic and to a different section

 if applicable.

 If your reply is directly relevant to the current topic, please DO NOT

 post it to a different topic or section. Use CIS or your off-line

 software to REPLY to the message.

 If you want to make sure that a specific person sees your message and sees

 it as quickly as possible, make sure you address it specifically to him or

 her and *be sure to include his/her CIS id number*. This is important

 because:

 Some people only read messages addressed directly to them and will miss

 your message entirely. (Note: reading only personal messages is not

 recommended practice in this forum because you will almost certainly

 miss further possibly relevant messages in a thread.)

 Many active participants will read their personal messages during the day

 and download everything else in the evening -- so they might not see a

 particular message until later.

 If the message scrolls off before the addressee sees it, CompuServe can

 not forward it to CompuServe mail without an id number.

Long messages: If you have a particularly long message, remember that individual messages are limited to about 2,000 characters. When a message exceeds that limit, you can either send it via CIS Mail to an individual or you can split it into parts and post it on the forum. CIS Mail has a very high message length limit, but no one on the forum will see messages sent that way.

In the interests of thread integrity and continuity:

Post long messages that are relevant to an existing thread, or that are of general interest, to the forum not to CIS mail so we can all benefit.   Other long messages may of course be posted as well. If you find that you seem to be engaged in a topic that is not particularly Access related or is really a conversation between you and one other person, consider moving that conversation to CIS mail (you might want to ask first to see if anybody has been following the conversation and would like to see it continue).

There are two approaches to splitting messages which are a little contradictory.

First, there is an option called /SPLIT (please refer to CIS help or your CIS communications software documentation). By inserting /SPLIT at the bottom of a message, the next message you send will automatically continue the message. The benefit of /SPLIT is that it keeps the parts of your message *together* when they are posted. The drawback is that subsequent messages are addressed to *you* rather than the person to whom you were originally replying. Since (as mentioned earlier) some people only read messages addressed directly to themselves, these people will not see the continued parts (or may not see them until later).

 The alternative approach is to send continued messages by simply continuing to reply to a message and manually inserting "more" and "continued" in your messages as appropriate. The benefit of this is that the intended recipient will be sure to receive all parts of the message in a timely fashion. The drawback is that messages split this way may not get posted together and can be interrupted by other replies (which

impairs continuity).

Rule of thumb: Use /SPLIT unless you want to guarantee that the recipient will see all parts or all parts as soon as possible. In the latter case, continue to reply.

7.3 On-Line vs Off-Line

CIS connect charges are high and MSACCESS message traffic is high -- the two can combine to deliver whopping credit card bills (not, unfortunately, much to joke about). If you plan to frequent the forum or other CIS forums, it is highly recommended that you investigate several programs that download and upload forum messages in a more efficient and less costly way.

Note: CompuServe offers a product called CIM (CompuServe Information Manager) which is useful to manage your work on CIS -- however, it mainly works on-line and will not reduce your connect charges as much as the products I will discuss here.

A couple of programs we would recommend are OzCIS and TAPCIS. These programs will log onto CIS for you, upload and download messages and files, and provide you with other utilities.  Their major advantage is that they allow you to read and respond to messages *off-line*. Not only is this *considerably* cheaper, but also it allows you to review and respond at your leisure. If you want to get up to check a manual or break off for a moment to test something in a program, you can do so without the terrible pressure of connect charges eating away at your pocketbook. Moreover, it allows you reflect on what you say, change your mind, correct your mistakes, and improve the quality of your messages in

general.

Another advantage is that these programs can be used in a variety of ways to capture only the messages you really want to see and further cut down your connect charges. For example, with TAPCIS, you can read only certain forum sections, you can read all messages or download the thread topics (which you

can mark off-line to be downloaded the next time you log on), or you can read only messages addressed to you personally.

These programs offer a further advantage in that they provide an option for retaining past messages (yours and others) in a file on disk for future reference. These files can be archived from time to time and transferred to floppies or otherwise managed. Forum members have a variety of strategies for managing these files. As an example you can archive (using PKZIP) the message file about once a week and keep about a month's worth of zipped files on your hard disk.

Some forum members keep *all* their messages. Some rely on the forum archive files to capture the "best parts".

In addition to the basic programs, the offline communications programs often have many additional utility programs.

More information about downloading files from libraries can be found later in this document.

OzCIS

OzCIS is freeware. Files to download from CIS, from the IBMCOM forum (GO IBMCOM), Library 12, are:

OZCIS.BRO...7868 (<-file size)

  This file outlines many of the capabilities and features of OzCIS

  version 1.2 and later.  Plain ASCII text file; can be REAd online or

  downloaded.

OZCIS.REQ...5940

  This file describes the minimum hardware and software requirements in

  order to run OzCIS version 1.2a and later. OzCIS is a big program and

  requires considerable system resources; reviewing this file before

  downloading the main program files could save you considerable online time.

  Plain ASCII text file; can be REAd online or downloaded.

OZCIS1.EXE...279454

  OzCIS is a auto-navigator to automate CompuServe access for Mail, Forums

  and other areas of the service. This is Part 1, the Main Program file.

OZCIS2.EXE...167057

  This is Part 2, the Online Processor file.

OZCIS3.EXE...131049

  This is Part 3, the Accessories file.

OZCIS4.EXE...138820

  This is Part 4, the Documentation file. Note: Changes/additions to the

  documentation since version 1.0 are in the README.1ST file included in

  the Part 1 and 2 files.

OZHELP.ZIP...159173

  The files included in this archive are intended to provide the ability

  to reference the OzCIS documentation from within OzCIS as a supplement to

  the on-line help. This on-line documentation is intended to be used with

  the shareware documentation reader, AUTOREAD.EXE, installed as an EXTERNAL

  under OzCIS. AUTOREAD may be found in IBMSYS LIB 6 (BRO /KEY:AUTOREAD).

TAPCIS

TAPCIS is a shareware program. Files to download from CIS, from the TAPCIS forum (GO TAPCIS), Library 1, are listed below. You can also order the program by calling Support Group, Inc. at 800-USA-GROUP.

TAPCIS.INF...13963 (<-file size)

    This file describes TAPCIS in detail along with its requirements

    and pricing. You should download and read this file before downloading

    the TAP.EXE program and TAPDOC.EXE documentation files from Library 1.

TAP.EXE...211812

  TAPCIS(tm) Version 5.4, The Access Program for the CompuServe

  Information Service. TAPCIS completely automates CompuServe Mail and Forum

  messages and libraries. TAPCIS cuts online time to a minimum and frees you

  to do other things while it does all online actions without user input.

  We guarantee you'll love TAPCIS with a 21 day shareware trial and a

  90-day money back guarantee. Copyright (c) 1991 Support Group Inc. Manual

  in TAPDOC.EXE. Prev downloads: 43,430+

TAPDOC.EXE...154832

  TAPCIS(tm) 5.4 Documentation in a self extracting file. This program

  will expand into all ten sections of the TAPCIS docs plus appendixes, table

  of contents, and index. See file README.DOC included in this file for

  more information. You will need this documentation to set up TAPCIS

  properly. Program is in TAP.EXE.


LIBRARIES

The forum libraries contain many informative and useful files. An exploration of the libraries is well worth the trouble. The MSACCESS libraries are the same as the MSACCESS sections.  You should post your file to the section that it relates to most closely.  If you don't know what that is, you could post it to Non Tech Services.

Files in the libraries come in two basic forms: ASCII and binary. ASCII files are text files which will be readable without further attention.  Binary files are *either* files (including text files) that have been

compressed to save space and downloading connect charges *or* other binary files like programs or graphics files.

9.1 Compressed Files

There are several types of compressed files:

   .ZIP files  -- Compressed using PKZIP -- these are uncompressed

    by using PKUNZIP.EXE. PKZIP/UNZIP are shareware programs

    available for downloading from the MSACCESS forum.

   .EXE files -- Mostly this extension indicates that the file is

   a "self-extracting" compressed file. This means that the file will unpack

   itself when you type the file name. *Usually* these files are also

   compressed using PKZIP -- however since they're self-extracting, they do

   not require PKUNZIP.

   .ARC files -- Compressed using Arc utilities or such commonly available

   compatible programs as ARC-A.COM. Can be uncompressed with ARC-E.COM,

   available in the IBMCOM forum, library 2, and elsewhere (look for

   ARC-E.COM and ARC-E.DOC).

9.2 Uploading Files

Most files in the libraries have been uploaded by forum members for use by other forum members and we encourage you to do the same. If you have developed a utility or a function or a bit of code or have some particular information to share that appears to spark general interest, please send it on up! Remember, uploading to forum libraries is free of connect charges.

If tech support *SPECIFICALLY* requests it (and at no other time), you can also upload code that you're having a problem with and which appears to be too lengthy or complex to post on the forum itself.

The mechanics of uploading a file can be fairly tricky.  Please refer either to CIS Help or your CIS communications software documentation. If you want additional help, CIS has a practice forum (GO PRACTICE) where you can practice uploading a file, writing messages, etc. Time spent in the practice

forum is free of connect charges.

Here are some guidelines for uploading:

-	Combine and compress any files you are sending into one archived file using PKZIP or the self-extracting options of other compression schemes.

-	For some reason, CIS limits file names in libraries to only 6 characters (not including extension). It's better if you limit your file name to 6 characters yourself -- otherwise CIS may truncate the file name in a way that you don't really want. File names should begin with a letter and contain *only* letters and numbers. They should not contain spaces or punctuation (including underlines and hyphens), or miscellaneous characters like * or ^.

-	When uploading, please include a brief but complete description of the files included and what they do. If space allows, I always like to see the name of the person who's sending it and a note about how large the file will be when uncompressed (disk space is sometimes tight <g>).

-	The sysop will check the file for viruses and perform some other maintenance. Consequently, it may take a few days before the file becomes available to others.

-	Let people on the forum know that you've uploaded the file, what its name is, and where you sent it.

NOTE: If you are uploading a file with the *same* name as a file you previously uploaded, the old file will be replaced with the new one.  However, if you are uploading a revision and want to use a new name, please help with library housekeeping by deleting the old file yourself using the CIS Library Menu.


Afterwards
AFTERWORD - The Spirit of Contribution

We need all the help we can get! <g> We need people to be more specific and precise asking questions (and it would certainly help if people check the manuals and other product documentation resources first). We need people to be more careful about thread continuity and integrity. We need people to be more considerate (tempers are sure to fray <g>). And we need people to help others more than ever before.

One of the things we want to distinguish the MSACCESS Forum from others is the very unselfish way forum members help each other day after day. We feel there is an underlying intent on the part of most forum folk to make a contribution to others on the same path. We also feel as long as this "spirit of

contribution" remains a force, the forum will work well for all of us.

You can really help maintain the value of the forum by logging on with an *intent to contribute*. If you want to ask a question, ask it with an eye toward contributing to our knowledge as well as yours. Share experiences that you feel will be of value to others. Answer the questions of others.  And try, especially, to keep to the public agenda and avoid self-promotion.

There's certainly opportunity on the forum for vendors of products and services to offer their wares (in moderation), and vendors are *just the kind of people we need* to help us. Yet it's always a little irritating when we see a vendor log on *only* to promote something while so many others are helping for free. If you are a vendor, hang around a little and contribute; give back a little to the community that supports you. (And from a purely practical point of view, establishing a helpful presence on the forum should serve to enhance your marketability.)

Although making a contribution is always a source of personal satisfaction, we believe that there's more at stake here -- we are building a community that can support us in our work and in our lives. That's

something worth investing in -- contribution is truly an investment in our future.

See you on the forum!


Compuserve Sysops

Below is a list of the present Microsoft Sysops that perform daily duties on Compuserve.

Customer Service:

. Charisa Martin	(Domestic) 	76701,245

. Kara McKenzie 	(Int'l)	72200,1641

.

ACCESS (MSACCESS FORUM)

.Steve Alboucq 	(Support Manager)  	72662,1613

.Mark Chaffin  	(Support Manager)  	73322,664

.MariEsther Burnham 	(SL)          	72662,1617

.Monte Slichter 	(SL)              	72662,1611

.Kim Hightower 	(SL)               	72662,1606

.Kim Abercrombie 	(SL)             	72662,1605

.Ryan LaBrie 	(SL)                 	72662,1620

.Joe Howard 	(SL)                  	72662,1610

.Gary Yukish 	(SL)                 	72662,1616

.Jim Hance 	(SL)                   	72662,1607

.Roger Harui 	(SL)                 	72662,1614

.Tad Orman 	(SL)                   	72662,1612

.Dick Cullom 	(SL)                 	73322,665

.Lynn Shanklin 	(SL)               	73322,666

.Sunny Lam 	(SL)                   	73322,667

.Heather Pacheco 	(SL)             	73251,2437

.John Stadick 	(SL)                	73324,3353.

BEETHOVEN (MSAPP FORUM)

.Kris Piccolo 	(SL)	76711,166

.

BOOKSHELF (MSAPP FORUM)

.Kris Piccolo 	(SL) 	76711,166

.

CINEMANIA (MSAPP FORUM)

.Kris Piccolo 	(SL) 	76711,166

.

DOS (MSDOS FORUM)

.Jeff Armstrong 	(SL) 	75300,3130

.Nat Bowman 	(SL) 	75300,3127

.

EXCEL (MSEXCEL FORUM)

.MAC - Melissa Frix 	(SL) 	72420,562

.WIN/PM - John LaTour 	(SL) 	72560,2425

.

EXCEL SDK (PROGMSA)

.Frank Beeson 	(SL) 	71075,3616

.

FLIGHT SIMULATOR (MSAPP FORUM)

.DOS/MAC - Rich Noren 	(SL) 	75000,1356

.

MAIL (MSAPP FORUM)

.DOS - August Hahn 	(SL)	72360,1177

.MAC - Mark Adcock 	(SL)	76701,243

.

MONEY (MSAPP FORUM)

.Kiska Gifford 	(SL)	76711,361

.

MOUSE (MSAPP FORUM)

.Dan Brown 	(SL)	72410,2415

.

MULTIPLAN (MSAPP FORUM)

.DOS/MAC - Jeff Jorgenson 	(SL) 	76701,152

.

POWERPOINT (MSAPP FORUM)

.MAC - Rosie Khoo 	(SL) 	76711,165

.WIN - John Hobgood 	(SL) 	76711,167

.

PROJECT (MSAPP FORUM)

.Jeff Jorgenson 	(SL) 	76701,152

.

PUBLISHER (MSAPP FORUM)

.Rolf Nelson 	(SL)	76701,267

.

SOUNDBITS (MSAPP FORUM)

.Kris Piccolo 	(SL) 	76711,166

.

VIDEO FOR WINDOWS (MSAPP)

.John Langhans 	(SL)	76711,167

.

WINDOWS (WINNEW and WINADV FORUMS)

.Debbie Simmons 	(SL) WINNEW	76711,360

.Susie Bernard 	(SL)WINNEW	76711,416

.Angela Trusch 	(SL)WINNEW	76702,1370

.Gene Whitley 	(SL) WINNEW	71333,547

.

.Jordan Montgomery 	WINADV	76702,1371

.Wayne Cook 	(SL) WINADV	71075,2433

.Craig Sommerville 	WINADV	75300,3125

.Gene Whitley 	(SL) WINADV	71333,547

.Jamie Emmanuelli	WINADV	76711,202

.

WINDOWS FOR WORKGROUPS (MSWRKGRP)

.Jeff Williams 	(SL)	76702,1501

.Val Peterson 	(SL) 	71333,545

.Lisa Childers 	(SL)	71333,546

.

WORD (MSWORD FORUM)

.DOS - John Guerin	(SL) 	76701,266

.MAC - David Carson 	(SL) 	76701,56

.OS/2- Mark Bishop 	(SL)	75300,3600

.WINDOWS/PM - Kate Edson 	(SL)	76701,54

.WINDOWS/PM - Sandy Weil 	(SL)	76701,153

.WINDOWS/PM - Luann Vodder 	(SL)	76711,203

.

WORDBASIC (PROGMSA)

.Kate Edson 	(SL) 	76701,54

WORKS (MSAPP FORUM)

.DOS - Kris Piccolo 	(SL) 	76711,166

.MAC - Rosie Khoo 	(SL) 	76711,165

.WIN - Robert Williams 	(SL)	75300,503


GEnie
Accessing Software Library/RoundTable/Knowledge Base on GEnie [PSS]

ARTICLE NUMBER: Q57589

CREATED: 09-JAN-1990

MODIFIED: 16-SEP-1992

Summary:

This article explains how to access the Microsoft Software Library,

RoundTable, and Knowledge Base on GEnie.

More Information:

Requirements

------------

   GEnie Account Number

   Modem

   Telecommunication Software

GEnie Account Number

--------------------

You must have a GEnie account number available for your use. For more

information about obtaining a GEnie account number, contact GE Client

Services at (800) 638-9636.

Connection to GEnie

-------------------

A modem and telecommunication software are required to connect to

GEnie. The modem can have a baud rate of either 300/1200 or 2400. The

telecommunication software is necessary to act as an interface between

your computer and GEnie. The documentation you receive with your

telecommunication software will guide you in setting up the software

to connect to GEnie.

Seattle Area Numbers

--------------------

   300/1200 baud    286-6560

   2400 baud        286-6584

Software Library, RoundTable(s), and Knowledge Base

---------------------------------------------------

Once connected to GEnie, you are ready to access either the Microsoft

Software Library, RoundTable(s), or Knowledge Base.

The Microsoft Software Library on GEnie is located on page 506; the

Microsoft RoundTable(s) and Knowledge Base are located on page 505. To

access the Microsoft Software Library, RoundTable, or Knowledge Base,

type the letter "M" ("Move") followed by the page number for the

desired choice, as in the following example:

   GENIE                   TOP                 Page 1

                GE INFORMATION SERVICES

   1.  Genie Users' RT              2. Index-Info

   3.  Billing/Setup                4. GE Mail & Chat

   5.  Computing                    6. Travel

   7.  Finance                      8. Shopping

   9.  News                        10. Games

   11. Professional                12. Leisure

   13. Reference                   14. Logoff

   Enter # or <Help>? m 506

M 506 tells GEnie to (M)ove to page 506 where the Microsoft Software

Library is located. Software Library 2, "Systems Journal and

KnowledgeBase", contains software library files provided by Microsoft.

To access the RoundTable or Knowledge Base, type "M 505" (without the

quotation marks) at the prompt.

After typing the desired page at the prompt, a menu will appear on the

screen. Enter your selection by typing the number of the menu option.

Articles in the Knowledge Base reference files in the Software Library

using the unique S-Numbers assigned to the files. Files in the

Software Library reference the pertinent articles in the Knowledge

Base using the unique Q numbers assigned to the Knowledge Base

articles.


Internet
Support Network offers info via Internet

The Knowledge Base and Microsoft Software Library information is available for Microsoft development tools and advanced systems products, including Windows NT, the Win32 SDK (Software Development Kit), the Windows 3.1 SDK, Visual C++, Visual Basic, LAN Manager, SQL Server, and others. On the server, you will find the complete Developer Knowledge Base with articles written and used by Microsoft Support Engineers. You will also find device drivers, patches, code samples, help files, and white papers.

The name of the server is ftp.microsoft.com, and the IP address is 131.107.1.11. You can ftp to the server by logging on as anonymous and using your full Internet name as the password:

>ftp ftp.microsoft.com

>User: anonymous

>Password: your Internet name

The readme files in each directory describe how to access and retrieve information from the system, and they give an overview of the directory structure and example ftp scripts for automated access. If you dont currently have access to the Internet or have questions about connecting to the service, contact your system administrator for more information.The directory structure for the Microsoft anonymous ftp server is:

ftp.microsoft.com

\product cluster\product

\docs	(assorted documentation)

\kb	(Knowledge Base articles and index)

\mrktg	(marketing information)

\sup-ed	(supported drivers, patches and utilities)

\unsup-ed	(unsupported drivers, patches and utilities)

Network news groups related to Microsoft products are also available for peer-to-peer discussion about technical and product issues. The news groups include:

comp.os.ms-windows.programmer.win32

comp.os.ms-windows.programmer.tools

comp.os.ms-windows.programmer.misc

comp.os.msdos.programmer

comp.os.ms-windows.advocacy

comp.os.ms-windows.announce

comp.os.msdos.5dos

comp.os.msdos.apps

For more information about the Microsoft Support Network in the U.S., see the next issue of Developer Network News, or call 1-800-936-3500.


Training Centers
Microsoft Access Training Centers

Arizona

CCT CONCEPTS IN COMPUTER TRAIN	TEMPE	602-894-8644

INACOM	TUCSON	602-325-4900

MIDAK INTERNATIONAL, INC.	TUCSON	602-577-2661

RIGHTFAX	TUCSON	602-327-1357

TYPETRONICS BUSINESS SYSTEMS	PHOENIX	602-274-7253

WJM COMPUTER SALES	TUCSON	602-792-4220

British Columbia

ESCOM SOFTWARE SERVICES LIMITED	BURNABY	604-438-7361

California

ACCELERATED COMPUTER TRAINING	LOS ANGELES	213-388-0551

ADVANCED INTEGRATION METHODS	WALNUT CREEK	510-988-0101

AMERICAN DIGITAL TECHNOLOGIES, INC.	COSTA MESA	714-433-1300

BUSINESS INFORMATION TECHNOLOG	CONCORD	510-671-0595

CHAPARRAL COMPUTERS & NETWORKS	SAN DIEGO	619-481-1900

COACHELLA VALLEY COMPUTER	PALM DESERT	619-341-4505

COMPULEARN COMPUTER TRAINING C	TARZANA	818-344-8434

COMPUTER NETWORK SYSTEMS, INC.	BURBANK	818-846-9888

COMPUTER ORIENTED SOLUTIONS	ARCADIA	818-303-4000

COMPUTER UTILIZATION, INC.	SACRAMENTO	916-364-0203

DATAWIZ CENTERS	SAN MATEO	415-571-1300

DRAKE COMPUTER TRAINING	LOS ANGELES	310-824-3880

EDUTEK PROFESSIONAL COLLEGES	SAN DIEGO	619-280-9933

LEARNSOFT, INC	SAN DIEGO	619-546-1400

NETBASE COMPUTING, INC.	TORRANCE	310-214-8181

PC ETCETERA, INC.	SAN FRANCISCO	415-291-8585

QUICKSTART TECHNOLOGIES	HUNTINGTON BH	714-894-1448

THE DUBLIN GROUP, INC.	SAN FRANCISCO	415-227-4777

WINSON OLSON & COMPANY, INC.	SANTA ANA	714-549-5267

WONDERWARE	IRVINE	714-727-3200

Colorado

RANDOM ACCESS, INC.	DENVER	303-745-9600

SEMIOTIX, INC.	AURORA	303-743-1400

SEXTANT GROUP	ENGLEWOOD	303-792-0400

SYSTEMS DESIGN CORPORTATION	LITTLETON	303-730-3600

Connecticut

CPCE, INC.	SHELTON	203-925-0400

DESAI SYSTEMS, INC.	W HARTFORD	203-233-8050

KEANE, INC.	BRIDGEPORT	617-863-0330

LINC SYSTEMS CORPORATION	BLOOMFIELD	203-286-9060

LOGIC CONTROL	WESTPORT	203-454-3663

MICRO NETWORKS OF AMERICA, INC	FARMINGTON	203-678-7400

TECHWORKS INTERNATIONAL	WESTPORT	203-221-1500

Washington DC

FUTURE ENTERPRISES, INC.	WASHINGTON	202-662-7610

Florida

BASE ONE, INC.	FT LAUDERDALE	305-472-4077

CORPORATE CONSULTING GROUP	DUNEDIN	813-736-6228

FINANCIAL DATA PLANNING CORPOR	MIAMI	305-858-8200

THE NETWORK GROUP	MELBOURNE	407-723-8550

Georgia

EDG, INC.	ATLANTA	404-952-3030

KAPLAN COMMUNICATIONS	ATLANTA	404-633-8535

SUNRISE COMPUTER SYSTEMS / USCONNECT	ATLANTA	404-237-5400

Hawaii

COMPUTER TRAINING ACADEMY	HONOLULU	808-531-0575

SYSTEMS GROUP, INC.	HONOLULU	808-526-1551

Iowa

CEDAR COMPUTER CENTER	ANKENY	515-965-0357

Idaho

COLLEGE OF SOUTHERN IDAHO	TWIN FALLS	208-733-9554

Illinois

APPLIED COMPUTER SERVICES	ORLAND PARK	708-614-4900

AUTOMATED CONCEPTS, INC.	CHICAGO	312-380-4200

COMPUTER SUPPORT CENTERS	SCHAUMBURG	708-397-8000

INFORMATION MANAGEMENT GROUP	CHICAGO	312-280-1007

KGN CONSULTING	CHICAGO	312-819-4300

MCCLURE CONSULTANTS  LIMITED	BARRINGTON	708-382-6233

MORRISEY ASSOCIATES INC	EVANSTON	708-869-4000

PARIAN DEVELOPMENT	CHICAGO	312-655-3900

PC QUOTE, INC.	CHICAGO	312-906-3800

RDI SOFTWARE TECHNOLOGIES, INC	DES PLAINES	708-294-0300

SOFTBITE INTERNATIONAL	ADDISON	708-833-0006

THE INFORMATION MANAGEMENT GRO	CHICAGO	312-280-1007

UARCO-AUTOMATION SYTEMS DIVISION	ROLLING MDWS	708-381-2580

WORDLINK	CHAMPAIGN	217-359-9378

Indiana

PC SOLUTIONS, INC.	INDIANAPOLIS	317-849-7486

Kentucky

PRODUCTIVITY POINT INTERNATIONAL	LOUISVILLE	502-267-9557

Massachusetts

USER FRIENDLY COMPUTER SERVICE	CAMBRIDGE	617-864-3474

WHALLEY COMPUTER ASSOCIATES	SOUTHWICK	413-569-0123

XL/PROTEUS SOFTWARE SYSTEMS, INC.	MARLBOROUGH	508-485-9000

Maryland

AT&T NCR FEDERAL SYSTEMS DIVIS	ROCKVILLE	301-258-4102

BUSINESS SYSTEMS, INC.	ANNAPOLIS JCT	410-880-4131

COMPUTER INSTITUTE	ROCKVILLE	301-424-8443

RDA CONSULTANTS LIMITED	TIMONIUM	410-561-9028

RWD TECHNOLOGIES, INC.	COLUMBIA	410-730-4377

THE APEX GROUP, INC.	COLUMBIA	410-312-2640

Michigan

COMPUTER METHODS CORPORATION	LIVONIA	313-522-5187

EXECUTRAIN OF DETROIT	SOUTHFIELD	313-352-9210

FOURTH WAVE TECHNOLOGIES, INC.	TROY	313-362-2288

LANISTA CORPORATION	SOUTHFIELD	313-350-3322

QUICK START CORPORATE SERVICES	ANN ARBOR	313-677-4455

Minnesota

CLEAR WITH COMPUTERS, INC.	MANKATO	507-388-5000

CONNECT COMPUTER COMPANY	EDEN PRAIRIE	612-944-0181

LEARN PC	MINNEAPOLIS	612-930-0330

SHOWCASE CORPORATION	ROCHESTER	507-288-5922

Missouri

EMPOWER TRAINERS & CONSULTANTS, INC.	KANSAS CITY	816-753-8880

FIRST CLASS SOLUTIONS	SAINT LOUIS	314-997-8998

SOLUTECH, INC.	SAINT CHARLES	314-947-9393

North Carolina

BROADWAY & SEYMOUR	CHARLOTTE	704-372-4281

CEDALION SYSTEMS, INC.	CHARLOTTE	704-335-1200

SYNERGY SYSTEMS	RALEIGH	919-872-5678

New Hampshire

SEACOAST COMPUTER, INC.	DOVER	603-749-6952

UNIVERSAL COMPUTING INSTITUTE	GREENLAND	603-430-9541

New Jersey

ALPHA TECHNOLOGIES, INC.	PISCATAWAY	908-819-8811

AMERICAN MANAGEMENT SYSTEMS	ROSELAND	201-535-7000

COMMUNICATION TECHNOLOGY FOR BUSINESS	MONTVALE	201-573-0682

COMPUTER APPLICATIONS LEARNING CENTER, INC.	MORRISTOWN	201-539-6050

INTEGRATED COMPUTER MANAGEMENT	ROSELAND	201-535-3400

OMNITECH CORPORATE SOLUTIONS,	TEANECK	201-837-0900

PC STRATEGIES & SOLUTIONS, INC.	PARSIPPANY	201-984-1000

PROFESSIONAL COMPUTER SOLUTION	ENGLEWOOD	201-816-8002

SYNTREX TECHNOLOGIES, INC.	EATONTOWN	908-542-1500

VR DATA SYSTEMS INC	LINCROFT	908-219-1848

Nevada

THE LEARNING CENTER	LAS VEGAS	702-878-8885

New York

APPROACH, INC.	VALHALLA	914-769-2800

BULLER, OWENS & ASSOCIATES	NEW YORK	212-921-0774

COMTEX INFORMATION SYSTEMS	NEW YORK	212-480-2600

DATALAN	WHITE PLAINS	914-682-2022

DGS	ALBANY	518-869-1305

MELIORA SYSTEMS, INC.	ROCHESTER	716-461-1900

MICRO MODELING ASSOCIATES, INC.	NEW YORK	212-233-9890

MICROVIDEO LEARNING SYSTEMS	NEW YORK	212-255-3108

PC LITERATE INC	NEW YORK	212-684-3690

PC SKILLS, INC.	AMHERST	716-839-1304

PRIDE TECHNOLOGIES, INC.	MELVILLE	516-421-9111

PRODUCTIVITY POINT INTERNATIONAL	ROCHESTER	716-232-6650

THE WINDOWS SUPPORT GROUP, INC	NEW YORK	212-675-2500

Ohio

FULL SERVICE NETWORKING	CINCINNATI	513-782-4200

PROTRAIN	CINCINNATI	513-772-0367

THE FUTURE NOW	CINCINNATI	513-792-4508

Oklahoma

MICROAGE SYSTEMS INTEGRATION GROUP	OKLAHOMA CITY	405-272-9655

Oregon

CTR BUSINESS SYSTEMS	PORTLAND	503-293-2414

Pennsylvania

CGI SYSTEMS, INC.	BERWYN	215-993-8082

COMPUTER RESOURCES & TRAINING, INC.	PHILADELPHIA	215-569-9100

INFORMATION TECHNOLOGISTS, INC	CONSHOHOCKEN	215-832-1000

MICRO ENDEAVORS, INC.	UPPER DARBY	215-449-4680

MICROPOWER SYSTEMS	MURRYSVILLE	412-733-7500

ROCKEY & ASSOCIATES	MALVERN	215-640-4880

UNITED INFORMATION TECHNOLOGIE	DOYLESTOWN	215-340-9300

South Carolina

MICRO TECH COMPUTER SYSTEMS	SPARTANBURG	803-587-2969

PPI COMPUTER CONSULTING GROUP	COLUMBIA	803-277-2870

Texas

ABSOLUTE!, INC.	DALLAS	214-748-0184

ADVANTA TECHNOLOGIES, INC.	HOUSTON	713-622-9841

AMERICAN TECH CENTER	DALLAS	214-630-0444

EDUTECH	HOUSTON	713-827-1314

HILTON COMPUTER STRATEGIES	HOUSTON	713-782-6665

LEARN EASY TECHNOLOGY	HOUSTON	713-622-9400

LESTEX, INC.	PLANO	214-618-9699

SPAN INSTRUMENTS, INC.	PLANO	214-423-5320

SPECTRUM INTEGRATED SERVICE	GARLAND	214-231-6173

SQL BUSINESS SYSTEMS, INC.	HOUSTON	713-578-7410

VIRTUAL FIIRMWARE	AUSTIN	512-472-0543

Utah

KEYSTONE	PROVO	801-377-3966

Virginia

ADVANCED PARADIGMS, INC.	ALEXANDRIA	703-578-1400

AMERICAN COMMUNICATIONS COMP	CHANTILLY	703-968-6300

AUTOMATION PARTNERS INTERNATIONAL, INC.	HERNDON	703-435-5400

CACI FEDERAL	ARLINGTON	703-841-7800

CMS AUTOMATION	RICHMOND	804-278-9200

DATAFOCUS INC.	FAIRFAX	703-631-6770

EEI	ALEXANDRIA	703-683-0683

HFSI	MCLEAN	703-827-3660

IPC TECHNOLOGIES, INC.	RICHMOND	804-285-9300

NETWORK SOLUTIONS, INC.	HERNDON	703-742-4843

PRODUCTIVITY POINT INTERNATIONAL	ARLINGTON	703-243-7281

SRA CORPORATION	ARLINGTON	703-558-4700

US LAN SYSTEMS CORPORATION	VIENNA	703-790-2754

Washington

AGENA CORPORATION	SEATTLE	0

ASSOCIATED COMPUTER LAB	SPOKANE	509-455-5054

ATTACHMATE CORP	BELLEVUE	206-644-4010

COMPUTER SOLUTIONS	SPOKANE	509-328-8077

CORPORATE COMPUTER, INC.	SEATTLE	206-328-4463

KATYDID SOFTWARE CO	VANCOUVER	206-260-8187

SQLSOFT, INC.	KIRKLAND	206-822-1287

TIMELINE, INC	BELLEVUE	206-822-3140

WISMER MARTIN, INC.	MEAD	509-466-0396

Wisconsin

PROFESSIONAL SYSTEMS GROUP	RACINE	414-681-0500

THE STARTING POINT, INC.	BROOKFIELD	414-784-0557


3rd Party Applications for Microsoft Access

NOTE:  If someone wants to be listed in the Accessories Guide, refer them to Fawcette Tech Publications at (415) 688-1808.

PRODUCTS

Acorn Publishing

1079 Regency Dr.

Woodbury, MN  55125

(612) 731-8247

Contact:	Bill Hughes, Jr.

Products:	Purchasing's Little Helper; Accounts Payable Little Helper; General Ledger Little Helper; Inventory Little Helper

Summaries:	The Little Helper series are designed for small business and small divisions of major corporations. Ease of use and a rich feature set are present in each of these products. Each module in this series can be used standalone or in conjunction with one another. Data can be imported from and exported to the host system.

Pricing:	Call for pricing (Available 1Q 1993)

Associatech, Inc.

10116 Lamplighter Sq.

Cupertino, CA  95014

(408) 255-4686

CompuServe ID:  70022,11

Product:	Knowledge Disk, vol. I

Summary:	A quiz game for children aged 7-12, based on the concept of

cultural literacy and the Core Knowledge Series published by

Doubleday. There are five main categories: English, History,

Geography, Math and Science. Each quiz is 25 questions and is

based both on grade and difficulty level.  There is immediate

feedback with an explanation of the correct answer. The program

tracks the individual performance of up to 99 players and gives

both graphical and written evaluations of both the current quiz and

all previous quizzes.

Pricing:	$49.00 for each volume (Volume I available Jan '93 - requires

Access; Volume II available 	2Q 1993 - runtime version of

Access so Access not required)

Bay Windows

P.O. Box 2913

Santa Cruz, CA  95063-2913

(408) 476-8053

Products:	WipTrack (Beta); Work-In-Progress Tracking System

Summaries:	None.

Pricing:	Both TBD (Available February 1993)

Bridge Data

12900 Whitewater Dr., Suite 220

Minnetonka, MN  55343

(612) 933-3336 ext 50

(612) 933-1336 FAX

Products:	Contact/List+ Office Automation; TradeData+ Investment Banking

Summary:	Contact/List management with bulk mail. Use the power of

Access to gather, consolidate, and distribute information

pertaining to all your customers, vendors, sales leads, contacts

and employees. Create sub-groups, Ad hoc lists and mailing

labels.  Includes bulk mail Wizard's and dynamic connections to

Mail, Schedule, Word and Excel. TradeData+ compliance trading

system. Consolidate complete up to the minute daily trading

information with portfolio managers, portfolio accounting systems

and support staff. Automatic allocation of block trades

synchronized with in-house information, Microsoft SQL Server and

real time data sources.  Detailed auditing and compliance reports.

Pricing:	Both are TBD (Available 1Q 1993)

CNA Computer Systems Engineering Inc.

4048-148th Ave. NE.

Redmond, WA  98052

800-235-4091

(206) 861-4740 FAX

Product:	ConnX

Summary:	ConnX version 1.2.09ConnX allows record level read/write

communication between PC applications and VAX RMS files. It

includes a VAX-resident file server and a PC-resident Application

Program Interface (API). The file server features complete VMS

user-level security, RMS file security, RMS file sharing support

and support of indexed, relative and sequential files.

Pricing:	$5,500

Cresent Software Inc.

11 Bailey Ave.

Ridgefield, CT  06877-4505

(203) 438-5300 or 431-4626 or 800-35-BASIC (Sales)

Products:	QuickPak Professional for Microsoft Access; PDComm for

Microsoft Access

Summaries:	QuickPak Professional for Microsoft Access is a toolbox of more

than 400 routines and example programs that will improve the

quality of your programs and complete them faster. Most routines

are written in assembly languages to perform services that would

be too slow in Microsoft Access and provide a variety of features

that would otherwise be difficult or tedious for most programmers

to write themselves. PDQComm adds serial communications to

your Microsoft Access applications. With PDQ Comm for

Microsoft Access and a phone modem, you can dial out and

connect to any other modem-equipped PC, allow users to dial in

to your application, send and receive data, transfer files using

standard transfer protocols and much more.

Pricing:	QuickPak $199; PDQComm $99

Escom Distribution Ltd.

Suite 51804211 Kingsway

Burnaby, BC V5H 1Z6 Canada

(604) 438-7361

(604) 432-9708 FAX

Product:	CLASS for Windows

Summary:	An integrated series of applications allowing local government

(Parks & Recreation), educational (Continuing/Adult) and private

agencies to automate the administration of their programs and

facility management. Modules include program registration, facility

scheduling, membership tracking, market analysis, league

scheduling, event management, point of sale and call tracking.

Pricing:	$1,195 per module

Kwery Corp.

P.O. Box 6726

Bellevue, WA  98008

(206) 644-7830 or 644-8409

Product:	Kwery Tools for Microsoft Access; Microsoft Access Documenter;

Microsoft Access to Word

Summaries:	Kwery Tools assist users and developers with Microsoft Access

application development. Tools include: Popups-forms and macros

to include in your applications: PopupCalendar, PopupCalculators,

PopupPhonelist, PopupTimelog. Kwery Toolbars-code and

libraries for creating and managing custom popup toolbars; and

Data Formatter-cleanup and reformat data imported from external

databases. Source code is included royalty-free.

Microsoft Access Documenter dissects Microsoft Access

databases/applications and creates printed schema listings and

other design documentation. Features include: table, form and

report structure and property listings; relationship diagrams for

linked tables; and the Macro Mapper to document and diagram

macro code. The Documenter includes powerful configuration and

reporting capabilities. No Microsoft Access user can afford to be

without this tool!

Microsoft Access to Word is an add-in for Microsoft Word that

allows users to merge data from Microsoft Access directly into

Word documents.  Easily installed in Word's Print Merge,

Microsoft Access to Word allows you to select Microsoft Access

data to merge from any table, selected columns and/or records in

a table, names Access query, or keyed/pasted SQL statement.

Pricing:	$ Call or fax for more information on all 3 programs.

Microsoft Corporation

1 Microsoft Way

Redmond, WA  98052

(206) 882-8080

(206) 936-7329 FAX

Products:	Open Data Services (ODBC); SQL Bridge; SQL Administrator for

Windows; SQL Server Programmer's Toolkit for C; SQL Server;

SQL Server Programmer's toolkit for Cobol; SQL Server

Programmer's Toolkit for Visual Basic; Test for Windows;

Windows for Workgroups

Summaries:	Microsoft ODBC is a data integration and connectivity library that

provides the foundation for fast, multithreaded server applications

that connect to SQL Server clients and servers across the LAN.

Open Data Services handles the details of network

communications, so you can concentrate on the unique

characteristics of your data sources.  Data from mainframe or

minicomputer data sources is returned to the client application

looking as if it came from

SQL Server. SQL Bridge provides interoperability between

Microsoft and Sybase environments by linking databases, clients

and gateways across UNIX, VMS, Macintosh, and PC networks.

UNIX, VMS and Macintosh clients applications written to the

SYBASE Open Client interface can now access Microsoft SQL

Server and PC LAN clients can connect to Sybase databases on

UNIX and VMS.

Microsoft SQL Administrator for Windows is a graphical

database administration tool that lets system administrators

easily manage the Microsoft SQL Server system environment by

using familiar Windows controls, such as buttons and dialog

boxes. By taking advantage of the Windows environment, you can

manage one or more SQL Servers without knowledge of SQL

commands.

Microsoft SQL Server Programmer's Toolkit for C lets

development professionals build powerful and flexible client-server

applications for Microsoft SQL Server that meet critical business

needs for Windows, MS-DOS and Microsoft C, Microsoft QuickC

for Windows and other compilers.  Microsoft SQL Server

Programmer's Toolkit for C delivers an open, standard API for

accessing data from Microsoft SQL Server on a LAN and other

data in an 	enterprise environment.

Microsoft SQL Server is a robust relational database

management system for client-server computing. Key benefits are:

Server intelligence actively enforces crucial data integrity rules

uniformly across all applications. A secure environment allows you

to safely manage high volumes of corporate data. Transparent

Microsoft Access to main-frame DB2 data from Microsoft SQL

Server applications with the Database Gateway from Micro

Decisionware Inc. Network compatibility allows users to run

Microsoft SQL Server on a variety of network operating systems.

Microsoft SQL Server Programmer's Toolkit for COBOL

provides the tools you need to develop production-oriented COBOL

applications for SQL Server. Its precompiler support provides an

ideal way to downsize "mission-critical" applications to the LAN,

while its embedded SQL interface and ANSI-style cursors let you

easily migrate existing SQL applications to the intelligent, high

performance SQL Server platform.

Microsoft SQL Server Programmer's Toolkit for Visual Basic

allows programmers to take advantage of the ease and

productivity of Microsoft Visual Basic to develop robust and

flexible client-server applications for the Windows operating

system and the SQL Server platform.  The toolkit joins the power

and sophistication of SQL Server's DB-Library application

programming interface (API) with the easy-to-use Visual Basic

programming system.

Microsoft Test for Windows is a non invasive, single-machine

testing solution for the Windows operating system that doesn't

require and specific compiler or development system. Use the

recorder and the Test Basic language to test any application for

Windows, running unattended test cases that simulate actual

mouse movements and keystrokes and check for correct results.

Microsoft Windows for Workgroups version 3.1, the operating

system with integrated networking allows users to share

information and work together more easily. Users can share files

and printers, send and receive electronic mail messages, and

keep track of appointments as well as schedule group meetings,

all from within the easy Windows interface. There are Windows for

Workgroups packages available for every computer user. Whether

you currently use MS-DOS, Windows 3.0, Windows 3.1 and have

networking hardware or not, there is a Windows for Workgroups

box for you.

Pricing:	OBBC:  $2,395 MLP available thru Network Specialists

SQL Bridge:  $2,495 available thru Network Specialists

SQL Administrator for Windows:  $495 available through Network

Specialists

SQL Server Programmer's Toolkit for C:  $495 available through Network

Specialists

SQL Server: $1,495 Developers System; $2,995 10 users; $7,995

unlimited - thru Network Specialists

SQL Server Programmer's Toolkit for COBOL:  $495 available through

Network Specialists

SQL Server Programmer's Toolkit for Visual Basic:  $495 through Network

Specialists

Test for Windows:  $395

Windows for Workgroups:  Contact your local reseller for different SKU

pricing

MTX International, Inc.

98 Inverness Dr. E., Suite 110

Englewood, CO  80112

(303) 790-1400 or 800-888-MTXI or (303) 790-4058 WATTS

Product:	Accounting SDK for Microsoft Access

Summary:	Accounting SDK for Microsoft Access from MTX allows resellers

to solve unique problems of many different vertical applications.

This system is fully operational with Accounts Payable, Accounts

Receivable, Payroll and General Ledger modules that are easily

modifiable and/or added to. The Accounting SDK can drastically

reduce your development time.

Pricing:	$695 special developer's price entitles user to 30 days of free

telephone support

National Instruments

6504 Bridge Point Pkwy

Austin, TX  78730-5039

(512) 794-0100 or 794-8411

Product:	NI-DAQ Windows

Summary:	NI-DAQ Windows is a dynamic link library (DLL) with low-level

functions for analog, digital, and timing Input/Output, high-level

stream-to-disk and waveform generation for controlling the

company's plug-in data acquisition boards for PCs. NI-DAQ

supports programs written in Visual Basic.

Pricing:	free of charge with the company's plug-in data acquisition boards

for PCs.

SMITHWARE Inc.

1052 Madison Sq.

Madison, TN  37115

(615) 860-3500 ext 25 or 868-5397

Product:	DDF Builder for Windows

Summary:	DDF Builder builds and maintains Data Dictionary Files for Btrieve

files. These DDF's tell database front ends and report writers

where fields of data exist in your filed. DDF Builder for Windows

works just like the table editor in Microsoft Access.

Pricing:	$179.95

WorkGroup Solutions

2366 Eastlake Ave. E., Suite 325

Seattle, WA  98102

(206) 726-9377 or 726-9728

Product:	Microsoft Access Time Billing

Summary:	The first Microsoft Access business application! Microsoft Access

taken to the edge! Over 1,000 hours in development and testing.

Use it to learn practical and advanced techniques to run your

business. Complete Time Accounting, Invoicing and Receivables

with many Sales and Productivity Queries and Graphics. Source

Code and Booklet.

Pricing:	TimeBill $147; Payroll $97

TRAINING & CONSULTING

Acorn Publishing

1079 Regency Dr.

Woodbury, MN  55125

(612) 731-8247

Summary:	Acorn offers general business consulting in Microsoft Access.

Curtis Consulting Group

2401 Fourth Ave., Suite 300

Seattle, WA  98121

(206) 448-7719 or 728-9107

Summary:	Curtis Consulting Group specializes in custom database

development utilizing Microsoft Access and Microsoft SQL Server.

They have provided high quality process re-engineering, system

design, development, documentation and training services to a

wide variety of industries. Related services include strategic

systems planning and group problem solving.

Keith R. Pleas & Associates

P.O. Box 1542

Bellevue, WA  98009

(206) 451-9013 or 453-0709

Summary:	Consultants specializing in custom Windows-based application

development, systems integration, database design,

manufacturing and inventory related systems.

Leszynski Co.

P.O. Box 6726

Bellevue, WA  98008

(206) 644-7826 or 644-8409

Summary:	Leszynski Co. provides design and development of custom

business applications using Microsoft Access an/or SQL Server.

They have been specialists in database-intensive software

solutions for over ten years. Their expertise includes Windows

programming, management of complex projects, multi-user

implementations and design specifications.

LEX Software Systems Inc.

9665 NE Timberlane, 3rd Flr

Winslow, WA  98110

800-788-5399 or (206) 780-0181

Summary:	LEX Software Systems Inc. provides expertise in the development

of EIS (Executive Information Systems) and database systems.

They are currently one of the leading provides or EIS solutions

under Windows.

Micro Endeavors Inc.

3150 Township Line Rd.

Drexel Hill, PA  19026

(215) 449-4680 or 449-4757

Summary:	Micro Endeavors is proud to announce that the same state of the

art, hands-on training techniques MEI has used to train thousands

of FoxPro programmers are now available to Microsoft Access

developers. In their Philadelphia training centers or around the

world, MEI is the answer for your Microsoft database training

needs.

Morgan Data Systems

12032 Northcreek Pkwy, Suite 103

Bothell, WA  98103

(206) 486-0606 or 486-0224

Summary:	MDS delivers high quality database systems using Microsoft

Access on a variety of platforms. MDS pays careful attention to

understanding an organization's needs before designing and

development an appropriate solution. High quality documentation

and training are provided with every system. MDS has over five

years of experience in Windows development.

Neville & Co.

Information Technology

P.O. Box 732

Summit, NJ 07902-0732

(908) 464-6528

(908) 771-0046 FAX

Summary:	None.

QuickStart Technologies

The Redmond Alliance

5862 Bols Ave., Bldg 103

Huntington Beach, CA  92649

800-326-1044

Summary:	Training Video-Level I. This professional 90 minute video provides

new users with an affordable training solution for Microsoft

Access. The video offers an organized and effective method to

develop and individuals skills on Microsoft Access.  Additional

videos on other Microsoft Windows applications are available.

Pricing:	$49.95

TechWorks International

164 Kings Highway N.

Westport, CT  06880

(203) 221-1500

Summary:	The Redmond Alliance offers training & consulting services to

organizations who are developing solutions with Microsoft Access,

Project, Excel, Word and SQL Server. Both Microsoft University

courses and application integration services are available.

Timeline Inc.

3055-112th Ave. NE., Suite 106

Bellevue, WA  98004

(206) 822-3140 or 822-1120

Summary:	General Ledger & Financial Reporting, Budgeting (Excel), Job

Cost, Time & Billing, Accounts Payable, Accounts Receivable,

Fixed Assets, Purchase Order, Membership and Fund Raising.

Timeline uses Microsoft tools exclusively to develop client-server

accounting applications for large companies with complex

financial reporting and management accounting requirements.

Timeline consultants have 15 years experience configuring

accounting solutions for growing and changing organizations with

these characteristics: multiple company/department/division; labor

tracking/billing; large transaction volumes; job, project or cost

accounting requirements.

Pricing:	$10,000 to $60,000 per module (General Ledger & Financial

Reporting and Accounts Payable are available now. Other

modules in phases for 12 months after Access is released.)

WorkGroup Solutions

2366 Eastlake Ave. E., Ste 325

Seattle, WA  98102

(206) 726-9377 or 726-9278

Contact:	Bill Serrahn

Summary:	Microsoft Access Software Design and Development. Public and

Corporate Training Seminars. Microsoft Access Client Server

Applications with SQL Server. Specialists in Microsoft Access

Time Accounting, EIS Systems, Sales Management Systems,

and Process Manufacturing Systems.


3rd Party Applications
3rd Party Applications for Microsoft Access

NOTE:  If someone wants to be listed in the Accessories Guide, refer them to Fawcette Tech Publications at (415) 688-1808.

PRODUCTS

Acorn Publishing

1079 Regency Dr.

Woodbury, MN  55125

(612) 731-8247

Contact:	Bill Hughes, Jr.

Products:	Purchasing's Little Helper; Accounts Payable Little Helper; General Ledger Little Helper; Inventory Little Helper

Summaries:	The Little Helper series are designed for small business and small divisions of major corporations. Ease of use and a rich feature set are present in each of these products. Each module in this series can be used standalone or in conjunction with one another. Data can be imported from and exported to the host system.

Pricing:	Call for pricing (Available 1Q 1993)

Associatech, Inc.

10116 Lamplighter Sq.

Cupertino, CA  95014

(408) 255-4686

CompuServe ID:  70022,11

Product:	Knowledge Disk, vol. I

Summary:	A quiz game for children aged 7-12, based on the concept of cultural literacy and the Core Knowledge Series published by Doubleday. There are five main categories: English, History, Geography, Math and Science. Each quiz is 25 questions and is based both on grade and difficulty level.  There is immediate feedback with an explanation of the correct answer. The program tracks the individual performance of up to 99 players and gives both graphical and written evaluations of both the current quiz and all previous quizzes.

Pricing:	$49.00 for each volume (Volume I available Jan '93 - requires Access; Volume II available 	2Q 1993 - runtime version of Access so Access not required)

Bay Windows

P.O. Box 2913

Santa Cruz, CA  95063-2913

(408) 476-8053

Products:	WipTrack (Beta); Work-In-Progress Tracking System

Summaries:	None.

Pricing:	Both TBD (Available February 1993)

Bridge Data

12900 Whitewater Dr., Suite 220

Minnetonka, MN  55343

(612) 933-3336 ext 50

(612) 933-1336 FAX

Products:	Contact/List+ Office Automation; TradeData+ Investment Banking

Summary:	Contact/List management with bulk mail. Use the power of Access to gather, consolidate, and distribute information pertaining to all your customers, vendors, sales leads, contacts and employees. Create sub-groups, Ad hoc lists and mailing labels.  Includes bulk mail Wizard's and dynamic connections to Mail, Schedule, Word and Excel. TradeData+ compliance trading system. Consolidate complete up to the minute daily trading information with portfolio managers, portfolio accounting systems and support staff. Automatic allocation of block trades synchronized with in-house information, Microsoft SQL Server and real time data sources.  Detailed auditing and compliance reports.

Pricing:	Both are TBD (Available 1Q 1993)

CNA Computer Systems Engineering Inc.

4048-148th Ave. NE.

Redmond, WA  98052

800-235-4091

(206) 861-4740 FAX

Product:	ConnX

Summary:	ConnX version 1.2.09ConnX allows record level read/write communication between PC applications and VAX RMS files. It includes a VAX-resident file server and a PC-resident Application Program Interface (API). The file server features complete VMS user-level security, RMS file security, RMS file sharing support and support of indexed, relative and sequential files.

Pricing:	$5,500

Cresent Software Inc.

11 Bailey Ave.

Ridgefield, CT  06877-4505

(203) 438-5300 or 431-4626 or 800-35-BASIC (Sales)

Products:	QuickPak Professional for Microsoft Access; PDComm for Microsoft Access

Summaries:	QuickPak Professional for Microsoft Access is a toolbox of more than 400 routines and example programs that will improve the quality of your programs and complete them faster. Most routines are written in assembly languages to perform services that would be too slow in Microsoft Access and provide a variety of features that would otherwise be difficult or tedious for most programmers to write themselves. PDQComm adds serial communications to your Microsoft Access applications. With PDQ Comm for Microsoft Access and a phone modem, you can dial out and connect to any other modem-equipped PC, allow users to dial in to your application, send and receive data, transfer files using standard transfer protocols and much more.

Pricing:	QuickPak $199; PDQComm $99

Escom Distribution Ltd.

Suite 51804211 Kingsway

Burnaby, BC V5H 1Z6 Canada

(604) 438-7361

(604) 432-9708 FAX

Product:	CLASS for Windows

Summary:	An integrated series of applications allowing local government (Parks & Recreation), educational (Continuing/Adult) and private agencies to automate the administration of their programs and facility management. Modules include program registration, facility scheduling, membership tracking, market analysis, league scheduling, event management, point of sale and call tracking.

Pricing:	$1,195 per module

Kwery Corp.

P.O. Box 6726

Bellevue, WA  98008

(206) 644-7830 or 644-8409

Product:	Kwery Tools for Microsoft Access; Microsoft Access Documenter; Microsoft Access to Word

Summaries:	Kwery Tools assist users and developers with Microsoft Access application development. Tools include: Popups-forms and macros to include in your applications: PopupCalendar, PopupCalculators, PopupPhonelist, PopupTimelog. Kwery Toolbars-code and libraries for creating and managing custom popup toolbars; and Data Formatter-cleanup and reformat data imported from external databases. Source code is included royalty-free.

Microsoft Access Documenter dissects Microsoft Access databases/applications and creates printed schema listings and other design documentation. Features include: table, form and report structure and property listings; relationship diagrams for linked tables; and the Macro Mapper to document and diagram macro code. The Documenter includes powerful configuration and reporting capabilities. No Microsoft Access user can afford to be without this tool!

Microsoft Access to Word is an add-in for Microsoft Word that allows users to merge data from Microsoft Access directly into Word documents.  Easily installed in Word's Print Merge, Microsoft Access to Word allows you to select Microsoft Access data to merge from any table, selected columns and/or records in a table, names Access query, or keyed/pasted SQL statement.

Pricing:	$ Call or fax for more information on all 3 programs.

Microsoft Corporation

1 Microsoft Way

Redmond, WA  98052

(206) 882-8080

(206) 936-7329 FAX

Products:	Open Data Services (ODBC); SQL Bridge; SQL Administrator for Windows; SQL Server Programmer's Toolkit for C; SQL Server; SQL Server Programmer's toolkit for Cobol; SQL Server Programmer's Toolkit for Visual Basic; Test for Windows; Windows for Workgroups

Summaries:	Microsoft ODBC is a data integration and connectivity library that provides the foundation for fast, multithreaded server applications that connect to SQL Server clients and servers across the LAN. Open Data Services handles the details of network communications, so you can concentrate on the unique characteristics of your data sources.  Data from mainframe or minicomputer data sources is returned to the client application looking as if it came from

SQL Server. SQL Bridge provides interoperability between Microsoft and Sybase environments by linking databases, clients and gateways across UNIX, VMS, Macintosh, and PC networks. UNIX, VMS and Macintosh clients applications written to the SYBASE Open Client interface can now access Microsoft SQL Server and PC LAN clients can connect to Sybase databases on UNIX and VMS.

Microsoft SQL Administrator for Windows is a graphical database administration tool that lets system administrators easily manage the Microsoft SQL Server system environment by using familiar Windows controls, such as buttons and dialog boxes. By taking advantage of the Windows environment, you can manage one or more SQL Servers without knowledge of SQL commands.

Microsoft SQL Server Programmer's Toolkit for C lets development professionals build powerful and flexible client-server applications for Microsoft SQL Server that meet critical business needs for Windows, MS-DOS and Microsoft C, Microsoft QuickC for Windows and other compilers.  Microsoft SQL Server Programmer's Toolkit for C delivers an open, standard API for accessing data from Microsoft SQL Server on a LAN and other data in an enterprise environment.

Microsoft SQL Server is a robust relational database management system for client-server computing. Key benefits are: Server intelligence actively enforces crucial data integrity rules uniformly across all applications. A secure environment allows you to safely manage high volumes of corporate data. Transparent Microsoft Access to main-frame DB2 data from Microsoft SQL Server applications with the Database Gateway from Micro Decisionware Inc. Network compatibility allows users to run Microsoft SQL Server on a variety of network operating systems.

Microsoft SQL Server Programmer's Toolkit for COBOL provides the tools you need to develop production-oriented COBOL applications for SQL Server. Its precompiler support provides an ideal way to downsize "mission-critical" applications to the LAN, while its embedded SQL interface and ANSI-style cursors let you easily migrate existing SQL applications to the intelligent, high performance SQL Server platform.

Microsoft SQL Server Programmer's Toolkit for Visual Basic allows programmers to take advantage of the ease and productivity of Microsoft Visual Basic to develop robust and flexible client-server applications for the Windows operating system and the SQL Server platform.  The toolkit joins the power and sophistication of SQL Server's DB-Library application programming interface (API) with the easy-to-use Visual Basic programming system.

Microsoft Test for Windows is a non invasive, single-machine testing solution for the Windows operating system that doesn't require and specific compiler or development system. Use the recorder and the Test Basic language to test any application for Windows, running unattended test cases that simulate actual mouse movements and keystrokes and check for correct results.

Microsoft Windows for Workgroups version 3.1, the operating system with integrated networking allows users to share information and work together more easily. Users can share files and printers, send and receive electronic mail messages, and keep track of appointments as well as schedule group meetings, all from within the easy Windows interface. There are Windows for Workgroups packages available for every computer user. Whether you currently use MS-DOS, Windows 3.0, Windows 3.1 and have networking hardware or not, there is a Windows for Workgroups box for you.

Pricing:	OBBC:  $2,395 MLP available thru Network Specialists SQL Bridge:  $2,495 available thru Network Specialists

SQL Administrator for Windows:  $495 available through Network Specialists

SQL Server Programmer's Toolkit for C:  $495 available through Network Specialists

SQL Server: $1,495 Developers System; $2,995 10 users; $7,995 unlimited - thru Network Specialists

SQL Server Programmer's Toolkit for COBOL:  $495 available through Network Specialists

SQL Server Programmer's Toolkit for Visual Basic:  $495 through Network Specialists

Test for Windows:  $395

Windows for Workgroups:  Contact your local reseller for different SKU pricing

MTX International, Inc.

98 Inverness Dr. E., Suite 110

Englewood, CO  80112

(303) 790-1400 or 800-888-MTXI or (303) 790-4058 WATTS

Product:	Accounting SDK for Microsoft Access

Summary:	Accounting SDK for Microsoft Access from MTX allows resellers to solve unique problems of many different vertical applications.  This system is fully operational with Accounts Payable, Accounts Receivable, Payroll and General Ledger modules that are easily modifiable and/or added to. The Accounting SDK can drastically reduce your development time.

Pricing:	$695 special developer's price entitles user to 30 days of free telephone support

National Instruments

6504 Bridge Point Pkwy

Austin, TX  78730-5039

(512) 794-0100 or 794-8411

Product:	NI-DAQ Windows

Summary:	NI-DAQ Windows is a dynamic link library (DLL) with low-level functions for analog, digital, and timing Input/Output, high-level stream-to-disk and waveform generation for controlling the company's plug-in data acquisition boards for PCs. NI-DAQ supports programs written in Visual Basic.

Pricing:	free of charge with the company's plug-in data acquisition boards for PCs.

SMITHWARE Inc.

1052 Madison Sq.

Madison, TN  37115

(615) 860-3500 ext 25 or 868-5397

Product:	DDF Builder for Windows

Summary:	DDF Builder builds and maintains Data Dictionary Files for Btrieve files. These DDF's tell database front ends and report writers where fields of data exist in your filed. DDF Builder for Windows works just like the table editor in Microsoft Access.

Pricing:	$179.95

WorkGroup Solutions

2366 Eastlake Ave. E., Suite 325

Seattle, WA  98102

(206) 726-9377 or 726-9728

Product:	Microsoft Access Time Billing

Summary:	The first Microsoft Access business application! Microsoft Access taken to the edge! Over 1,000 hours in development and testing. Use it to learn practical and advanced techniques to run your business. Complete Time Accounting, Invoicing and Receivables with many Sales and Productivity Queries and Graphics. Source Code and Booklet.

Pricing:	TimeBill $147; Payroll $97

TRAINING & CONSULTING

Acorn Publishing

1079 Regency Dr.

Woodbury, MN  55125

(612) 731-8247

Summary:	Acorn offers general business consulting in Microsoft Access.

Curtis Consulting Group

2401 Fourth Ave., Suite 300

Seattle, WA  98121

(206) 448-7719 or 728-9107

Summary:	Curtis Consulting Group specializes in custom database development utilizing Microsoft Access and Microsoft SQL Server. They have provided high quality process re-engineering, system design, development, documentation and training services to a wide variety of industries. Related services include strategic systems planning and group problem solving.

Keith R. Pleas & Associates

P.O. Box 1542

Bellevue, WA  98009

(206) 451-9013 or 453-0709

Summary:	Consultants specializing in custom Windows-based application development, systems integration, database design, manufacturing and inventory related systems.

Leszynski Co.

P.O. Box 6726

Bellevue, WA  98008

(206) 644-7826 or 644-8409

Summary:	Leszynski Co. provides design and development of custom business applications using Microsoft Access an/or SQL Server. They have been specialists in database-intensive software solutions for over ten years. Their expertise includes Windows programming, management of complex projects, multi-user implementations and design specifications.

LEX Software Systems Inc.

9665 NE Timberlane, 3rd Flr

Winslow, WA  98110

800-788-5399 or (206) 780-0181

Summary:	LEX Software Systems Inc. provides expertise in the development of EIS (Executive Information Systems) and database systems. They are currently one of the leading provides or EIS solutions under Windows.

Micro Endeavors Inc.

3150 Township Line Rd.

Drexel Hill, PA  19026

(215) 449-4680 or 449-4757

Summary:	Micro Endeavors is proud to announce that the same state of the art, hands-on training techniques MEI has used to train thousands of FoxPro programmers are now available to Microsoft Access developers. In their Philadelphia training centers or around the world, MEI is the answer for your Microsoft database training needs.

Morgan Data Systems

12032 Northcreek Pkwy, Suite 103

Bothell, WA  98103

(206) 486-0606 or 486-0224

Summary:	MDS delivers high quality database systems using Microsoft Access on a variety of platforms. MDS pays careful attention to understanding an organization's needs before designing and development an appropriate solution. High quality documentation and training are provided with every system. MDS has over five years of experience in Windows development.

Neville & Co.

Information Technology

P.O. Box 732

Summit, NJ 07902-0732

(908) 464-6528

(908) 771-0046 FAX

Summary:	None.

QuickStart Technologies

The Redmond Alliance

5862 Bols Ave., Bldg 103

Huntington Beach, CA  92649

800-326-1044

Summary:	Training Video-Level I. This professional 90 minute video provides new users with an affordable training solution for Microsoft Access. The video offers an organized and effective method to develop and individuals skills on Microsoft Access.  Additional videos on other Microsoft Windows applications are available.

Pricing:	$49.95

TechWorks International

164 Kings Highway N.

Westport, CT  06880

(203) 221-1500

Summary:	The Redmond Alliance offers training & consulting services to organizations who are developing solutions with Microsoft Access, Project, Excel, Word and SQL Server. Both Microsoft University courses and application integration services are available.

Timeline Inc.

3055-112th Ave. NE., Suite 106

Bellevue, WA  98004

(206) 822-3140 or 822-1120

Summary:	General Ledger & Financial Reporting, Budgeting (Excel), Job Cost, Time & Billing, Accounts Payable, Accounts Receivable, Fixed Assets, Purchase Order, Membership and Fund Raising. Timeline uses Microsoft tools exclusively to develop client-server accounting applications for large companies with complex financial reporting and management accounting requirements. Timeline consultants have 15 years experience configuring accounting solutions for growing and changing organizations with these characteristics: multiple company/department/division; labor tracking/billing; large transaction volumes; job, project or cost accounting requirements.

Pricing:	$10,000 to $60,000 per module (General Ledger & Financial Reporting and Accounts Payable are available now. Other modules in phases for 12 months after Access is released.)

WorkGroup Solutions

2366 Eastlake Ave. E., Ste 325

Seattle, WA  98102

(206) 726-9377 or 726-9278

Contact:	Bill Serrahn

Summary:	Microsoft Access Software Design and Development. Public and Corporate Training Seminars. Microsoft Access Client Server Applications with SQL Server. Specialists in Microsoft Access Time Accounting, EIS Systems, Sales Management Systems, and Process Manufacturing Systems.


User Groups
User Groups by State

Call 914/876-6678 to find a user group in their local area

California

Los Angeles Computer Society

Alan Greenberg

825 Washington Ave #4

Santa Monica CA 90403

310/576-1310

Orange Coast IBM PC UG

Terry Hanson

1912 Park Street

Huntington Beach

CA 92648

714/263-4851

Orange County MS Database Group

John Miller

631 South Manchester Avenue

Anaheim CA 92802

714/834-0809

Pasadena IBM PC UG

George Segal

711 East Walnut Street, #306

Pasadena CA 91101

818/793-1709

Ripon PC UG

Loyd  Reedy

1146 7th St.

Ripon CA

95366

San Francisco PC UG

ButlerCrittendon

3145 Geary Blvd.#284

San FranciscoCA 94118-3300

415/346-9321

Silicon Valley Computer Society

Frank Baker

210 Easy Street Suite 2

Mountain View CA

94043

Canada

Big Blue and Cousins UG

Leslie Benson

PO Box 5309, Station B

Victoria, BC

CANADA

V8R 6S4

604/598-1690

Vancouver Access UG

TerryToth

c/o Ucora Corporation

1027 Davie Street, Unit 392

Vancouver B.C.

Canada

V6E 4L2

(604) 683-3658

(604) 844-2486

Colorado

Golden Co. Access UG

Krishna Vasudevan

c/o Golden Consulting Svcs.

1910 Nineteenth St.

Golden CO

80401-1765

303/279-7170

CT Access Users and Dev. Group

Lisa Madow

675 Holly Dale Road

Fairfield CT

06430-2233

(203)254-1420

Florida

Manatee PC UG

Sam Wasserman

 5726 Cortez Rd West Suite 286

Bradenton FL 34210

813/756-2070

Pinellas IBM PC UG

Dick Kellerman

5100 Dover St. NE

St. Petersburg  FL 33703

813/573-8265

Sarasota IBM PC UG

Dick Detloff

PO Box 15889

Sarasota FL 34277-1889

813/925-4227

Georgia

Atlanta Database Developers Access SIG

Jack Thompson

PO Box 347005

Atlanta GA 30334

404/977-7130

Idaho

Idaho PC UG

Tim Wolf

5523 N. Citadel Way

Boise ID 83703

208/383-6324

Illinois

Information Management Group (IMG)

Tom Nolan

720 N. Franklin

Suite 300

Chicago IL 60610

312-280-1007

CAMP

Julian Horwich

950 Skokie Blvd

Suite 310

Northbrook IL 60062

708/291-1360

Chicago Computer Society

Laura Shoman

PO Box 27

Deerfield IL 60015-0027

312/443-0403

Indiana

Indianapolis Computer Society

David Frost

Box 222, Route 2

Monrovia IN 46157-9516

317/233-4711

Kentuky

Kentucky Indiana PC UG

Liz  Thurman

PO Box 367

7311 Cardinal Road

Crestwood KY 40014

502/222-9714

Boston Area Access UG

Rick  Greene

9 Hillside Ave

Waltham, MA

02154

Minnesota

TCPC

Bill Rothermal

5701 Normandale Road

Edina MN 55424

612/935-0513

Mississippi

Jackson County PC UG

Mike Erickson

1209 Canal

Pascagoula MS 39567

601/935-2970

North Carolina

Carolina's Access User Group

Paul Nielsen

6011 Willowbottom Drive

Hickery NC 28602

(704)294-2387

Raleigh NC Access UG

Kim Parker

103 Thornhollow Drive

Apex NC 27502

919-362-4085

New Jersey

ACGNJ

Bob Todd

County Lights Villa #1121

Bensalem NJ 19020

215/752/4604

NY PADD Access SIG

Leslie Korhan

Flash Creative Management

1060 Main Street

River Edge NJ O7661

201-489-2500

New York

New York Access UG

Virginia Benedict

Portable Technologies

208 East 51st St., #366

New York NY 10022

212-722-5692

Rockland PC UG

Stanley Smth

9 Chestnut Grove Court

New City NY 10956-2713

914/634-6618

Oklahoma

Oklahoma City PC UG

Dick  Alexander

7421 NW 31st Terrace

Oklahoma City OK73008

405/495-1494

Oregon

Northwest Database Society

James Erickson

10305 SW Denny Road #8

Beaverton OR 97005

503/774-5885

Philadelphia Area Computer Society

Steve Longo

c/o LaSalle University

1900 W. Olney

Philadelphia PA 19141

215/951-1255

Texas

Central Texas PC Users

Joseph Keers

6001 Painted Valley Dr.

AustinTX 78759

512/343-0086

HAL PC

Phil Bryant

Houston TX

713/241-1363

North Texas PC UG

Larry Linson

326 Drexel Drive

GrapevineTX 76051

817/481-2350

Utah

Southern Utah PC Ug

Ken Hedgerock

1242 S. 450 West

Cedar City UT 84720

801/865-7050

Washington

Pacific N'West Access UG

Chris Larsen

6325 NE 159th St.

Bothell WA 98011-4349

206/483-7532

Pacific N'West PC UG

Patrick Magee

PO Box 3363

Bellevue WA 98009-3363

206/453-7246


action

The basic building block of a macro; a self-contained instruction that can be combined with other actions to automate tasks.  This is sometimes called a command in other macro languages.


action argument

Additional information required by some macro actions for example, the object affected by the action or special conditions under which the action is executed.  You enter action arguments in the lower portion of the Macro window.


action list

A list of all actions you can use with a macro.  The list appears when you click the down arrow in the Action column of the Macro window.


action query

A category of queries that includes append, delete, make-table, and update queries.  Delete and update queries change existing data; append and make-table queries move existing data.  In contrast, select queries don't move or change data; they ask a question and return a dynaset.


append query

An action query that adds the records in a querys dynaset to the end of an existing table.


attached table

A table stored in a file outside the open database but from which Microsoft Access can access records.  You can add, delete, and edit records in an attached table, but you can't change its structure.


bound control

A control on a form or report that is tied to a particular field in the underlying table, query, or SQL statement.  For example, a text box that displays an employee's last name is bound to the Last Name field in the Employees table.


bound object frame

A control used to display and manipulate OLE objects that are stored in tables on forms and reports.


breakpoint

A line of code in a Function or Sub procedure at which Access Basic automatically halts execution.  After execution has been halted, you can use debugging tools, continue execution, edit a procedure, or reinitialize the code.  Microsoft Access displays the line in bold type.


caption

The name displayed on a label or the name displayed in the caption bar at the top of a form in Form view or Design view.


case-sensitive

A requirement that text be an exact match of uppercase and lowercase letters.


cell

The intersection of a row and column in a datasheet or grid.  In the Categories datasheet, for example, Seafood is the value in the cell located at the intersection of the third row and the Category Name column.


check box

A control that indicates whether an option is selected or cleared.  An X appears in the box when the option is selected.


Clipboard

The temporary storage area used by the operating environment to store text, graphics, and other data.  You transfer the data to and from the Clipboard using Copy and Paste commands.


column

The visual representation of a field in a datasheet, the QBE grid, or the Filter window grid.  In a datasheet, a column is a stack of values showing the value in that field for every record.  In the QBE and Filter window grids, a column is a stack of information, such as sort order, about each of the fields included in the query or filter.


combo box

A control, similar to a list box and text box combined, in which you enter a value or select an item from a list.


command button

A control that runs a macro or calls an access Basic function.  This is sometimes called a push button in other applications.


comment

Text that you can add to a macro or table to describe or annotate your work.  In Access Basic, a comment is text embedded in the code (but ignored by Access Basic) that explains how the code works or describes what the code does.  Comments in Access Basic must be preceded by an apostrophe (') or the reserved word Rem.


continuous form

A form that displays more than one record on the screen in Form view.  You can create a continuous form by setting a form's DefaultView property to Continuous Forms.


control

A graphical object, such as a text box, an unbound object frame, a rectangle, or a command button, that you place on a form or report to display data, perform an action, or decorate the form or report.


Control menu

The menu in the upper-left corner of an application or a window.  It contains commands to move, resize, and close the window and is designated by a short horizontal line rather than by a menu name.


control properties

Attributes of a control on a form or report that affect the appearance or behavior of the control.  BorderStyle is an example.


Counter data type

A field data type.  Such fields store sequential numbers automatically inserted by Microsoft Access.


criteria

A set of limiting conditions, such as Denmark (meaning equal to Denmark) or > 30000, used in creating a query or filter to show a specific set of records.


crosstab query

A query that computes a grid of summary totals based on values for each row and column.  For example, a monthly sales-by-region query is a crosstab query.


crosstab report

A report in which you calculate totals for fields you select and group them by date year, quarter, month, week, or day.  The data is displayed in a row-and-column format with the date at the top of each column.


Cue Cards

An online coach that walks you through the most common Microsoft Access tasks as you work with your own data.  Choose Cue Cards from the Help menu.


Currency data type

A field data type and an Access Basic data type.  The Currency data type is useful for calculations involving money or for fixed-point calculations in which accuracy is extremely important.  This data type is used to store numbers with up to 15 digits to the left of the decimal point and 4 digits to the right.  The type-declaration character in Access Basic is @.


data type

The attribute of a variable or field that determines what kind of data it can hold.  Supported data types include field data types for end-user tasks and Access Basic data types for programming tasks.


database

A collection of data related to a particular topic or purpose.  A database file can contain tables, queries, forms, reports, macros, and modules.


database objects

Tables, queries, forms, reports, macros, and modules.


Database window

The window that appears when you open a Microsoft Access database.  It contains Table, Query, Form, Report, Macro, and Module buttons that you can click to display a list of all objects of that type in the database.


datasheet

A window that displays data from a table, form, or query in a row-and-column format.


Datasheet view

A window that displays data from a table, form, or query in a row-and-column format.


DDE

An established protocol for exchanging data between applications that run with Microsoft Windows.


delete query

An action query that deletes a set of rows that match the criteria you specify.


Design view

A window in which you design tables, queries, forms, and reports.


dialog box

A window in which you select options before Microsoft Access carries out a command.


disabled field

A field that appears dimmed on a form, can't be tabbed to, and won't respond to typing or clicking.  You disable a field by setting its Enabled property to No.


DLL

A set of routines that extend the capabilities of Microsoft Access.


dynaset

The set of records that results from running a query or applying a filter.  Microsoft Access updates the data in the underlying table or tables when you make changes to a dynaset.


Access Basic

The programming language used by Microsoft Access.


equi-join

A join that combines records from two tables whenever there are matching values in a field common to both tables.


event

A user action, such as a mouse click or key press, recognized by Microsoft Access.  Using certain properties, you can tell Microsoft Access to run a macro in response to an event.


expression

Any combination of operators, constants, functions, and names of fields, controls, and properties that evaluates to a single value.  You can use expressions as settings for many properties and action arguments, to set criteria or define calculated fields in queries, and to set conditions in macros.  You also use expressions in Access Basic.


external table

A table outside the open Microsoft Access database.


field

A category of information, such as last name, that is stored in a table.  A field is represented as a column in a datasheet and as a control on a form.


field data type
field data types

The set of data types you can choose from for a field in a Microsoft Access table.  Microsoft Access has eight field data types: Counter, Currency, Date/Time, Memo, Number, OLE Object, Text, and Yes/No.


field list

A small window that lists all the fields in an underlying table or query.  You can display field lists in forms, reports, and queries; Microsoft Access automatically displays the appropriate field lists in the Filter window.


field properties

Attributes of a field that affect its appearance or behavior.  FieldSize is one example.  The list of field properties for a field appears in the lower half of a table's Design view when you select the field.


filter

A set of criteria applied to records in order to show a subset of the records or to sort the records.


footer

Text and/or graphics appearing at the bottom of each page, at the end of a form or report, or after a group of records.  Microsoft Access uses three kinds of footers: page footers, form and report footers, and group footers.


foreign key

One or more table fields that refer to the primary key field or fields in another table.


form

A Microsoft Access object on which you place controls for entering, displaying, and editing data in fields.


form footer

Text and/or graphics that appear at the bottom of a form on screen or at the end of the form in print.


form header

Text and/or graphics that appear at the top of a form on screen or at the beginning of the form in print.


form properties

Attributes of a form that affect its appearance or behavior.  DefaultView is one example.


Form view

A window that displays data one record at a time in fields on a form.  Using Form view is the primary method for adding and modifying data in a table.


Form window

A window in which you work with forms in Design view, Form view, or Datasheet view.


function

An Access Basic procedure that returns a value.  It can be used in Access Basic programming or in Microsoft Access expressions.


graph

A control used to display a graph in a form or report.


graph report

A report that displays a graph.


GraphWizard

An AccessWizard you use to create a form containing a graph.


group footer

Text and/or graphics that appear at the bottom of a group in a report.


group frame

A box that encloses a group of controls that provide a limited set of alternatives for users to choose among.  Use the option group control to create a group frame that encloses a set of check boxes, option buttons, or toggle buttons.


group header

Text and/or graphics that appear at the top of a group in a report.


group level

Separates groups of data in a report.  It is sometimes referred to as a break level in other database products.


group-level report

A report that organizes data into groups and displays it in a row-and-column format.


header

One or more identifying lines of text that appear at the top of each page, at the top of a form or report, or at the beginning of a group of records.  Microsoft Access includes three kinds of headers: page headers, form and report headers, and group headers.


Help

An online reference in Microsoft Access that contains information about commands and dialog boxes, Microsoft Access procedures, the interface, properties, keyboard equivalents, and Access Basic.


horizontal scroll bar

A scroll bar that appears along a horizontal axis.  You use it to scroll left and right within a form, query, datasheet, or report.


Immediate window

A window in which you can execute individual lines of Access Basic code, usually for the purpose of debugging.  You can use this window anytime a module is open.


index

A Microsoft Access feature that speeds data access by ordering the values in a field.  You can specify an index by using the Indexed property (a field property) or, for multiple-field indexes, by using the Index1...Index5 properties (table properties).


join

A database operation that combines some or all records from two tables.  Microsoft Access supports several kinds of joins:

An equi-join, which combines records from two tables whenever there are matching values in the joined fields.

An outer join, which includes all the records from one table and only those records from the second table in which the joined fields are equal.  In the Join Properties dialog box, you can specify which table will contribute all of its records.

A self -join, which is a table joined to itself.  A self-join is useful when you ask hierarchical questions, such as a query that shows all the managers and the people who report to them.


label

A control that displays descriptive text, such as a title, a caption, or instructions, on a form or report.


link

A connection between a source document and a destination document.  A link inserts a copy of information from the source document into the destination document while maintaining the connection between the two documents.  When the information changes in the source document, the changes are reflected in the destination document.


list box

A control that provides a list of choices.  A list box consists of a list and an optional label.


list index

The sequence of numbers for items in a list, starting with 0 for the first item, 1 for the second item, and so forth.


macro

An action or a set of actions you can use to automate tasks.


macro group

A collection of related macros that are stored together.  It is often referred to simply as a macro.


Macro window

The window in which you create and modify macros.


make-table query

An action query that creates a new table from the dynaset of an existing query.


Memo data type

A field data type.  Such fields can contain up to 32,000 characters.


menu

A list of commands, available at the top of a form or window, that is displayed when you click a menu name on a menu bar.


menu bar

The horizontal bar below the title bar that contains the names of Microsoft Access menus.  You can click a menu name to display the list of commands.


modal

A type of form that retains the focus until you close it.  Most modal forms are dialog boxes, warnings, or pop-up forms.


navigation buttons

The four arrows in the lower-left corner of a datasheet and in Form view.  You click the arrows to move through the records as follows:

The navigation buttons are also available during previewing so that you can move through the pages of your document.


network

A group of computers and other devices that can interact by means of a shared communications link.


normalize

To minimize the duplication of information in a relational database through effective table design.


null field

A field containing no characters or values.  A null field isn't the same as a field with a value of 0.


Number data type

A field data type designed for numerical data that will be used in mathematical calculations.  Use the Currency data type, however, to display or calculate currency values.


object

One of the following types of entities: (1) controls and database objects tables, queries, forms, reports, macros, and modules; (2) special system objects, such as Debug and Screen; and (3) in OLE terminology, information such as a graph, a drawing, or a table that can be linked or embedded.


OLE

A protocol by which an object, such as a graph, in a source application or document can be linked to or embedded in a destination document, such as a form or a report.


OLE object

An object in an application that supports object linking and embedding (OLE) and that can be linked and/or embedded.


option button

A control that can be selected or cleared like a check box.  It's typically used as part of a group in which the user can select one and only one option button.  This button is sometimes called a radio button in other applications.


option group

A control used to create a field on a form or report that frames a set of check boxes, option buttons, or toggle buttons and provides a limited set of alternatives for users to choose among.  For example, to enable users to choose a method of payment, you could use an option group with three option buttons:  Cash, Check, or Credit Card.


outer join

An outer join includes all the records from one table and only those records from the second table in which the joined fields are equal.  In the Join Properties dialog box, you can specify which table will contribute all of its records by choosing option 2 or option 3.  (In database terminology, option 2 is called a left outer join and option 3 is called a right outer join.)


page break

A control you use to insert page breaks in printable objects, such as reports and forms.  You also use this control to insert breaks in multiple-screen forms.


page footer

Text and/or graphics that appear at the bottom of a page in a form or report.


page header

Text and/or graphics that appear at the top of a page in a form or report.


Palette

A dialog box containing choices for color, special effect (raised or sunken), border, and width that you use when designing a form or report.


parameter query

A query that asks you to enter one or more criteria values, such as "Nairobi" for City, before the query is run.  A parameter query is not, strictly speaking, a separate kind of query; rather, it extends the flexibility of other queries (except for crosstab queries).


permissions

A set of attributes that specify whether or not a user has access to objects in a database and what kind of access is allowed.  For example, Read Data indicates that a user can view but not edit data.


pixel

An abbreviation for "picture element"; a dot that represents the smallest graphic unit of display on the screen.


point size

The height of a printed character.  A point equals approximately 1/72 of an inch, or 1/28 of a centimeter.


pop-up
pop-up form

A window, dialog box, or submenu that stays on top of other windows.  For example, the toolbar and Palette are pop-up forms containing tools to help you do your work.  In Help, pop-up windows are used to display definitions and lists of topics.


primary key

One or more fields whose value or values uniquely identify each record in a table.


Print Preview
preview

To view data or modules as they will appear when printed.  There are two preview windows:  Print Preview and Sample Preview.

The Print Preview window is available for forms, reports, datasheets, and modules.

The Sample Preview window is available only for reports in Design view.  Sample Preview provides a quick view of the basic layout of a report but may not include all the data in the report.

In either window, you can choose the Zoom button to switch between a close-up view of a portion of the page and the full view of the page.  Click the navigation buttons in the lower-left corner of the windows to page through the document.

When you preview a report, Microsoft Access displays the report initially in close-up view as shown below.


property sheet

The window in which you can view or modify the properties of a selected object.


QBE (query by example)
QBE

A technique for designing queries.  With graphical QBE, which Microsoft Access uses, you create queries visually by dragging the fields you want to include in the query from the upper portion of the Query window to the QBE grid in the lower portion of the window.


query

With a query you ask a question about the data stored in your tables or perform an action on the data.

Select queries ask questions about the data stored in your tables and return a dynaset without changing the data.  Once the dynaset is displayed, you can view and change the data in the underlying tables.

Action queries change data or move data.  Append, delete, make-table, and update queries are action queries.

Crosstab queries compute summary totals based on values for each row and column.

Parameter queries, which are not a separate type of query, extend the flexibility of other queries by prompting you to change certain criteria each time the query is run.


Query window

A window in which you work with queries in Design view or Datasheet view.


record

A collection of data about a person, a place, an event, or some other item.  A record is represented as a row in Datasheet view of a table, query, or form.


record selector

A small box or bar that you can click to select an entire record in Datasheet view of a table, query, or form and in Form view.


refresh

To redisplay the records in a form or datasheet to reflect changes and indicate deletions that other users have made (in a multiuser environment) or that you have made elsewhere.  You can't use the Refresh command to display newly added records.  Also, Refresh won't rerun a query or reapply a filter to display new records that meet the criteria or eliminate records that no longer meet the criteria.


relational database

A database in which data is stored in tables, allowing for more efficient and nonredundant data storage and manipulation.


relationship

A connection established between common fields (columns) in two tables.  A relationship can be one-to-one, one-to-many, or many-to-many.


report

A Microsoft Access database object that presents information formatted and organized according to your specifications.  Examples of reports are sales summaries, phone lists, and mailing labels.


report footer

Text and/or graphics that appear at the end of a report and typically contain summaries.


report header

Text and/or graphics that appear at the beginning of a report and typically contain a title, the print date, and a company logo.


report properties

Attributes of a report that affect the appearance or behavior of the report.  For example, you can set the PageHeader property so that a page header appears on every page in a report or on every page except the first.


Report window

A window in which you work with reports in Print Preview or Design view.


requery

To update records in the active form or datasheet to reflect changes to the records, display newly added records, and eliminate deleted records.


row

The visual representation of a record in Datasheet view of a table, query, or form.  In a table's Design view, a row contains information about a field.  In a query's Design view and in the Filter window, a row contains information about queries or filters.  In the Macro window, a row contains information about an action.


row selector

A small box or bar that you can click to select an entire row in a table's Design view or in the Macro window.


ruler
rulers

On-screen rulers that you can display by choosing the Ruler command from the View menu.  You use the rulers to align controls horizontally or vertically on a form or a report.


run time

The time during which an application is running.  During run time, you can interact with an application.


run-time error

An error that Microsoft Access can detect only when an application is running.


section

A part of a form or report, such as a header, footer, or detail section.


section properties

Attributes of a form or report section that affect the appearance or behavior of that section.  For example, you can set the SpecialEffect property to specify a three-dimensional effect or color for a form or report header.


security

A set of features used to specify or restrict data access to prescribed users or user groups.


select statement
select query

A query that asks a question about the data stored in your tables and returns a dynaset in the form of a datasheet without changing the data.  Once the dynaset is displayed, you can view and make changes to the data in the underlying tables.  In contrast, action queries do make changes to your data.


self-join

A join of a table to itself.  Use a self-join to create a query that includes two copies of the same table.


separator

A character that separates units of text or numbers.  It is set in the International section of the Microsoft Windows Control Panel.

A list separator separates items in a list (0,3,2).

A thousand separator separates groups of three digits in numbers (2,000 or 456,871,029).

A decimal separator separates integer parts of a number from its fractional parts (9.35).

A field separator separates items in imported or exported text files.

Note   In Microsoft Access, a semicolon is the default list separator and does not have to be set in the International section of the Windows Control Panel.  This is not true for Access Basic, however, which generally uses a comma.


setting

The value of a property that determines how an object or a control looks or behaves.  For example, if you set the SpecialEffect property of a text box to Raised, the box will look three-dimensional.


shortcut key

A function key or a key combination, such as F5  or Ctrl+A, that enables you to carry out a command.  In contrast, an access key enables you to open a menu or select a control by typing a designated letter while pressing the Alt key.


single stepping

A debugging technique that enables you to trace macro execution one action at a time or Access Basic code execution one line at a time.


sort order

The order in which records are displayed either ascending (A-Z or 0-100) or descending (Z-A or 100-0).


Sorting and Grouping window
Sorting and Grouping box

The workspace in which you specify the order of your data and define the group levels for a report.


source

A document or application that supplies data in a DDE conversation or in an OLE operation.


SQL

A language used in querying, updating, and managing relational databases.  You can view or write Microsoft Access queries as SQL statements using the SQL command in the Query window.  You can use SQL SELECT statements anywhere Microsoft Access accepts a table name, query name, or field name.  For example, you can use an SQL SELECT statement in the RecordSource property of a list box on a form to generate a list of items.


string

A collection of characters that can include both numbers and text.


subform

A form contained within another form or report.


submenu

A menu that opens when a command in a higher-level menu is chosen.


subreport

A report contained within another report.


tab order

The order in which the focus moves from one field or button to the next as you press the Tab key.


table

The fundamental structure of a relational database management system.  In Microsoft Access, a table is an object that stores data in records (rows) and fields (columns).  The data is usually about a particular category of things, such as employees or parts.


table properties

Attributes of a table that affect the appearance or behavior of the table as a whole.  One example is the PrimaryKey property.


text

Data consisting of ASCII characters that represent words and symbols.


text box

A control that provides a place to enter or view text in a form or report.  This is sometimes called an edit field in other applications.


Text data type

A field data type.  Such fields can contain up to 255 characters or the number of characters specified by the FieldSize property, whichever is less.


title bar

The bar that appears at the top of the Microsoft Access window and displays its name.


toggle button

A control that acts as an on/off button.  A toggle button can display either text or a picture and can stand alone or be part of an option group.


toolbar

A bar at the top of the Microsoft Access window containing a set of buttons that you can click to carry out common menu commands.  The items displayed on the toolbar depend on which window has the focus.


toolbox

The set of tools you use at design time to place controls on a form or report.  The toolbox usually appears on the left side of the screen.  You can show or hide the toolbox using the View Toolbox command.

Note   To get information on any of the tools in the toolbox while working in Microsoft Access, display the toolbox, click a tool, and press F1 for Help.


topic

The subject of a dynamic-data exchange (DDE) conversation between two applications.  For example, in the syntax Excel|System!Status, System is the topic.


totals query

A query that displays totals or other kinds of summary calculations for values in various fields from a table or tables.  Strictly speaking, a totals query is not a separate kind of query; rather, it extends the flexibility of select queries.


twip

Unit of measurement used by Microsoft Access and implemented as 1/1440 of an inch.  (A twip is also 1/20 of a point.) There are 1440 twips to an inch and 567 twips to a centimeter.


unbound control

A control that's not connected to a field or an expression.  You can use unbound controls to display informational text, such as instructions about using a form, or graphics and pictures from other applications.  For example, lines and rectangles are unbound controls, and text boxes can be either bound or unbound controls.


unbound object frame

A control you place on a form to contain an unbound object, which is an object, such as a picture, whose value isn't derived from data stored in a table.


update query

An action query that changes a set of records according to criteria you specify.


validation

The process of checking whether entered data meets certain conditions or limitations.


validation rule

A rule that sets limits or conditions on what can be entered in a particular field.  Microsoft Access displays an error message whenever the rule is violated.  Rules are set with the ValidationRule property in the property sheet of a table or form.


value

The contents of a field, such as a name in a First Name field.


vertical scroll bar

A scroll bar that appears along a vertical axis.  You use it to scroll up and down through a form, query, datasheet, or report.


view

A window that allows you to work with a Microsoft Access object in a certain way.

In Design view, you can design an object the way you want it to look.

In Datasheet view, you can modify and view data in a row-and-column format.

In Form view, you can modify and view data in fields on a form.

In Print Preview, you can see how an object will appear when printed.


WHERE clause

The part of an SQL statement that specifies which records to retrieve.


The asterisk (*), question mark (?), number sign (#), exclamation point (!), hyphen (-), and brackets ([ ]) are wildcard characters.  You can use these characters in queries, commands, and expressions to include all records, file names, or other items that begin with specific characters or match a certain pattern.  You can also use wildcard characters and matching characters to further refine a search.

Symbol	Example	Usage
*	wh* finds what, white, and why *at finds cat, bat, and what	Like the MS-DOS asterisk (*) wildcard character, this asterisk matches any number of characters.  But unlike MS-DOS, it can be used as the first or last character in the character string.
?	b?ll finds ball, bell, and bill	Like the MS-DOS ? wildcard character, this symbol matches any single character.
#	1#3 finds 103, 113, 123	Matches any single digit.
[ ]	b[ae]ll finds ball and bell but not bill	Matches any single character within the brackets.
!	b[!ae]ll finds bill and bull but not bell	Matches any character not in the list.
-	b[a-c]d finds bad, bbd, and bcd	Matches any one of a range of characters.


aggregate function

A function, such as Count, Avg, and Var, that you use in creating a query that calculates totals.  You can select aggregate functions in the Total row of the QBE grid.  In writing expressions and in programming, you can use SQL aggregate functions (including the three listed above) and domain aggregate functions to determine various statistics.


calculated control

A control on a form or report that displays the result of an expression rather than stored data.  The value is recalculated each time a value in the expression changes.  A calculated field is a field defined in a query that displays the result of an expression rather than stored data.


delimited text file

A file containing values separated by commas, tabs, semicolons, or other characters.


exclusive

A way of opening a database that restricts other users or programs from accessing the database.  You can use the Exclusive and Read Only options in the Open Database command dialog box to prevent others from opening the database or to limit their access to viewing but not modifying the database.


fixed-width text file

A file containing values arranged so that each field has a certain width.


group

A collection of user accounts in a secure system, identified by group name and PIN (personal identification number).  Permissions assigned to a group apply to all users in the group.

In a report, group refers to a collection of records.  You can separate records into groups in a report and display introductory and summary data for each group.


ODBC (Open Database Connectivity)
ODBC

A standard protocol for SQL database servers, such as Microsoft SQL Server.  You can install ODBC drivers that allow Microsoft Access to connect to these SQL database servers and access the data in the SQL databases.


one-to-one relationship

A relationship between tables in which each record in the primary table can be associated with only one record in the related table.  Additionally, the related fields must be the primary keys of both tables.  When you create a one-to-one relationship, Microsoft Access lets you select only primary key fields as matching fields.


one-to-many relationship

A relationship between tables in which each record in the primary table can be associated with many records in the related table (each primary key value can appear many times in the related table).


PIN

A four-digit number that Microsoft Access uses in combination with the account name to identify a user account or group of accounts in a secure system.  You enter the PIN and the account name when creating the account or group.


read only
read-only

A type of access to a database whereby you can view but not modify data and database objects.  Read Only is one of the dialog box options for the Open Database command on the File menu.  You can also make a particular form or record read-only by setting the appropriate properties.


referential integrity

Rules that you follow to preserve the defined relationships between tables when you enter or delete records.  If you enforce referential integrity, Microsoft Access prohibits you from adding records to a related table for which there is no primary record, changing values in a primary table that would result in orphan records in a related table, and deleting records from a primary table when there are matching related records.


update

To accept changes to data in a control or record.  Until the record is saved, these changes are stored in a temporary record.  The changes are saved in the database when you move to another record on a form or datasheet or when you explicitly save the record.


user account

An account identified by a user name and PIN (personal identification number) that is created to manage access to database objects in a secure system.


alias

Access Basic:  An alternate name you give to an external procedure to avoid conflict with an Access Basic reserved word, global variable, constant, or a name not allowed by the standard naming conventions.

SQL:  An alternate name you give to a field or expression in a SELECT statement, often shorter or more meaningful.


command line

The string of characters used to invoke an application.  For example, you enter a command line when you create a program item in the Microsoft Windows Program Manager, when you start Microsoft Access by choosing Run from the File Menu in the Windows File Manager, or when you use the RunApp action.


command prompt

At the MS-DOS command line, the character or characters that appear at the beginning of the line, indicating that the computer is ready to receive input.  Also known as MS-DOS prompt.


installable ISAM

A driver you can install that allows access to external database formats such as Btrieve, dBASE, and Paradox.


library database

A database that contains a collection of database objects that can be loaded automatically when you start Microsoft Access.  You specify that a library database is to be loaded by adding its name to the [Libraries] section of MSACCESS.INI.


Memo object

Access Basic:  An object you can use to hold the contents of a table field that has a Memo field data type.  Memo objects can be up to 32K characters long.


parse

To identify the parts of a statement or expression and then validate those parts against the appropriate language rules for correctness.


system administrator

A member of the group Admins who is responsible for managing and maintaining a database system.  A system administrator can create user accounts and groups and can assign permissions for any database object in the system.


work group

A collection of users in a multiuser environment who share data and the same system database.


action QueryDef

Access Basic:  A variable that contains the definition of an action query.  An action QueryDef must be declared as an object variable, can't be used with a Dynaset or Snapshot, and is used with the Execute method.


aliasing

Access Basic:  A way of assigning an alternate name to an external procedure in a declaration to avoid conflict with an Access Basic reserved word, global variable, constant, or a name not allowed by Access Basic naming conventions (for example, a name that begins with an underscore).


Append mode

Access Basic:  A sequential file output mode that sets the file pointer to the end of a file so that you can add records to the file using the Print # and Write # statements.  The Open statement specifies the mode of access.

The other file input/output modes are Binary, Input, Output, and Random.


argument

A constant, variable, or expression that is passed to an Access Basic procedure.  You use an argument with an operand in an expression or in a macro to supply additional information required by some actions.


bitmap

An image made up of pixels on the screen and stored as a collection of bits, one or more of which correspond to one pixel.  When stored as files, bitmaps usually have the file extension .BMP.


Bookmark

Access Basic:  A property of a recordset object (Table, Dynaset, or Snapshot) that contains a string identifying the current record.  If you assign the Bookmark value to a variable and then move to another record, you can make the earlier record current again by setting the Bookmark property to that string variable.


Boolean

Access Basic:  An expression that can be evaluated either true (nonzero) or false (0).  You can use the reserved words True and False to supply the values of -1 and 0, respectively.  The field data type Yes/No is Boolean and has the value of -1 for Yes and 0 for No.

Several property sheet settings are Boolean, including Yes/No, True/False, and On/Off.


constant

A constant represents a numeric or string value that doesn't change.  True, False, and Null are constants.  You can use constants in expressions in tables, forms, reports, queries, and macros.  In an Access Basic module, you can use the Const statement to declare your own constants.

Microsoft Access also provides intrinsic constants that supply fixed values for action arguments and function values (such as the values returned by the VarType function).


current database

The database opened using the OpenDatabase command from the File menu.  In Access Basic, use the CurrentDB( ) function to return the current database, which you can then assign to a database variable using the Set statement.


current index

For an indexed Table, the index most recently set with the Index property.  It is the basis for ordering records in the Table and is used by the Seek method to locate records.  A Table can have more than one index.


current record

Access Basic:  The record in a recordset that you can modify or retrieve data from.  Use a Move methods to move to the first, last, next, or previous record in a recordset.  Use the Find methods (for a Dynaset or Snapshot) or the Seek method (for a Table) to change the current record position according to specific criteria.


debugging

Access Basic:  The process of finding errors in your program.  Debugging usually involves running specific portions of your program and analyzing code at various points.  You can use breakpoints to stop code execution so that you can examine variables.


Declarations section

Access Basic:  The topmost level of a module that appears before any Sub or Function procedures.  This section contains definitions of user-defined data types, global constants, and global variables.


domain

Access Basic:  A set of records defined by a table, a query, or an SQL expression. Domain aggregate functions return statistical information about a specific domain.


domain function

Access Basic:  A function used to aggregate data over a certain set of records (the domain).  The domain functions are DAvg, DCount, DFirst, DLast, DLookup, DMax, DMin, DStDev, DStDevP, DSum, DVar, and DVarP.


Double data type

Access Basic:  A fundamental data type that holds double-precision floating point numbers.  A Double variable is stored as a 64-bit (8-byte) number ranging in value from -1.79769313486232E308 to -4.94065645841247E-324 for negative values, from 4.94065645841247E-324 to 1.797693134862325E308 for positive values, and 0.  The type-declaration character is # (ANSI character 35).

Double is also a FieldSize property setting.


Dynaset object

Access Basic:  A recordset variable that identifies a Dynaset created using the CreateDynaset method.


Empty

Access Basic:  The state of an uninitialized Variant variable.  Variants that are Empty return a VarType of 0.

Empty is not the same as Null, which is a variable state indicating invalid data.  Variables containing zero-length strings ("") are not Empty, nor are numeric variables having a value of 0.


explicit declaration

Access Basic:  A way to declare variables using a Dim, Global, or Static statement.  If you place an Option Explicit statement in the Declarations section of a module, using implicitly declared variables in the module produces an error.


global variable

Access Basic:  A variable you declare with the Global reserved word in the Declarations section of a module.  A global variable can be shared by all the procedures in every module in a database.


Integer data type

Access Basic:  A fundamental data type that holds integer numbers.  An Integer variable is stored as a 16-bit (2-byte) number ranging in value from -32,768 to 32,767.  The type-declaration character is % (ANSI character 37).

You can use Integers to store Boolean values.

Integer is also a FieldSize property setting.


logic error

A programming error that can cause code to produce incorrect results or halt execution.  A logic error may be caused by using incorrect or similar variable names, incorrect variable types, endless loops, or array problems or by flaws in logical comparisons.

Other kinds of programming errors are syntax errors, compile-time errors, and run-time errors.


Long data type

Access Basic:  A fundamental data type that holds long-integer numbers.  A Long variable is stored as a 32-bit (4-byte) number ranging in value from -2,147,483,648 to 2,147,483,647.  The type-declaration character is & (ANSI character 38).


method

Access Basic:  An operation on a report, recordset, or the Debug or Screen object.  Like properties, methods apply to specific objects and have names that are reserved words in Access Basic.

For example, you can apply the Print method to the Debug object to transfer printed output to the Immediate window.


module

Access Basic:  A collection of declarations, statements, and procedures stored together as one named unit.  Unless explicitly made private to the module in which they appear, procedures in one module are recognized and can be called by procedures in other modules in the same database.


module level

Access Basic:  The scope of a variable you declare in the Declarations section of a module.  The variable can be shared by all the procedures in that module but not by procedures in other modules.


Null

Access Basic:  A reserved word that indicates invalid data.  You can perform validation by assigning Null to a Variant field and then later validating it with the IsNull function.  Variants that are Null return a VarType of 1.

Null is not the same as Empty, which is a variable state indicating uninitialized data.  Zero-length strings ("") are not Null, nor are numeric variables having a value of 0.


page

Access Basic:  A portion of the .MDB (database) file in which record data is stored.  Depending on the size of the records, a page may contain more than one record.


procedure

Access Basic:  A sequence of declarations and code statements that define a Sub or Function procedure.


QueryDef

Access Basic:  An object that contains the SQL statement that describes a query.


reserved word

A word that is part of the Access Basic or Microsoft Access SQL language.  Reserved words include the names of statements, predefined functions and data types, methods, operators, and objects.  Don't use reserved words for variable or object names.


scope

Access Basic:  The attribute of a variable or procedure that determines which sections of which modules recognize it.  There are three levels of scope: global, module, and procedure. Variables that you declare globally can be accessed by any module, whereas variables that you declare in a specific module can be used only within that module.  Further, variables you declare in a Sub or Function procedure can be used only in that particular procedure.


Single data type

Access Basic:  A fundamental data type that holds single-precision floating point numbers.  A Single variable is stored as a 32-bit (4-byte) number ranging in value from -3.402823E38 to -1.401298E-45 for negative values, from 1.401298E-45 to 3.402823E38 for positive values, and 0.  The type-declaration character is ! (ANSI character 33).

Single is also a FieldSize property setting.


Snapshot

Access Basic:  A static image of a set of data, such as the records displayed as the result of a query.  Snapshots are recordsets that can be created from a base table, a query, or another recordset.


Snapshot object

Access Basic:  A recordset variable that identifies a Snapshot created using the CreateSnapshot method.


statement

Access Basic:  A syntactically complete unit that expresses one specific kind of operation, declaration, or definition.  Usually, a statement consists of one line in a procedure or Declarations section.  In most cases, however, you can include more than one statement on a line by separating the statements with a colon (:).


String data type

Access Basic:  A fundamental data type that holds character information.  A String variable can contain approximately 65,535 bytes (64K), is either fixed-length or variable-length, and contains one character per byte.  Fixed-length strings are declared to be a specific length.  Variable-length strings can be any length up to 64K, less a small amount of storage overhead.

The type-declaration character is $ (ANSI character 36).


Sub procedure

Access Basic:  A procedure that carries out an operation.  Unlike a Function procedure, a Sub procedure doesn't return a value.  You declare a Sub procedure with the Sub reserved word and end it with an End Sub statement.


syntax

The prescribed order and punctuation for placing reserved words, variables, and constants in a statement or expression.


syntax checking

Access Basic:  A Module Design option that, when set to Yes, checks the syntax of the code each time you enter a line.


syntax error

An error in the grammatical structure of the code or expression.  If syntax checking is enabled, errors are highlighted when you type a line and press Enter.


system objects
system object

An object defined by Microsoft Access.  The system objects are:

The Forms object and the Reports object.

The Debug object and the Screen object.

Recordset objects (Dynasets, Tables, and Snapshots).

System-defined database objects, such as the table MSysIndexes.  You can display or hide the system-defined database objects by selecting the General options setting after choosing the Options command from the View menu.


Table object

Access Basic:  A recordset variable that identifies a table opened using the OpenTable method.


transaction

Access Basic:  A series of changes made to a recordset.  You mark the beginning of a transaction with the BeginTrans statement.  If you want to commit the transaction, use the CommitTrans statement.  If you want to undo all your changes since BeginTrans, use the Rollback statement.

Transactions are optional and can be nested.


variable

Access Basic:  A placeholder that stores data that can change as Access Basic code runs.  Each variable has a unique name that identifies it within its scope.


Variant

Access Basic:  The default fundamental data type for variables that don't have type-declaration characters when a Deftype statement is not in effect.  A Variant can store numeric, string, date/time, Null, or Empty data.

Variables of other data types convert automatically to a Variant, and Variants attempt conversion to other data types.  You can use the VarType, IsEmpty, IsNull, IsNumeric, and IsDate function to determine the underlying data type of a Variant.


VarType

Access Basic:  A function that indicates the underlying data type of a Variant.  VarType values include:  0 (Empty), 1 (Null), 2 (Integer), 3 (Long), 4 (Single), 5 (Double), 6 (Currency), 7 (Date), and 8 (String).


INF: OnCurrent Is Not Triggered on Unbound Forms

 Article Number: Q88131

 CREATED: 18-AUG-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SUMMARY

If a form is unbound, macros or modules bound to the form's OnCurrent

property will not run. In order to modify properties that can be changed

at run time, the macro or module must be bound to either the OnOpen

property of the form or the OnEnter property of the first control in the

tab order of the form.

MORE INFORMATION

You can use the OnOpen property to trigger a macro or module each time

a form is opened. Changes made to properties such as Visible will

occur before the form is displayed. This allows you to make changes

that your application's users do not see.

If, however, you want users to see the changes taking place, the

macro must be run after the OnOpen property.

The following example creates a simple form with two text boxes. The

macro that is triggered automatically sets the Visible property of the

text box to Yes and No alternately so that it appears to flash several

times when the form is opened. Note that you cannot change the Visible

property of a control that is currently selected, so there must be at

least one other object on your form to select:

1. Create a new, unbound form.

2. Place a text box on the form, and give the text box the following

   properties:

      ControlName: Text0

      ControlSource: Hello World

3. Please a second text box on the form, and give it the following

   property:

      Control name: Text2

4. Save the form as Flash.

5. Create a new macro, and then choose Macro Names from the View menu.

6. Add the following macro names and actions, and then save the macro

   group as Flashing Macros:

      Macro Name   Action

      --------------------------

      Repeat It    GoToControl

                   RunMacro

      Flash        SetValue

                   RepaintObject

                   SetValue

                   RepaintObject

      Repeat It Actions

      -----------------------------------

      GoToControl

         Control Name: Text2

      RunMacro

         MacroName: Flashing Macros.Flash

         Repeat Count: 10

      Flash Actions

      --------------------------------------

      SetValue

         Item: Forms![Flash]![Text0].Visible

         Expression: No

      RepaintObject

         Object Type: Form

         Object Name: Flash

      SetValue

         Item: Forms![Flash]![Text0].Visible

         Expression: Yes

      RepaintObject

         Object Type: Form

         Object Name: Flash

7. View the Flash form in Design view. Set the form's OnOpen property

   to:

      Flashing Macros.Repeat It

8. Save and then close the form. Open the form in Form view.


INF: Adding a New Record to a Combo Box with a Double-Click

 Article Number: Q88148

 CREATED: 18-AUG-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to set up a macro so that you can add new values

to a combo box, using the Orders form in the sample database NWIND.MDB as

an example.

MORE INFORMATION

Follow these steps to modify the Orders form so that you can add new values

to the Salesperson combo box:

1. Open the NWIND database.

2. Create the following new macro, and save it as Macro1:

      Macro Name   Condition                   Action

      -----------------------------------------------------

      NewRecord                                OpenForm

      OnClose      [Employee ID] Is Not Null   DoMenuItem

                   ...                         SelectObject

                   ...                         ReQuery

                   ...                         SetValue

      NewRecord Actions

      --------------------------------------------------------

      OpenForm: Opens the Employees form to add a new employee

         Form Name: Employees

         View: Form

         Data Mode: Add

         Window Mode: Normal

      OnClose Actions

      -------------------------------------------------------------------

      DoMenuItem: Saves the record entered into the Employees form and

                  prevents errors if no record is entered

         Menu Bar: Form

         Menu Name: File

         Command: Save Record

      SelectObject: Selects the open Orders form

         Object Type: Form

         Object Name: Orders

         In Database Window: No

      ReQuery: Requery the combo box in the Orders form

         ControlName: Employee ID

      SetValue: Takes the value from the newly entered Employee ID in

                 the Employees form and puts it in the Employee ID in the

                 Orders form

         Item: Forms!Orders![Employee ID]

         Expression: Forms!Employees![Employee ID]

3. Change the properties of the Employee ID combo box on the Orders form

   as follows:

      OnDblClick: Macro1.NewRecord

      StatusBarText: Double-click to Add a New Employee

4. Change the OnClose property of the Employees form as follows:

      On Close: Macro1.OnClose

To see how this process works, open the Orders form in Form view, then

double-click the Salesperson combo box. The Employees form will open. After

filling in the pertinent data, close the form. When the form is closed, the

newly entered data will be transferred to the Orders form.

Additional reference words: 1.00 1.10 2.00 doubleclick update record


INF: "Continued..." Header for Groups on More than One Page

 Article Number: Q88156

 CREATED: 18-AUG-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to create a label that will print at the

top of each report page when a data group spans multiple pages.

The events used in this technique capture the value of the group in the

page footer. If this value is the same as the page header value on the next

page, a label containing "Continued from previous page..." is printed at

the top of the page.

MORE INFORMATION

The steps below use the sample database NWIND.MDB to demonstrate how to

create a label that will print at the top of each report page when a data

group spans multiple pages:

 1. Open the NWIND database and create a new module.

 2. Enter the following global Declarations and functions in the

    module.

    NOTE: In the following sample code, underscores (_) are used as line-

    continuation characters. Remove the underscores when re-creating this

    code in Access Basic.

       '-----------------------------------------------

       'Global Declarations

       '-----------------------------------------------

       Global CurrentGroupVal as String

       '-----------------------------------------------

       'Code Section

       '-----------------------------------------------

       Function SetGlobalVar (InReport as Report)

          CurrentGroupVal = InReport!SetGroupVal

       End Function

       Function SetContinuedLabel (InReport as Report)

          If InReport.Page <> 1 then

          InReport!ContinuedLabel.Visible = _

             IIf(Trim(InReport!CheckGroupVal = _

                 Trim(CurrentGroupVal)), True, False)

          End If

       End Function

 3. Open the List Of Products By Category report in Design view.

 4. Increase the height of the detail section to approximately 1 inch.

 5. Increase the height of the page header section by about 0.5 inch. Add a

    label to the page header section. Position the label below the existing

    fields. Set the label's Caption property to "Continued from previous

    page..." and set its ControlName property to ContinuedLabel. (NOTE: In

    Microsoft Access version 2.0, the ControlName property is called the

    Name property.) Set the label's Visible property to No.

 6. From the View menu, choose Field List.

 7. Create a text box bound to the Category Name field by dragging the

    Category Name field to the page header section. Change the text box's

    ControlName property to CheckGroupVal, and set its Visible property to

    No.

 8. Click anywhere in the page header section not occupied by a control to

    display the page header properties in the property sheet. Set the page

    header's OnPrint property to:

       =SetContinuedLabel(Report)

 9. Create a text box bound to the Category Name field in the page footer

    section. Change the text box's ControlName property to SetGroupVal, and

    set its Visible property to No.

10. Click anywhere in the page footer section not occupied by a control.

    Set the page footer's OnPrint property to:

       =SetGlobalVar(Report)

11. Preview the report. Note the "Continued from previous page..." message

    at the top of any page whose category details span more than one page.

Note that the steps above are for illustrative purposes only; your report

may require adjustments other than those above. You may want to set the

section KeepTogether properties to Yes to keep sections from being split

across pages. In the example above, you may also want to set the Category

Name header section's ForceNewPage property to Before Section to help

control the page layout.

In Microsoft Access version 2.0, there is a new GroupKeepTogether property

that you can use to keep groups of records together, or to keep the group

header with the first record in the group. You may want to experiment with

this property to see how it affects your report's layout.

Additional reference words: 1.00 1.10 2.00 container


INF: How to Programmatically Create a Table

 Article Number: Q88157

 CREATED: 18-AUG-1992

 MODIFIED: 22-DEC-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

There is no command in Microsoft Access to programmatically create a

table. This article demonstrates a method and a user-defined Access Basic

function you can use to accomplish this task. The user-defined function

requires a "template table" that you can create.

MORE INFORMATION

Create the template table before you create the user-defined function. The

template table is used to define the data types that will be used in the

new table.

For example, in the template table below, the user has created a data

type called Long Text, which is a 255-character Text field. The user

has also created data types called Short Text, Long Int, and so on.

Table Name: MyTemplate

----------------------

Field Name     Field Type     Length

------------------------------------

Long Text      Text           255

Short Text     Text           50

Long Int       Number         Long Integer

Integer        Number         Integer

Memo           Memo           N/A

Date/Time      Date/Time      N/A

OLE Object     OLE Object     N/A

This template can be used as a generic template for using the

CreateTable procedure. Once you have defined your data types in a

template table, you can use the CreateTable procedure in the following

manner:

Definition

----------

CreateTable <target table>, <template table>, <structure definition>

Where:

<target table> is the name of the table to create and MUST NOT exist

in the database. You may want to code a routine to check for the

existence of such a table before invoking this procedure.

<template table> contains the user-defined data types that will be

used in creating the target table.

<structure definition> defines the structure of the columns in the

table.

Where:

<structure definition> = "<field name> As <user-defined data

type>,..."

NOTE: There are quotation marks around the entire <structure

definition> parameter.

Below is an example of how you would invoke the CreateTable procedure

to create a table based on the template table discussed earlier:

CreateTable "NewTable",

            "MyTemplate",

            "First Name As Short Text,

             Last Name As Short Text,

             Description As Long Text,

             Amount As Integer,

             Notes As Memo"

How CreateTable Works

---------------------

As mentioned earlier, there is no Access Basic command or function to

create a table. Fortunately, Microsoft Access supports the SQL SELECT INTO

command that can be used to create a table. However, SELECT INTO

requires a table for its FROM clause, which explains why you need to

have a template table.

CreateTable parses out the structure definition, then builds a

SELECT INTO statement based on that definition. Once the SQL statement

is built, the QueryDef object is employed to invoke the command,

resulting in a new table.

Procedure Listing

-----------------

NOTE: In the following sample code, an underscore _ is used as a

line continuation character. Remove the underscore when re-creating

this code in Access Basic.

Sub CreateTable (TargetTbl As String, TemplateTbl As String,

   StructureDef As String)

   Dim LineChunk As String, SelectStmt As String, TempChunk As String

   Dim CharPos As Integer, HomePos As Integer, BuildLoop As Integer

   Dim CrtTblDB As Database, CrtTblQry As QueryDef

   BuildLoop = True

   HomePos = 1

   SelectStmt = "Select "

   Do While BuildLoop

      If InStr(HomePos, StructureDef, ",") <> 0 Then

         LineChunk = Trim(Mid$(StructureDef, HomePos, (InStr(HomePos,_

                     StructureDef, ",") - HomePos)))

      Else

         LineChunk = Trim(Mid$(StructureDef, HomePos))

         BuildLoop = False

      End If

      TempChunk = Trim$(Mid$(LineChunk, InStr(UCase$(LineChunk),_

                  " AS ") + 3))

      SelectStmt = SelectStmt & "[" & Trim(Mid$(TempChunk, 1))_

                   & "]" & " As [" & Trim(Mid$(LineChunk, 1, _

                   InStr(UCase$(LineChunk), " AS "))) & "],"

      HomePos = InStr(HomePos, StructureDef, ",") + 1

   Loop

   SelectStmt = Left$(Trim(SelectStmt), Len(Trim(SelectStmt)) - 1) & "_

                Into [" & TargetTbl & "] From [" & TemplateTbl & "];"

   Set CrtTblDB = CurrentDB()

   Set CrtTblQry = CrtTblDB.CreateQueryDef("TempQuery", SelectStmt)

   CrtTblQry.Execute

   CrtTblQry.Close

   CrtTblDB.DeleteQueryDef ("TempQuery")

End Sub

Additional reference words:  1.00 1.10


INF: How to Create a Multiuser Custom Counter

 Article Number: Q88159

 CREATED: 18-AUG-1992

 MODIFIED: 27-AUG-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Microsoft Access allows you to define a field in a table as a counter.

When defined as a counter, Microsoft Access manages the unique

numbering of fields in the table. If you add a record, Access gives

this counter field the next unique value available. As a user, you

have no control over this value.

There may be times when you need unique counters that are not

immediately sequential in nature. Examples are counters that

decrement, or counters that step according to some formula (such as in

steps of 10).

This article describes how to implement a custom counter field with

Access Basic commands. This will give you more flexibility over the

assignment of the actual value you use in this field.

MORE INFORMATION

To following steps outline in general how to create a custom counter.

Further below is a more detailed description on how to create a custom

counter.

1. Create a separate table that will maintain the next available

   custom counter. This table will have one field and one record, with

   the value of the next available counter in this one record.

2. From within Access Basic, open this counter table and retrieve the

   value stored there.

3. Increment the value retrieved and store the number back into the

   database.

4. Close the table and use the value in the appropriate table as the

   next available counter.

In a single-user environment, the steps described above can be done

with macro actions. In a multiuser environment, Access Basic is needed

to handle the event where this counter table is locked. Macro actions

do not provide the locking control needed in the multiuser

environment.

Example

-------

The following example describes how to create a custom counter field

with positive number values divisible by 10 (that is, 10, 20, 30, and

so on) in sequential order.

The Table

---------

 1. From the File menu, choose New, then select Table.

 2. Add a field to the table called "Next Available Counter." Set the

    data type of "Next Available Counter" to number.

 3. From the Edit menu, choose Primary Key to make "Next Available

    Counter" the primary key.

 4. From the View menu, choose Datasheet View.

 5. A dialog box will prompt you to save the table. Save it as

    "Counter Table."

 6. Once in Datasheet view, enter a value of 10 into the "Next

    Available Counter" field.

 7. From the File menu, choose Close to close the table.

The Module

----------

 8. From the File menu, choose New, then select Module to create a new

    module.

 9. Add the following function to the module:

    Function Next_Custom_Counter ()

       Const TABLE_LOCKED = 3000

       On Error GoTo Next_Custom_Counter_Err

       Dim MyDB As Database

       Dim MyTable As Table

       Dim NextCounter As Integer

       '==============================================================

       'Open table and get the next available number, increment value

       'by 10 and save the number back into the table.

       '==============================================================

       Set MyDB = CurrentDB()

       Set MyTable = MyDB.OpenTable("Counter Table")

       MyTable.Edit

       NextCounter = MyTable("Next Available Counter")

       '==============================================================

       'The next line can be changed to conform to your custom counter

       'preferences. This example only increments the value by +10

       'each time.

       '==============================================================

       MyTable("Next Available Counter") = NextCounter + 10

       MyTable.Update

       MsgBox "Next available counter value is " & Str$(NextCounter)

       Next_Custom_Counter = NextCounter

       Exit Function

       Next_Custom_Counter_Err:

          If Err = TABLE_LOCKED Then Resume

          MsgBox "An unexpected error has occurred:" & Err

       End

    End Function

10. From the File menu, choose Save. Save the module as "Custom

    Counter Demo."

The Form

--------

11. From the File menu, choose New, then select Form. Choose the Blank

    Form button to start with a blank form.

12. Add a command button to the form from the toolbox. If the toolbox

    is not displayed, from the View menu, choose Toolbox.

13. If the Properties window is not displayed, choose Properties from

    the View menu.

14. Select the command button with the mouse so that the Properties

    window displays "Command Button" on the title bar.

15. Set the OnPush property to =Next_Custom_Counter().

16. Save the form as "Custom Counter Demo" by selecting the Save As

    command from the File menu.

Execution

---------

17. From the View menu, choose Form view to move to Form view. Click

    on the command button; a message box will display the value of the

    next counter.

Additional reference words:  1.00 1.10 network duplicate


INF: How to Hide the Database Window at Startup

 Article Number: Q88160

 CREATED: 18-AUG-1992

 MODIFIED: 20-DEC-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

- Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

During normal startup of Microsoft Access, the Database window

is visible. If you do not want to give a user access to the Database

window, you can create an AUTOEXEC macro that will hide the Database

window from the user. This article describes how to create a macro to

do this.

MORE INFORMATION

The ability to access the Database window allows the user to modify

database objects, which could lead to corruption of the database and

database objects. Limiting the user to specific forms and windows can

minimize the potential loss of objects and data.

When a Microsoft Access database is first loaded into the environment,

Microsoft Access checks for an AUTOEXEC macro and runs it if it exists.

The following macro will hide the Database window from the user:

1. From the File menu, choose New to create a new database. Give the

   database a unique name.

2. From the File menu, choose New to create a new macro.

3. Add the following actions:

   Action              Comment

   ----------------------------------------------------------------

   SelectObject        Select a macro in the Database window so the

                       focus is set to the Database window.

   DoMenuItem          Hide the object that has the current focus.

4. Set the following properties for the actions entered above:

   SelectObject Action

   -------------------

   Object Type: Macro

   Object Name: Autoexec

   In Database Window: Yes

   DoMenuItem Action

   -----------------

   Menu Bar: Form

   Menu Name: Window

   Command: Hide

5. From the File menu, choose Save As, and save the macro as

   Autoexec.

The macro will hide the Database window from the user. However, menu

options will still exist to show the Database window. To hide these options

from the user, you can create a custom menu for your application, or

disable the Show command on the File menu.

REFERENCES

==========

For more information on using Windows API function calls to disable menu

commands, query on the following words here in the Microsoft Knowledge

Base:

   GetMenu and GetSubMenu

Additional reference words: 1.00 1.10 gray grey dimmed


PRB: "Invalid Range" Error When Importing from MS Excel

 Article Number: Q88161

 CREATED: 19-AUG-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you import the named range "Database" from Microsoft Excel

versions 3.x and 4.x files, the following error appears:

   Invalid Range.

This error does not occur when you import from Microsoft Excel

version 2.0.

CAUSE

This error is caused by the difference in the Microsoft Excel binary

information file format (BIFF) structures between versions:

 - BIFF2 has the range listed in its internally defined named range

   table. Microsoft Access can read this table.

 - BIFF3 and BIFF4 use an internal construct, rather than listing

   "Database" in the internal named range table. Microsoft Access

   cannot read the internal construct of BIFF3 and BIFF4.

RESOLUTION

There are three recommended workarounds that enable you to import data

successfully from Microsoft Excel:

 - Save the Excel file in 2.x format (in the File Save As dialog)

   before importing the file into Microsoft Access.

 - Give the range "Database" a second name (such as "My_Database_Range").

   Microsoft Excel allows users to assign multiple names to the same

   range.

 - Use the range specification rather than a named range (for example,

   A1:D50).

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

version 1.0. This problem was corrected in Microsoft Access version 1.1.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. In Microsoft Excel version 3.0 or higher, create a named range

   called "Database" (without the quotation marks).

2. Save the file as TEST.XLS.

3. In a Microsoft Access database, choose Import from the File menu.

4. Select Microsoft Excel, and then choose OK.

5. Select TEST.XLS, and choose Database for the named range.


INF: Introduction to Windows Programming for MS-DOS Programmer

 Article Number: Q88164

 CREATED: 19-AUG-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article discusses some differences between programming in the

MS-DOS environment and programming in the event-driven Windows

environment.

MORE INFORMATION

For the purposes of this discussion, consider the use of the term

"traditional programmer" as someone who has not programmed in Windows,

but has experience programming in an MS-DOS environment.

As a traditional programmer, you may not only have become comfortable

with a particular programming style, but also with certain accepted

fundamentals, such as writing an instruction and expecting it to be

carried out in a controlled order. Access Basic makes good use of

Windows, making it easy to learn to program.

"One Entry, One Exit" vs. Event-Driven Programming

--------------------------------------------------

Consider the following pseudocode of a program designed to get user

input, count all the records in a table, and display the result in a

box if the user presses 1, or exit if the user presses 2.

   START PROGRAM

   LOOP WHILE TRUE

      GET KEYPRESS INTO X

      IF X IS "1"

         COUNT ALL RECORDS IN THE TABLE INTO Y

         DRAW BOX FROM ROW 10 COLUMN 5 TO ROW 12 COLUMN 7

         DISPLAY Y AT ROW 11 COLUMN 6

      IF X IS "2"

         EXIT LOOP

   END LOOP

   STOP PROGRAM

The purpose of this program is to continuously loop until a key

press of a 1 or 2 is detected. At that point, a decision is made to

perform some sort of operation, or to ignore the keypress and continue

looping. The programmer has full control over what happens.

The Windows programming model is event-driven and graphic object

oriented. In other words, programming in Windows involves creating

objects and modifying aspects (or properties) of those objects based

on different events. Consider the following sample program that

presents two buttons to the user. If the user chooses the Count

button, the program counts the records in the database and displays

the result in a window. The user can press the Exit button to exit

from the program.

First, you create the necessary objects. Most of this phase of Access

Basic programming is created graphically with the Access Forms

designer. The list of controls and properties below defines a form

that will be used to illustrate this.

   Form: MasterForm

   ----------------------------

   Push Button: CountButton

       Caption: Count

        OnPush: =DisplayCount()

   Push Button: ExitButton

       Caption: Exit

        OnPush: =CloseProgram()

   Text Box: DisplayWindow

NOTE: OnPush is a property of Microsoft Access version 1.x command buttons

that gives you the ability to invoke an Access Basic procedure or macro. In

Microsoft Access 2.0, the property is called OnClick.

You can then create the modules that the objects will invoke. In this

case, buttons are the only objects that will have the ability to

invoke procedures. The procedures shown below are pseudo-code

examples.  The first procedure defined is the DisplayCount procedure:

   PROCEDURE DisplayCount()

      COUNT ALL THE RECORDS IN THE TABLE INTO Y

      CHANGE THE DISPLAYWINDOW TEXT PROPERTY TO Y

   END PROCEDURE

Notice that the code did not direct the resulting count to display in

a box painted on the screen. Instead, the Text property of

DisplayWindow was changed to the resulting count value. The next

procedure defined is the CloseProgram procedure.

   PROCEDURE CloseProgram

      CLOSE MASTERFORM

   END PROCEDURE

Notice that this procedure does not provide an exit from some kind of

loop or other program structure. Instead, it closes the object that

contains the buttons and window.

At this point, you have a master form object containing two buttons, a

window, and a couple of coded procedures. They are in no special

order, they simply exist as part of the form. So, where is the loop

that checks for button activity? Where is the command to invoke the

program?

The answer is that these do not exist as you might expect them to.

You "run" the program by opening MasterForm. When you open the form,

all the control objects (that is, the buttons and so on) exist on

the form waiting for something to happen. In this example, there is no

flow of control (no looping to check activity).

While the form is active, Windows constantly checks for events. When

an event occurs, the user's input is put in a queue and "waits in

line" until it is processed. For example, when you push the "Count"

button, Windows detects that the button object you placed on the form

has been affected.  Windows sends a "Mouse Click" message to Access.

Access then translates the message and determines that the

DisplayCount() function should be called based on the "On Push" field

of the command button.

Advantages

----------

The traditional programmer will find this new approach to programming

a bit challenging. There are a few things to learn and "unlearn," but

there are many advantages.

Windows Interface

-----------------

The Windows interface is one that has been regarded throughout the

industry as being very user-friendly. Familiar objects such as push

buttons, radio buttons, list boxes, and a wide variety of colors and

screen fonts are generally more appealing than standard ASCII text

characters.

The Windows Standard

--------------------

Because Access Basic forces you to some extent into the Windows

standard, others who are familiar with Windows applications can

immediately recognize the "look and feel" of your application. This

reduces the learning time because the user does not have to learn

entirely new interface controls and prompts.

Advantages Offered by the Windows Environment

---------------------------------------------

You do not have to worry too much about different devices such as

monitors, printer drivers, and so on. The Windows operating

environment takes care of most device compatibility and user

preference issues. In addition, because Windows handles and processes

events, you will find it much easier to create and manage many aspects

of an application.

Additional reference words: 1.00 1.10 2.00


INF: Like vs. = with Wildcard Characters in Query Searches

 Article Number: Q88166

 CREATED: 19-AUG-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you are searching a string using wildcards (for example, * or ?), you

must use Like or Not Like in the Criteria field, rather than using = or <>.

When you use the = or <> operators, Microsoft Access treats them as actual

characters to search for.

MORE INFORMATION

If you have a table with one column called Col_Name and the following

four records

   Foos

   Foosball

   Foos ball

   Foos*

and you make a query based on the table with the criteria

   ="Foos*"

your query will return:

   Foos*

But, if your criteria is

   Like "Foos*"

your query will return the following four records:

    Foos

    Foosball

    Foos ball

    Foos*

The SQL statements built by Microsoft Access for these queries are as

follows:

The SQL statement using Like is:

   SELECT  DISTINCTROW tablename.Col_Name

   FROM [tablename]

   WHERE ((tablename.Col_Name Like "foos*"));

The SQL statement using = is:

   SELECT  DISTINCTROW tablename.Col_Name

   FROM [tablename]

   WHERE ((tablename.Col_Name="foos*"));

Additional reference words: 1.00 1.10 2.00


INF: How to Determine if a Specific Windows Program Is Running

 Article Number: Q88167

 CREATED: 19-AUG-1992

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

There may be times when you only want one instance of an application to run

under Microsoft Windows. For example, if you place a command button on a

form that starts the Windows Calculator (CALC.EXE) program, the user can

start many instances of Calculator. This is very inefficient use of memory

and system resources. If your program determines if the application is

already running, it can either start the application for the first time, or

bring the existing application to the front.

To determine if a specific program is running, call the Windows application

programming interface (API) function FindWindow(). FindWindow() returns the

handle of the window whose class is given by the lpClassName parameter and

whose window name, or caption, is given by the lpCaption parameter. If the

returned value is zero, the application is not running.

MORE INFORMATION

When an application is started from the Program Manager it registers the

class name of the form. The window class provides information about the

name, attributes, and resources required by your form. The Microsoft

Access window has a class name of "OMain." For additional command class

names, see further below.

By calling FindWindow() with a combination of a specific program's class

name and/or the title bar caption, your program can determine whether

that specific program is running.

You can determine the class name of an application by using SPY.EXE,

which is supplied with the Microsoft Windows Software Development Kit

(SDK) version 3.1.

If the window has a caption bar title, you can also use the title to

locate the instance of the running application. This caption text is

valid even when the application is minimized to an icon.

The following example shows three ways to determine if the Windows 3.1

Calculator is running. To create the program, do the following:

 1. From the Program Manager File menu, choose Run and enter CALC.EXE

    to start Calculator.

 2. From the File menu, choose New to create a new database.

 3. From the File menu, choose New, then select Form to create a new

    blank form.

 4. When the form is displayed, from the View menu, choose Toolbox.

 5. Select the command button tool on the toolbar, then double-click

    the form to place a command button on the form.

 6. From the View menu, choose Properties to display the Properties

    window. Set the following command button property:

       Property       Value

       ------------------------------

       On Push        =CalculatorUp()

    NOTE: In Microsoft Access version 2.0, the OnPush property has

    become the OnClick property.

 7. Close and save the form as "FindWindow Form."

 8. From within the Database window, open a new module and

    enter the sample Access Basic code below:

   NOTE: In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

'=====================================================================

'Declarations section

'=====================================================================

Option Explicit

Declare Function FindWindow% Lib "user" (_

                       ByVal lpClassName As Any,_

                       ByVal lpCaption As Any)

'=====================================================================

'End of Declarations section

'=====================================================================

'=====================================================================

'Code section

'=====================================================================

Function CalculatorUp ()

   Const lpClassName = "SciCalc"

   Const lpCaption = "Calculator"

   'This demonstrates three different ways to call FindWindow:

      '1. The ClassName only.

      '2. The Caption only.

      '3. Both the ClassName and the Caption

   MsgBox "Calculator Handle = " & FindWindow(lpClassName, 0&)

   MsgBox "Calculator Handle = " & FindWindow(0&, lpCaption)

   MsgBox "Calculator Handle = " & FindWindow(lpClassName, lpCaption)

   'This function could return the existence of a window.

   CalculatorUp = FindWindow(lpClassName, 0&)

End Function

'=====================================================================

'End of code section

'=====================================================================

 9. Close and save the module as "FindWindow Code."

10. From within the Database window, open the FindWindow Form. Choose

    the FindWindow Form command button with CALC.EXE running and

    without CALC.EXE running. If CALC.EXE is running, your application

    will print an arbitrary handle. If CALC.EXE is not running, your

    application will print the number zero as a handle.

Below are some class names of common applications that are shipped

with Windows:

   Class Name         Application

   ------------------------------

   OMain              ACCESS.EXE

   SciCalc            CALC.EXE

   CalWndMain         CALENDAR.EXE

   Cardfile           CARDFILE.EXE

   Clipboard          CLIPBOARD.EXE

   Clock              CLOCK.EXE

   CtlPanelClass      CONTROL.EXE

   XLMain             EXCEL.EXE

   Session            MS-DOS.EXE

   Notepad            NOTE.EXE

   pbParent           PBRUSH.EXE

   Pif                PIFEDIT.EXE

   PrintManager       PRINTMAN.EXE

   Progman            PROGMAN.EXE   (Windows Program Manager)

   Recorder           RECORDER.EXE

   Reversi            REVERSI.EXE

   #32770             SETUP.EXE

   Solitaire          SOL.EXE

   Terminal           TERMINAL.EXE

   WFS_Frame          WINFILE.EXE

   MW_WINHELP         WINHELP.EXE

   #32770             WINVER.EXE

   OpusApp            WINWORD.EXE

   MSWRITE_MENU       WRITE.EXE

REFERENCES

==========

"Programming Windows: the Microsoft Guide to Writing Applications for

Windows 3," by Charles Petzold, Microsoft Press, 1990

"Peter Norton's Windows 3.0 Power Programming Techniques," by Peter

Norton and Paul Yao, Bantam Computer Books, 1990

Microsoft Windows 3.0 Software Development Kit "Reference Volume 1"


INF: Error Msg: Cannot Hide the Control that Has Focus

 Article Number: Q88168

 CREATED: 19-AUG-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

If you change the Visible property of a control to False, and that

control has focus, you will receive the following error message:

   Can't hide the control that has focus

Although you cannot trap this error message within a macro, you can

call Access Basic code that can trap this error and return the results

to a macro.

MORE INFORMATION

Steps to Reproduce Behavior:

 1. Create a new form.

 2. Place a command button on the form.

 3. Set the following properties for the command button:

      ControlName: Controller

      Caption: Turn Off

      OnPush: Turn Off

 4. Save the form as "Turn Off Controller" and then close it.

 5. Repeat steps 1-3 for a second form, but use the following

    properties for the command button:

      ControlName: Subject

      Caption: Subject

 6. Save the form as Turn Off Subject and then close it.

 7. Create a new macro.

 8. From the View menu, choose Conditions to display the Condition

    field.

 9. Add the following actions to the macro:

    Condition        Action      Comment

    ----------------------------------------------------

    TurnOff()<>2165  MsgBox      Successfully turned off

          ...        StopMacro   Note the ellipsis (...)

                     MsgBox      Message here

    MsgBox Action

    --------------------------------

    Message: Successfully turned off

    StopMacro Action

    ----------------

    none to set

    MsgBox Action

    ---------------------

    Message: Message here

10. Save the macro as Turn Off and then close it.

11. Create a new module.

12. Add the following sample code to the module:

    '-----------------------------------------------------

    'Global Section

    '-----------------------------------------------------

    Options Explicit

    '-----------------------------------------------------

    'Functions

    '-----------------------------------------------------

    Function TurnOff ()

       'If a control has focus, then this will trap error 2509

       On Error GoTo errhandler

        Forms![Turn Off Subject]![Subject].Visible= False

       TurnOff = True

    Exit Function

    errhandler:

       If Err = 2165 Then

          TurnOff = 2165    'trap the "Has focus scenario"

       Else

          TurnOff = 0

       End If

    Exit Function

14. Save the module as Turn Off and then close it.

15. Open both the Turn Off and Turn Off Subject forms.

16. Choose the Turn Off command button.

Additional reference words: 1.00 1.10 2.00 errmsg


INF: Incrementing the Numeric Portion of a String

 Article Number: Q88169

 CREATED: 19-AUG-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes a formula that you can use to set the default value

of a bound text field in a form to the next higher numeric value (default

value = default value + 1).

The sample formula in this article follows these steps:

1. Find the highest numeric value used in a table.

2. Strip any leading text characters.

3. Add 1 to the value found in step 1.

4. Reconnect the leading text characters.

NOTE: This example assumes that the number of leading text characters

is known at the time the form is designed.

MORE INFORMATION

Use the following sample procedure to increase the default value of a

bound text field on a form:

 1. Open an existing database, or create a new database.

 2. Create a new table.

 3. Add a field called Book ID with a Text data type. From the Edit

    menu, choose Set Primary Key.

 4. Add a second field of any data type to the table.

 5. Save the table as Increment.

 6. Switch to Design view and enter the following values:

       Book ID       Second Field

       --------------------------

       BO-110

       BO-111

       BO-112

 7. Close the table.

 8. Create a new form based on the Increment table.

 9. From the View menu, choose Field List.

10. Drag the Book ID field and the second field from the field list

    to the form.

11. Change the form's DefaultView property to Single Form.

12. Set the DefaultValue property of the Book ID text box to the

    following:

    NOTE: In the following sample code, an underscore (_) is used as a

    line-continuation character. Remove the underscore when re-creating

    this code in Access Basic.

       ="BO-" & Right(DMax("[Book ID]","Increment"),Len(DMax_

          ("[Book ID]","Increment"))-3)+1

13. Switch to Form view and enter a new record.

The components of the formula for the DefaultView property are:

 - DMax("[Book ID]","Increment") locates the highest value in the table.

 - Len(DMax(...)) finds the length of the value returned by the DMax()

   function.

 - Right(DMax(...),Len(...)-3) strips the three leading text characters.

 - +1 increments the result of the Right() function.

 - "BO-" concatenates the text "BO-" on to the incremented number.

Note that this example works correctly when the form's DefaultView property

is Single View; it may not work correctly in Continuous View. When you move

to a new record and begin to enter data, Microsoft Access displays the next

empty record. The default values for this record are calculated before the

record you are currently editing is committed. Because the DMax() function

calculates the maximum value from those records stored in the table, the

Book ID of the record you are currently editing is repeated.

If you are working in a multiuser environment, it is possible that

more than one user may receive the same calculated Book ID value.

Although you can manually change the Book ID, you can also maintain

the highest numeric value in a separate table, using a macro or Access

Basic code.

REFERENCES

==========

For more information on multiuser counters, query on the following words

here in the Microsoft Knowledge Base:

   multiuser and counter

Additional reference words: 1.00 1.10 2.00


INF: Sample Function to Determine the Existence of a Query

 Article Number: Q88170

 CREATED: 19-AUG-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to determine the existence of a query with

Access Basic code.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic," in version 2.0.

MORE INFORMATION

Microsoft Access does not have a function to determine the existence

of a specific query. Using Access Basic code, you can determine if a query

exists in the database.

You can use the following sample function to return the existence of

a query:

1. Open the sample database NWIND.MDB and create a new module with the

   following function:

'********************************************************

'Declarations section of the module

'********************************************************

Option Compare Database

Option Explicit

'===============================================================

' The following function is named IsQuery().  It accepts a string

' argument and returns either True(-1) or False(0).

'================================================================

Function IsQuery (QueryName As String) As Integer

    Dim DB As Database

    Dim Snap As Snapshot

    Set DB = CurrentDB()

    Set Snap = DB.ListTables()

    Snap.MoveFirst

    IsQuery = False

    Do Until Snap.eof

        If Snap![Name] = QueryName And Snap![TableType] = DB_QUERYDEF Then

            IsQuery = True

        End If

        Snap.MoveNext

    Loop

    Snap.Close

End Function

2. From the View menu, choose Immediate Window. Enter the following

   command, and then press ENTER:

      ?IsQuery("Order Information")

3. "-1" should be displayed in the Immediate window (-1 represents

   True in Microsoft Access).

4. Experiment by calling the function with a nonexistent query. This

   should display "0" (which represents False).

Additional reference words: 1.00 1.10 2.00


INF: Using SetSysModalWindow API Call in Access Basic

 Article Number: Q88171

 CREATED: 19-AUG-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

In Microsoft Access Basic, you can make an application modal so that

users cannot switch to other Windows-based programs while the

Microsoft Access application is active. This functionality is achieved

with the following Windows application program interface (API)

functions:

   SetSysModalWindow

    -and-

   FindWindow

This article discusses the use of the SetSysModalWindow API function

and provides an example of its use in Microsoft Access Basic.

MORE INFORMATION

Microsoft Windows is designed so that the user can switch between

applications without terminating one program to run another. There may

be times, however, when a Microsoft Access application needs to

restrict the user from switching to another application. Examples of

this are a security system or time-critical application that needs to

run uninterrupted.

SetSysModalWindow Usage Notes

-----------------------------

Consider all of the following usage notes before making a window

system-modal.

1. If an application passes the handle of the window as an argument

   to the SetSysModalWindow, the user is limited to that window. This

   prevents the user from moving to other applications or bringing up

   the Task List (either with the mouse or by pressing CTRL+ESC) .

2. If an application uses the SetSysModalWindow function in

   conjunction with the GetSystemMenu function, the Control (system)

   menu is disabled and the user is prevented from quitting Windows

   by pressing ALT+F4.

3. A window that is system-modal cannot be minimized, maximized, moved,

   or sized. Microsoft Access help is created with a separate Windows

   Help file; therefore, help windows created with the Windows Help

   Compiler are not available to the user.

4. When an application uses the SetSysModalWindow API function, the

   system-modal window must be closed before other applications or

   windows can be accessed. Therefore, when using this function, be

   sure that the application has a means to exit Microsoft Access.

5. Any child window that is created by a system-modal window becomes

   a system-modal window. For example, if Microsoft Access is system-

   modal and a form is opened, that form becomes system-modal until

   it is closed.

How to Use the SetSysModalWindow Function

-----------------------------------------

To use the SetSysModalWindow API function within Microsoft Access

Basic, create the sample code below.

NOTE: In this sample code, an underscore (_) is used as a line

continuation character. Remove the underscore when re-creating this

code in Access Basic.

1. Within the Declarations Section, enter the following:

      Option Explicit

      Declare Function SetSysModalWindow% Lib "User" (_

                        ByVal hwnd%)

      Declare Function FindWindow% Lib "User" (_

                      ByVal lpszClassName As Any,_

                      ByVal lpszWindow As Any)

2. Create a procedure by entering the following:

      Function System_Modal_Test ()

        Const lpClassName = "OMain"

        ' Declares the class name constant used in

        ' the FindWindow API function.

        Dim AccessHandle

        Dim Success As Integer

        ' FindWindow returns the Handle for Microsoft Access.

        AccessHandle = FindWindow(lpClassName, 0&) 'Note this is a zero

        ' The Handle for Microsoft Access is sent then Microsoft Access

        ' becomes modal.

        Success = SetSysModalWindow(AccessHandle)

      End Function

3. From the File menu, choose Save and save the module as "Modal

   Access" (without the quotation marks). Choose the OK button.

4. From the Run menu, choose Compile All.

5. From the View menu, choose Immediate Window. In the Immediate

   window, type the following, then press ENTER:

      ?System_Modal_Test()

After running the program, test the modal functionality by trying to

select other windows or resize or move the system-modal window.

REFERENCES

==========

For more information on the Modal property in Microsoft Access, search for

"Modal" then "Modal Property" using the Microsoft Access Help menu.

For more information on using the FindWindow API function, query on the

following words here in the Microsoft Knowledge Base:

   Access and FindWindow

For more information on API functions, refer to:

 - "Microsoft Windows Software Development Kit," Microsoft Press, 1992

 - "Programming Windows: The Microsoft Guide to Writing Applications

   for Windows 3," Charles Petzold, Microsoft Press, 1990

 - "Programmer's Reference Library: Microsoft Windows 3.1 Guide to

   Programming Reference," Volumes 1-6, Microsoft Press, 1992

For more information on Windows API calls, query on the following words

here in the Microsoft Knowledge Base:

   handle and API and DLL and kernel and user and GDI

Additional reference words: 1.00 1.10 2.00 checkpage


INF: Norton Desktop 1.x Not Compatible with Microsoft Access

 Article Number: Q88172

 CREATED: 19-AUG-1992

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

Running Norton Desktop for Windows versions 1.x with Microsoft Access

results in unpredictable behavior in Microsoft Access (for example, you

may lose the background screen or experience a general protection [GP]

fault). To resolve these problems, upgrade to version 2.0 of Norton

Desktop for Windows.

Norton Desktop for Windows is manufactured by a vendor independent of

Microsoft; we make no warranty, implied or otherwise, regarding this

product's performance or reliability.

Additional reference words: 1.00 1.10 2.00 WinIss


INF: ODBC Setup for Microsoft Access and SQL Server

 Article Number: Q88173

 CREATED: 19-AUG-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - Microsoft SQL Server versions 1.10, 1.11, and 4.20 for MS-DOS

   and Microsoft OS/2, and Microsoft SQL Server for Windows NT

 - Microsoft SQL Administrator versions 4.20 and 4.21 for Windows

 - Microsoft ISQL for Windows version 4.21

---------------------------------------------------------------------

SUMMARY

The installation of Microsoft ODBC for Microsoft and Sybase SQL Server

requires the use of ISQL command line procedures to properly run the

INSTCAT.SQL script.

If INSTCAT.SQL has not been properly implemented in SQL Server,

the following error will be displayed while attaching a SQL table

in Microsoft Access:

   [Microsoft][ODBC SQL Server Driver] The ODBC catalog stored

   procedures installed on server <server_name> are version xx.xxxx;

   version xx.xx.xxxx is required to ensure proper operation.  Please

   contact your system administrator.

MORE INFORMATION

To properly configure SQL Server for use with Microsoft ODBC, you must run

the SQL script file INSTCAT.SQL (shipped on the ODBC disk in Microsoft

Access version 1.x and on disk 1 in Microsoft Access version 2.0) to set up

the proper stored procedures that provide catalog information used by

Microsoft ODBC.

NOTE: Microsoft SAF for MS-DOS and OS/2 is limited to 511 lines of code in

a SQL script. INSTCAT.SQL has well over 511 lines of code.

Microsoft SQL Administrator version 4.20 will open the INSTCAT.SQL script,

but you will not be able to run it.  This is because version 4.20 of the

SQL Administrator does not recognize the GO command used in INSTCAT.SQL.

This has been corrected in the SQL Administrator version 4.21.

In Microsoft SQL Server version 4.20a or earlier, the proper way to install

the catalog stored procedures using INSTCAT.SQL is to run INSTCAT.SQL from

the command line using the SQL Server utility ISQL (Interactive SQL).  If

you are using Microsoft SQL Server version 4.20b for OS/2 or Microsoft SQL

Server for Windows NT, you can  run the INSTCAT.SQL script from within

either ISQL/w (Interactive SQL for Windows), or Microsoft SQL Administrator

for Windows version 4.21.

Note that in order to run the INSTCAT.SQL script, you must connect

to your SQL Server as the System Administrator, or SA.

The ISQL facility is run from either the MS-DOS or OS/2 command

prompt. The syntax for this procedure is:

NOTE: In the following example, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this

example.

   isql /U <sa login name> /n /P <password> /S <SQL server name> /i_

   <drive:\path\INSTCAT.SQL> /o <drive:\path\output file name>

Below are descriptions of the command line switches:

   /U    The login name for the system administrator

   /n    Eliminates line numbering and prompting for user input

   /P    Password used for the system administrator (case sensitive)

   /S    The name of the server to set up

   /i    Provides the drive and fully qualified path for the location of

          INSTCAT.SQL

   /o    Provides isql with an output file destination for results or

         the process including errors

Example

-------

   isql /U sa /n /P skier /S DUMMY_SERVER /i d:\SQL\INSTCAT.SQL /o_

   d:\SQL\output.txt

After you run INSTCAT.SQL, you should run the RECONFIGURE command

against the MASTER database using SAF. See pages 205-212 of the

Microsoft SQL "Administrator's Guide," version 4.2, for more

information.

NOTE: This information is available in the Microsoft Access README.TXT

file.

Additional reference words: 1.00 1.10 2.00 errmsg


INF: Sample Function to Determine the Access Startup Directory

 Article Number: Q88174

 CREATED: 19-AUG-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access does not have a built-in command to return the Microsoft

Access startup directory. However, you can accomplish this by making

Windows application programming interface (API) calls in Access Basic.

This article describes the steps involved in creating a function that

returns the Microsoft Access startup directory.

MORE INFORMATION

The Access Basic CurDir$() function returns the current directory.

Because Microsoft Access can be started from a directory other than the

current directory or the current directory can be changed with the ChDir

statement, the CurDir$() function cannot be used to determine the

startup directory.

The following sample program module makes use of the Windows API functions

GetModuleHandle() and GetModuleFileName(). With the module handle, the

path can be obtained with the GetModuleFileName() function.

Creating the Module

-------------------

The following steps demonstrate how to create the sample Access Basic

function that returns the startup directory:

1. From the File menu, choose New, and select Module.

2. In the Declarations section of the module, enter the following

   Declare statements:

   NOTE: In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

      Option Explicit

      Declare Function GetModuleHandle% Lib "kernel" (ByVal FileName$)

      Declare Function GetModuleFileName% Lib "kernel" (ByVal hModule%,_

                          ByVal FileName$, ByVal nSize%)

3. Enter the following to create the function:

      Function StartUp_Dir ()

      Dim hModule%, Buffer$, Length%, Msg$

         hModule% = GetModuleHandle("MSACCESS.EXE")

         Buffer$ = Space$(255)

         Length% = GetModuleFileName(hModule%, Buffer$, Len(Buffer$))

         Buffer$ = Left$(Buffer$, Length%)

         Msg$ = "Startup path and filename: " & Buffer$

         MsgBox Msg$

      End Function

4. From the Run menu, choose Compile Loaded Modules in Microsoft Access

   version 1.x, or choose Compile All in version 2.0.

5. Save the module as Startup Directory.

6. From the View menu, choose Immediate window. Type the following in

   the Immediate window, and then press ENTER:

      ? StartUp_Dir()

   The Microsoft Access startup directory should be displayed in the

   Immediate window.

Uses and Variations

-------------------

The Startup directory is displayed when the following command is issued in

the Immediate window:

   ? StartUp_Dir()

This function can also be incorporated into other program modules, and can

be used in expressions. For example, entering =Startup_Dir() as the OnPush

or OnClick property of a button on a form returns the startup directory of

Microsoft Access whenever the button is chosen.

NOTE: You can change the MSACCESS.EXE argument for the Windows API

GetModuleHandle() function so that the function returns the startup

directory of another program started in the Windows environment.

Furthermore, you can pass a program name as a variable to the Windows API

function, giving even more flexibility to the function.

REFERENCES

==========

For more information on Windows API calls, query on the following words

here in the Microsoft Knowledge Base:

   handle and api and dll and kernel and user and gdi

"Microsoft Windows Software Development Kit," Microsoft Press, 1992

"Programming Windows: the Microsoft Guide to Writing Applications for

Windows 3," Charles Petzold, Microsoft Press, 1990

"Programmer's Reference Library: Microsoft Windows 3.1 Guide to

Programming Reference," Volumes 1 - 6, Microsoft Press, 1992

Additional reference words: 1.00 1.10 2.00 On Push


INF: How to Create, Debug, and Use a Microsoft Access Library

 Article Number: Q88175

 CREATED: 19-AUG-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes a Microsoft Access library and discusses

how to create and debug a library, as well as some things to

watch out for.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

MORE INFORMATION

Access Basic Library Definition

-------------------------------

When you write a Microsoft Access application, such as the sample database

NWIND.MDB, the application works only within the database in which it was

created. This is satisfactory for many applications that specifically use

the data that resides in the application's database.

However, many Microsoft Access developers write generic applications,

programs, and utilities that are designed to work on any user database. An

example of this is Wizards. Wizards are Access Basic programs that reside

in their own database, but are available to the user in any database the

user has open. If this were not the case, you could not use a Wizard

outside of the database that the Wizard program and system objects reside

in. In order to make a program (such as a Wizard) so that its code and

objects are available to any user database, you must load the database

containing the program and its objects as a library.

To load a database as a library, you must open the .INI file (MSACCESS.INI

in Microsoft Access version 1.x, MSACC20.INI in version 2.0) and add an

line to the Libraries section. When you open the .INI file initially, you

will probably see a Libraries section with an entry for the Wizards

library:

   [Libraries]

   wizard.mda=ro

NOTE: If there is no Libraries section, add it to the end of the file

and continue. The .INI file can be found in your Windows directory.

The "ro" in the Wizard entry means that the library is read-only. If you

have an application that uses its own tables that are to be written to at

any point in your program, you would specify "rw" rather than "ro." For

example, to add an application called STOCKAPP.MDB that uses its own tables

that can be modified, add the following line to the .INI file:

   stockapp.mdb=rw

The complete [Libraries] section might look like:

   [Libraries]

   wizard.mda=ro

   stockapp.mdb=rw

Given these library entries, the WIZARD.MDA library will be loaded

read-only, and the STOCKAPP.MDB library will be loaded as read-write.

After restarting Microsoft Access you would be able to open an Immediate

window in a user database and invoke sub and function procedures from

STOCKAPP.MDB, or open tables, queries, forms, or reports with DoCmd

commands. Even though you can access the code and database objects from

STOCKAPP.MDB, you cannot see them in the Database window.

Note that when a database is loaded as a library, it cannot be opened

as a user database.

Writing and Debugging Access Basic Library Code

-----------------------------------------------

When you write an Access Basic application for use as a library, you

are doing little more than writing the application in a user database

with the intention of using it as a library at a later point. Because

of this, a rule of thumb is to make sure the application works

completely before trying to use it as a library.

Although this rule of thumb is enough to successfully create many

types of library applications, there are some important pitfalls to

watch for when writing a library application, even if the application

works perfectly as a user database.

Debugging an Error in a Library Database

----------------------------------------

Microsoft Access version 1.x:

If the library database generates an error that only occurs while it

is a library, it can be very difficult to locate. An error might occur

that gives you some idea of the general area of the problem, but there

may be little or no indication of the offending line. Because you

cannot set and use breakpoints and stepping in library applications,

you should design error traps that convey meaningful messages and

indicate the location of the problem.

Another debugging tip is to place message boxes at milestone areas of the

code so that you always have an idea of which code is being executed.

Microsoft Access version 2.0:

Add the following line to the [Options] section of the MSACC20.INI file. If

the [Options] section does not exist, add it to the bottom of the file.

   DebugLibraries=True

The completed section might look like:

   [Options]

   DebugLibraries=True

This enables the code debugger to appear when a run-time error occurs in a

library module. You can also get to the library code using the View

Procedures command when you are in a module's Design view. Note that this

will tend to reduce performance because all the library code will have to

be recompiled. Remove this option when the code debugger is not necessary.

CodeDB() Versus CurrentDB()

---------------------------

Access Basic includes the CodeDB() function for opening library

databases. CodeDB() works identically to CurrentDB() if you are

running the application as a user database. However, if you are

running the application as a library, CodeDB() returns the database

object for the library database from which it was called, while

CurrentDB() returns the database object from the current open user

database. Because of this, it is easy to confuse one for the other.

Domain Functions

----------------

Domain functions should be used with caution in library modules as

they can only process user tables and not library tables.

Macros in a Library

-------------------

Microsoft Access version 1.x:

Of all the objects you can create in a Microsoft Access database,

macros are the only type of object you cannot use in a library

application. The most obvious problem this presents is that forms

require the use of macros in order to have menus. Because of this

limitation, you must make sure to use only Access Basic code for

programming.

Microsoft Access version 2.0:

In Microsoft Access 2.0, you can call a macro from a Library database.

However, due to lack of error handling, they should be avoided except

for implementing custom menus.

Keys May Be Redefined in User Database

--------------------------------------

Since the user database may contain an AutoKeys macro to redefine the

meaning of keys, you should use caution when using SendKeys in your

Library application. Use other macro actions where appropriate

and use hot-keys and {tab} rather than arrow keys when manipulating

a dialog box.

USysAddIns Table

----------------

The Microsoft Access 2.0 Add-In Manager will process entries in the

USysAddIns table of a library database to update the MSACC20.INI

[Libraries] and [Menu Add-Ins] sections. This makes installing and

uninstalling libraries more manageable for users. See Chapter 15 of the

Microsoft Access "Building Applications" manual for more information.

Additional reference words: 1.00 1.10 2.00


INF: Programming with the Object Analyzer Engine and Utilities

 Article Number: Q88620

 CREATED: 30-AUG-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

When the Database Analyzer library is loaded into memory, you not only

have access to the Database Analyzer tool, but also to all the core

commands that do the actual analysis. This article discusses these core

commands, and describes how you can use them to include data analysis in

your custom application or create your own database-object analysis tool.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools

provided with Microsoft Access. For more information on Access Basic,

please refer to the "Introduction to Programming" manual.

MORE INFORMATION

The Database Analyzer tool is included with Microsoft Access. You can use

this tool to retrieve information on the design of objects (such as

tables, queries, and forms) in your database. For more information on the

Database Analyzer tool, including instructions on how to install the

Database Analyzer, see the following file that is shipped with Microsoft

Access and is located in your ACCESS directory:

   Microsoft Access version 1.0: PSSKB.TXT (Question 23)

   Microsoft Access version 1.1: ANALYZER.TXT

Once you have loaded the Database Analyzer library into memory (by

following the instructions in the file named above), you not only have

access to the Database Analyzer tool, but also to all the core commands

that do the actual analysis.

The Database Analyzer consists of three pieces:

 - Database Analyzer

   This is the "front-end" form that you see when you start the

   Database Analyzer tool. It includes the code that gives it the

   ability to display and select objects for analysis.

 - Object Analyzer

   This is the core engine that actually creates the object tables,

   performs the analyses, and writes the resulting information to the

   object tables.

 - Object Analyzer Utilities

   This piece contains global procedures and functions that support

   some of the commands in the Object Analyzer.

Once you have specified an object to be analyzed, the Database Analyzer

calls the Object Analyzer, which performs the analysis using one of the

following core commands:

   DumpTableInfo

   DumpQueryInfo

   DumpFormOrReport

   DumpMacroInfo

   DumpModuleInfo

Assuming you have loaded the Database Analyzer library into memory, these

commands are available to you in the Immediate window. To try one of

these commands, do the following:

1. Open the sample database NWIND.MDB.

2. Open the Introduction To Programming module.

3. From the View menu, choose Immediate Window.

4. In the Immediate window, type the following command, then press

   ENTER:

      DumpTableInfo "NWIND.MDB", "MyTableInfo", "Employees", False

A new table called MyTableInfo will be created. This table will contain the

structure information for the Employees table.

The following lists the syntax for the Database Analyzer commands:

DumpTableInfo <TargetDB>, <DetailsTable>, <ObjectName>, <IsAttached>

--------------------------------------------------------------------

   Formal Parameter   Definition

   -----------------------------

   TargetDB$          The name of the database that will receive the

                      table.

   DetailsTable$      The name of the table that will receive the

                      information.

   ObjectName$        The name of the table to report on.

   IsAttached%        True if the table being reported is an

                      Attached Table; otherwise False.

DumpQueryInfo <TargetDB>, <SQLTable>, <DetailsTable>, <ObjectName>

------------------------------------------------------------------

   Formal Parameter   Definition

   -----------------------------

   TargetDB$          The name of the database that will receive

                      the table. SQLTable is the name of the table that

                      will receive the SQL representation of the

                      query.

   DetailsTable$      The name of the table that will receive the

                      detailed information of the query.

   ObjectName$        The name of the query to report on.

DumpFormOrReport <TargetDB>, <PropsTable>, <DetailsTable>,

   <ObjectName>, <IsForm>

----------------------------------------------------------

   Formal Parameter   Definition

   -----------------------------

   TargetDB$          The name of the database that will receive the

                      table.

   PropsTable$        The name of the table that will receive the

                      information on the form's or report's properties.

   DetailsTable$      The name of the table that will receive the

                      detail information about the form or report.

   ObjectName$        The name of the form or report.

   IsForm%            True if reporting on a form, False if on a

                      report.

DumpMacroInfo <TargetDB>, <DetailsTable>, <ObjectName>

------------------------------------------------------

   Formal Parameter   Definition

   -----------------------------

   TargetDB$          The name of the database that will receive the

                      table.

   DetailsTable$      The name of the table that will receive the

                      information.

   ObjectName$        The name of the macro to report on.

DumpModuleInfo <TargetDB>, <ProcsTable>, <VarsTable>, <ObjectName>

------------------------------------------------------------------

   Formal Parameter   Definition

   -----------------------------

   TargetDB$          The name of the database that will receive the

                      table.

   ProcsTable$        The name of the table that will receive the

                      listing of procedures.

   VarsTable$         The name of the table that will receive the

                      listing of variables.

   ObjectName$        The name of the module to report on.

   NOTE: DumpModuleInfo will not work if it is run from an Immediate

   window.

REFERENCES


INF: How to Force a Cascading Delete

 Article Number: Q88635

 CREATED: 30-AUG-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

The referential integrity capabilities in Microsoft Access versions 1.0

and 1.1 do not extend to performing cascading deletes. A cascading delete

removes all the records of a child table when the corresponding record in

the master table is deleted. This article describes a sample macro you

can use to perform a cascading delete when you delete a record from a

master table.

MORE INFORMATION

As an example of a cascading delete, suppose you are viewing the

Categories table in the sample database NWIND.MDB and you decide to

delete the BEVR Category ID. The Products table is related to the

Categories table with referential integrity enabled, and contains many

child records with the BEVR value. Therefore, Microsoft Access prevents

you from deleting the record in the Categories table until you delete all

the child BEVR records in the Products table. With the ability to perform

a cascading delete, all of the Products table's BEVR records would be

deleted automatically and then the BEVR Category ID would be deleted from

the Categories table.

The following example demonstrates how to set up a macro that will

perform cascading deletes:

WARNING: Following these steps will permanently remove records from the

sample database NWIND.MDB. It is a good idea to make a backup copy of

the NWIND database before following these steps, and then restore the

database when you are done following these steps.

1. Open the sample database NWIND.MDB.

2. Create the following new macro, and then save it as Cascade:

   NOTE: In the following sample macro, an underscore (_) is used as a

   line-continuation character. Remove the underscore when re-creating

   this macro.

     Condition                                            Action

     ----------------------------------------------------------------

     MsgBox("Delete record & all child records?",33)<>1   CancelEvent

     ...                                                  StopMacro

                                                          SetWarnings

                                                          SendKeys

                                                          RunSQL

     SetWarnings Action

     ------------------

     Warnings On: No

     SendKeys Action

     -------------------

     Keystrokes: {enter}

     RunSQL Action

     ---------------------------------------------------------------

     SQL Statement: DELETE * FROM [Products] WHERE [Category ID] = _

                    Forms!Categories![Category ID];

   Note the semicolon (;) at the end of the SQL statement; it is

   required.

3. Open the Categories form in Design view.

4. Set the form's OnDelete property to the Cascade macro.

5. View the form in Form view.

When you delete a Category ID in the Categories form, all the associated

records in the Products table will be deleted. To delete a record in the

Categories form, choose the Select command from the Edit menu, and then

choose Delete from the Edit menu.

NOTE: Make sure that the subform RecordsLocks property is not set to

All Records.


PRB: Irregular Characters in Attached dBASE IV Memo Field

 Article Number: Q88647

 CREATED: 30-AUG-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you have an attached dBASE IV table with a memo field, a strange

character resembling an "i" (ASCII 161) appears randomly throughout

the memo field when viewed in Microsoft Access.

CAUSE

This problem is the result of the way dBASE IV handles its memo

fields and how this translates when you view the memo field in

Microsoft Access.

When you open a memo field in dBASE IV, you are presented with an

editor that is fixed at 65 characters per line and cannot be adjusted.

In order to format your memo data so that it fits comfortably in the

memo editor, dBASE IV inserts invisible characters that act as

carriage returns. These characters become an actual part of the data

in the .DBF file. Microsoft Access does not use these characters to

format the memo data because the size of a memo control is adjustable,

so they are ignored and consequently appear in the memo control on your

form.

RESOLUTION

You can create an Access Basic procedure to remove these characters from

the memo field. The procedure should go through each record in the table

and copy the memo field, character by character, to a temporary holding

area, ignoring all instances of Chr(161). Then copy the corrected string

back into the memo field.

STATUS

This behavior is by design.

MORE INFORMATION

dBASE IV is manufactured by a vendor independent of Microsoft; we make no

warranty, implied or otherwise, regarding this product's performance or

reliability.

Additional reference words: 1.00 1.10 2.00


INF: How to Add Items to the Help Menu

 Article Number: Q88648

 CREATED: 30-AUG-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

- Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

The Help menu items that appear at the top of the screen in Microsoft

Access can be supplemented so that your own custom menu items appear.

This can be done by creating an entry in the MSACCESS.INI file.

MORE INFORMATION

You can add your own entries to the [Menu Add-Ins] section of the

MSACCESS.INI file. You can use this feature to invoke a macro, an Access

Basic program, or an Access Basic function from a Help menu item. To add

to this section of the MSACCESS.INI file, follow these steps:

1. Close Microsoft Access if it is open.

2. From your Windows Program Manager, start Notepad.

3. In Notepad, open the file MSACCESS.INI (this file is located in

   your Windows directory).

4. Scroll to the bottom of the file, add a blank line, and type the

   following:

      [Menu Add-Ins]

5. Add any menu items that you want to appear in the Help menu below

   the line you just typed. Add lines using the following syntax:

      <menu label>=<menu action>

   Substitute the text that you want to appear in the Help menu for

   <menu label>, and the macro name, user-defined function, or Access

   Basic function that should be run for <menu action> in the example

   above.

For example, to add a Help menu item called Customer Form that runs a

macro called OpenCustForm, the [Menu Add-Ins] section of the MSACCESS.INI

file would read:

   [Menu Add-Ins]

   Customer Form=OpenCustForm

To add a Help menu item called Run Daily Update that runs a user-defined

Access Basic function called RunUpdate(), you would add the following to

the MSACCESS.INI file:

   [Menu Add-Ins]

   Run Daily Update==RunUpdate()

Note that the second equal sign (=) in the above example is required for

running user-defined or other Access Basic functions.

You can also define an underlined character in your Help menu item that

is accessible with the ALT key. To do this, place an ampersand (&) in

front of the character that should be underlined. For example, to create

a Help menu item called Show Message with the M underlined that calls the

Access Basic MsgBox() function, add the following to the MSACCESS.INI

file:

   [Menu Add-Ins]

   Show &Message==MsgBox("This is a message")

You can add multiple items to the [Menu Add-Ins] section of the

MSACCESS.INI file. The example below includes all the examples in this

article:

   [Menu Add-Ins]

   Customer Form=OpenCustForm

   Run Daily Update==RunUpdate()

   Show &Message==MsgBox("This is a message")

Once you have made these changes to the MSACCESS.INI file, save the file

and then close Notepad. When you restart Microsoft Access, the items in

the [Menu Add-Ins] section will be available from the Help menu.


INF: Opening Databases as Read-Only Causes Error Message

 Article Number: Q88649

 CREATED: 30-AUG-1992

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

You receive the error message

   Database '<databasename>' is read-only. You won't be able to save

   changes made to data or object definitions in this database"

when you open a database.

MORE INFORMATION

This error occurs if you open a database under the following three

conditions:

 - The file is read-only, whether or not its file attribute is set to

   read-only.

 - The directory in which the file resides is also read-only.

 - You are using the /Ro command line parameter.

Note that when a database is opened as read-only, an .LDB file is never

created.

The only workaround currently available is to implement security measures.

Instead of physically opening the file as read-only, open all objects in

the database as read-only. The procedures to implement database security

are outlined in:

 - Microsoft Access "User's Guide," version 1.0, chapter 25

 - Microsoft Access "User's Guide," version 2.0, chapter 14

Additional reference words: 1.00 1.10 2.00 WinIss errmsg


INF: How to Create a Password Text Box

 Article Number: Q88650

 CREATED: 30-AUG-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Some applications require password protection and should provide a

dialog box at startup which prompts the user for a password. For

security purposes, this prompt should not show the characters that the

user is typing, but should give the user some idea of how many

characters have been typed so that the user does not lose track of

what part of the password is being typed. This article describes how you

can create a password text box in Microsoft Access version 1.x.

In Microsoft Access version 2.0, you can use input masks for typing data

into a field or control. There is an input mask specifically for password

entry. For more information, search for "input masks" using the Microsoft

Access 2.0 Help menu.

MORE INFORMATION

To create a password text box:

1. Create a form and open it Design view.

2. Add a text box and select it so it has the focus.

3. In the toolbar, drop down the list of fonts located directly to the

   right of the Paint Pallette toolbar button.

4. From the list, choose 'Courier'.

5. In the toolbar, drop down the list of font sizes located directly

   to the right of the list of fonts from which you just made a

   selection.

6. From the list, choose the value 10.

7. From the palette window, click on the color White for both the

   Fill row and Text row of colors.

8. Save the form and switch to Form view.

When you type characters into the password text box, notice that they do

not appear, but the cursor is present. The Courier font assigned to the

text box makes cursor movement and position clearly identifiable so that

the user has an idea of how many characters have been typed.

Additional reference words: 1.00 1.10


INF: Practice Using Object Analyzer Commands

 Article Number: Q88651

 CREATED: 30-AUG-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article provides an example of how to use the Object Analyzer

commands discussed in the article titled "Programming with the Object

Analyzer Engine and Utilities." For more information on the commands

themselves, search on the following words here in the Microsoft

Knowledge Base:

   DumpTableInfo or DumpQueryInfo or DumpFormOrReport or

   DumpMacroInfo or DumpModuleInfo

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools

provided with Microsoft Access. For more information on Access Basic,

please refer to the "Introduction to Programming" manual.

MORE INFORMATION

As discussed in "Programming with the Object Analyzer Engine and

Utilities," you can take advantage of the Object Analyzer engine by

using the commands in the Object Analyzer module.

To get some practice using these commands, follow the steps below to

create your own Database Analyzer in the sample database NWIND.MDB:

Creating a Form

---------------

1. Create a new form called Little Analyzer.

2. Create a text box control on the form. Change the ControlName

   property to Name.

3. Create an option group control called Options on your form.

4. Add six toggle buttons to the Options option group and modify the

   properties of the toggle buttons as described below:

      Control         Option Value   Caption

      --------------------------------------

      First Button          1        Table

      Second Button         2        Query

      Third Button          3        Form

      Fourth Button         4        Report

      Fifth Button          5        Macro

      Sixth Button          6        Module

5. For the AfterUpdate property of the Options option group, specify

   the following:

       =AnalyzeIt(Name, Options)

6. Save and close the form.

Creating a Module

-----------------

1. Create a new module in NWIND.MDB.

2. Add the following function to the module:

Function AnalyzeIt (InName As String, InType As Integer)

   ' This function accepts the name of a Microsoft Access object

   ' and a number representing what type of object it is, then uses

   ' the Object Analyzer Dump commands to analyze the object.

   DoCmd Hourglass True

   Select Case InType

      Case 1

         DumpTableInfo "NWIND.MDB","@Table",InName,False

      Case 2

         DumpQueryInfo "NWIND.MDB","@QuerySQL","@Query",InName

      Case 3

         DumpFormOrReport "NWIND.MDB","@Form","@FCtrls",InName,True

      Case 4

         DumpFormOrReport "NWIND.MDB","@Report","@RCtrls",InName,False

      Case 5

         DumpMacroInfo "NWIND.MDB","@Macro",InName

      Case 6

         DumpModuleInfo "NWIND.MDB","@Procs","@Vars",InName

   End Select

   DoCmd Hourglass False

End Function

3. Save and close the module.

Combine Form and Module to Create Object Analyzer

-------------------------------------------------

1. Open the Little Analyzer form.

2. In the text box, type "Categories" (without quotation marks).

3. Choose the Tables button. You have created an Object Analyzer.

   The Object Analyzer analyzes the Categories table and creates a

   table called @Table, which contains information about the structure

   of the Categories table.

If you have the Database Analyzer library loaded, you can use these

commands to build your own object-analysis tool, or you can

incorporate these commands into your application to make it self-

documenting.


INF: How to List the Related Tables in a Database in Version

 Article Number: Q88653

 CREATED: 30-AUG-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

- Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Although you can create relationships among tables in your database, there

is no inherent command to list these relationships. Sometimes this

information can be of use, particularly when trying to find the source

table of a referential integrity violation or other such example.

This article discusses how you can use a series of queries to display

a list of tables that are related in a database.

you

relationships

Managing

MORE INFORMATION

Information on the relationships among the tables in a database can

sometimes be very helpful, particularly when trying to find the source

table of a referential integrity violation or other such example. This

information is also good for documenting your database.

Although you can create relationships among tables in your database, there

is no inherent command that will gather this information and present it in

a meaningful way. All of this information can be made available by

gathering and relating information from the system tables MSysObjects,

MSysColumns, and MSysIndexes. This article discusses how you can create a

query containing two columns. The first column, called "Primary.Name," will

contain a table name. The second column, called "Foreign.Name," will

represent the table that the Primary.Name table is related to.

Because the information will be coming from the system tables

mentioned above, you must make sure you have access rights to these

tables. MSysObjects has these rights by default, so the instructions

below indicate how you can give yourself access rights to MSysIndexes

and MSysColumns.

1. In the Database Window menu, select the View menu, then choose

   Options.

2. Change the Show System Objects setting to Yes, then choose OK.

3. From the Database Window menu, choose the Permissions command from

   the Security menu.

4. In the following dialog box, choose Table for the Object Type

   prompt, then choose MSysIndexes for the Object Name prompt.

5. In the Permissions box at the bottom of the dialog, select the

   Full Permissions box.

6. Click Assign and then choose the Close button. Repeat steps 4 and

   5 for MSysColumns.

7. From the View menu at the top of the screen, choose Options.

8. Change Show System Objects to No, then choose the OK button.

At this point, you can begin building the queries that will retrieve

the relationship information. To do this, follow the instructions

below:

 1. In the database window, choose the Query button, then choose New.

    A query design screen appears, along with a dialog asking for a

    Table/Query to add to the query. Choose Close so that the query

    design grid is blank.

 2. From the View menu, choose SQL.

 3. Delete any contents that appear in the SQL dialog box.

 4. Enter the following into the SQL window:

       SELECT DISTINCTROW

          MSysObjects.Name, MSysObjects.Id

       FROM MSysObjects

       WHERE ((MSysObjects.Type=1)

       AND (MSysObjects.Flags Is Null Or MSysObjects.Flags<>2))

       ORDER BY MSysObjects.Name;

 5. Choose the OK button. Close and save the query as "psi User

    Tables."

 6. Repeat steps 1 through 4, substituting the SQL statement in step 4

    with the following SQL statement:

       SELECT DISTINCTROW [Tables].Name AS Table,

          MSysColumns.Name AS Field,

          [Tables].Id AS [Primary Id]

       FROM [psi User Tables] AS Tables, MSysColumns, Tables

       INNER JOIN MSysColumns ON [Tables].Id = MSysColumns.ObjectId

       ORDER BY [Tables].Name, MSysColumns.PresentationOrder;

 7. Choose the OK button, then close and save the query as "psi User

    Tables Field List."

 8. Repeat steps 1 through 4, substituting the SQL statement in step 4

    with the following SQL statement:

       SELECT DISTINCTROW Primary.Name, Foreign.Name

       FROM [psi User Tables] AS Primary, MSysIndexes, [psi User Tables]

          AS Foreign, MSysIndexes AS LKeyName, LKeyName

       INNER JOIN MSysIndexes ON LKeyName.Idxid = MSysIndexes.Idxid,

          LKeyName

       INNER JOIN MSysIndexes ON LKeyName.ObjectId = MSysIndexes.ObjectId,

          Primary

       INNER JOIN MSysIndexes ON Primary.Id = MSysIndexes.ObjectId,

          Foreign INNER JOIN MSysIndexes ON Foreign.Id =

          MSysIndexes.ObjectIdReference

       WHERE ((MSysIndexes.ObjectIdReference<>0)

          AND (MSysIndexes.Operation=2)

          AND (LKeyName.Operation=0))

       ORDER BY Primary.Name, Foreign.Name;

 9. Choose the OK button. Close and save the query as "psi

    Relationships."

10. To view the Relationships table, highlight the query called "psi

    Relationships" in the database window and choose the Open button.

With this query, you can create reports or use the query in any other

way that you would normally use an Access query to make use of the

information.

Another way to display database information is to use the Database Analyzer

tool. For more inforation on this tool, see the PSSKB.TXT file, question

23, or choose the Microsoft Access Q&A icon in the Microsoft Access group

in Program Manager.

Additional reference words: 1.00 1.10


INF: Performing an SQL Bulk Action Query from Access Basic

 Article Number: Q88654

 CREATED: 30-AUG-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

- Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Access Basic does not support SQL statements to access your data without

defining a virtual table (VT) object to execute the statement. For

example, you cannot execute the following SQL command on a line by

itself, even though it would be valid in a Microsoft Access query:

   UPDATE Cust SET Cust.[Phone] = "(206) " & [Phone];

This article describes how to perform SQL bulk action queries, and

includes a subprocedure called PerfromSQLAction that you can add to your

programs. You can use this subprocedure to pass a SQL bulk action

statement to the procedure and have it executed.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools

provided with Microsoft Access. For more information on Access Basic,

please refer to the "Introduction to Programming" manual.

MORE INFORMATION

Access Basic does not support SQL statements in that you cannot execute a

SQL statement on a line by itself. The following SQL command, although a

valid Microsoft Access query, will generate a syntax error message in

Access Basic:

   UPDATE Cust SET Cust.[Phone] = "(206) " & [Phone];

Instead of including the SQL statement on a line by itself, you have to

follow steps similar to the example below to execute the SQL statement:

1. Dimension a Database and QueryDef variable as shown below:

      Dim MyDB As Database

      Dim MyQuery As QueryDef

2. Set the database variable to the current user database as shown

   below:

      Set MyDB = CurrentDB()

3. Set the QueryDef variable to use the CreateQueryDef method,

   assigning an arbitrary query name such as TempQuery and

   including the desired SQL statement. The query you create using

   this step is only for the purpose of executing the bulk action

   query and will be deleted later. An example of how to use the

   CreateQueryDef method for this purpose is shown below:

   NOTE: In the following sample code, an underscore (_) is used as a

   line-continuation character. Remove the underscore when re-creating

   this code in Access Basic.

      Set MyQuery = MyDB.CreateQueryDef("TempQuery" ,UPDATE _

         Cust SET Cust.[Phone] = "(206) " & [Phone];

4. Execute the TempQuery query you created in the previous step

   using the Execute method:

      MyQuery.Execute

5. Delete TempQuery using the DeleteQueryDef method as shown below:

      MyDB.DeleteQueryDef("TempQuery")

All of these steps, along with some error trapping, have been combined in

the PerfromSQLAction subprocedure. You can use this subprocedure to

perform bulk action queries in your Access Basic programs.

PerformSQLAction requires only the SQL command you want to execute as a

string value. For example:

   PerformSQLAction "UPDATE Cust SET Cust.[Phone] = '(206) ' & [Phone];"

Note that the SQL command is always followed by a semicolon (;).

The following is a listing of PerformSQLAction:

Sub PerformSQLAction (SQLStmt As String)

   Dim LocalDB As Database, LocalQry As QueryDef

   On Error Resume Next

   Set LocalDB = CurrentDB()

   LocalDB.DeleteQueryDef("TempQuery")

   On Error GoTo 0

   Set LocalQry = LocalDB.CreateQueryDef("TempQuery", SQLStmt)

   LocalQry.Execute

   LocalQry.Close

   LocalDB.DeleteQueryDef("TempQuery")

End Sub


INF: How Microsoft Access 1.x Uses SQL Server Connections

 Article Number: Q88655

 CREATED: 30-AUG-1992

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article describes how Microsoft Access uses connections to SQL Server

and how application developers can minimize the use of these connections.

This article assumes the you are highly knowledgeable about the low-

level interaction between applications and SQL Server.

MORE INFORMATION

The conventional application that accesses a server does it in a

simple single-tasking manner, requiring a single connection to the

server. Microsoft Access, however, is not a typical conventional server

front-end. Many of its features, including updatable views (dynasets),

joins between local and server data, execution of complex expressions

that the server may not be able to handle, and seamless transition

from one server to another, require Microsoft Access to obtain more

connections than a conventional front-end.

Although some servers, such as Microsoft SQL Server, are not stingy

giving out connections, there are other servers that place strict

limits on the number of connections an application can open. (In some

installations, SQL Server also places absolute restrictions on

connections.) When designing applications for the more restrictive

servers, it is important to understand how Microsoft Access uses

connections.

Connections are opened by Microsoft Access when it needs to execute a

query on the server (which it must do to build dynasets or static views),

obtain the data in a dynaset, or update data on the server. These

connections can be categorized into two types: connections needed to

build the working set and connections needed to service dynasets.

Both types of views available in Microsoft Access (static views and

dynasets) are built by executing a query (called a "local" query to

differentiate it from other types of queries discussed below). This

local query processes Microsoft Access and foreign ISAM data (both

locally and file server based) and remote server data, and pulls it

into a temporary table that represents the view. To build static views,

the actual data is stored in the temporary table, whereas to build

dynasets, pointers to the actual data are stored.

When server data is included in the local query, execution of the

query involves asking the server (or servers) for data, which is done

by opening connections and sending queries to the server. Each query

sent to the server requires that a connection be opened.  If more than

one query is to be sent to the server, a single connection could be

used and the queries executed serially. However, this would typically

require the user to wait for all of the server queries to complete

before any data would appear. Therefore, Microsoft Access executes the

server queries in parallel, requiring a connection for each.

The number of queries sent to a server may not be entirely obvious.

Much of the time, access to all of the remote base tables will be

combined into a single query, if all of the base tables reside on the

same server. In the worst case, each server base table referenced by

the local query will require a connection. There are several factors

that could compel Microsoft Access to split a local query into several

server queries:

 - If server data is joined to data from other sources (that is,

   local, foreign ISAM, and other servers), the Microsoft Access

   optimizer may decide that it is more efficient not to combine

   references to two tables on the same server into a single query.


PRB: Scroll Box Does Not Move Down Scroll Bar in Combo Box

 Article Number: Q88656

 CREATED: 30-AUG-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you are using a combo box on a form and the data source is an

attached table, the scroll box does not always move down the scroll

bar when you click the scroll arrow. Once you reach the bottom of the

list, the scroll box works properly; it jumps to the bottom of the

scroll bar and then moves with you as you scroll up and down the list.

CAUSE

When you click the scroll arrow to view the list, the combo box

control does not always know how many records are in its ControlSource

table or query.

When you click the scroll arrow, Microsoft Access begins to read the

data in the ControlSource table or query. In order for the scroll box

to move down the scroll bar, the combo box must know how many items

are in the list so that it can calculate the correct physical location

of the scroll box. For example, if you have 100 records in your table

and you are viewing the 50th record in the list, the scroll box should

appear halfway down the scroll bar.

Once you have scrolled to the bottom of the list, the combo box knows

the number of items included in the list. The scroll box now adjusts

itself automatically, relative to any item in the list that you

select.

RESOLUTION

This behavior is by design.

Additional reference words: 1.00 1.10 2.00 scrollbar


INF: Using Date/Time Data Type and Calculating Elapsed Time

 Article Number: Q88657

 CREATED: 30-AUG-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how Microsoft Access stores data with a Date/Time

data type, and demonstrates how to calculate elapsed time.

MORE INFORMATION

Microsoft Access uses double-precision, floating-point numbers (up to 15

decimal places) to store date/time values. Using this numbering system,

you can add, subtract, and compare date/time values as you would other

numeric values. The integer portion of the double-precision number

represents the date; the decimal portion represents the time.

The acceptable range for date information is January 1, 100 A.D.

(-657,434) through December 31, 9999 A.D. (2,958,465), where January

1, 1900 is 2. Negative numbers represent dates prior to December 30,

1899.

The acceptable range for time information is between 0:00:00 and

23:59:59, or 12:00:00 A.M. and 11:59:59 P.M., inclusive. Time values

representing 24 hours are stored internally as double-precision

fractional numbers between 0.0 and 0.99999. Below are some examples of

these fractional numbers:

   2.0 represents 1/1/1900 12:00:00 A.M.

   0.25 represents 6:00:00 A.M. (0.25 * 24 hours = 6 hours)

   33914.125 represents 11/6/1992 3:00:00 A.M. (0.125 * 24 hours = 3

   hours)

   24794.84375 represents 11/18/67 8:15:00 P.M. (0.84375 * 24 hours =

   20.25 or 20 hours and 15 minutes (.25 * 60 minutes = 15 minutes)

Using Null Values

-----------------

Microsoft Access recognizes when a portion of the data in a date/time

field is missing. For example, if you enter only a time value,

Microsoft Access does not display the false (0) date value of

12/30/1899. Calculations that include a null date/time field return a

null value.

Formatting and Storing Date/Time Values

---------------------------------------

Date/time fields can show the date, the time, or both, depending on

how you format and display the date/time field. Microsoft Access

always stores both the date and the time.

For more information on formatting, search for "Format" then "Format

Property" using the Microsoft Access Help menu.

Comparing Dates Using Functions

-------------------------------

Microsoft Access also uses double-precision, floating-point numbers to

calculate functions that contain date or time arguments. This method

can occasionally yield unexpected results.

For example, if you test the following expression in the Immediate

window of a module, the result is 0 (false), even if today's date

is 1/31/92:

   ?Now()=DateValue("1/31/92")

This function returns -1 (true) only when the current date and time

are 1/31/92 12:00:00 A.M. This occurs because the Now() function

returns the double-precision number of the current date and time. This

number may not be equal to the integer number of the date only, which

is returned by the DateValue() function.

To avoid this problem, use either of the following statements to compare

today's date with another date:

   ?Date()=DateValue("1/31/92")

   ?Int(Now())=DateValue("1/31/92")

The Int() function strips the fractional portion of the double-precision

number from the Now() function, returning only the number representing

the date.

Computing and Displaying Elapsed Time

-------------------------------------

Below are two sample functions, HoursTest() and ElapsedTest(). They

return the amount of elapsed time between two given date/time values,

using different display formats. Both functions require you to specify

time1 and time2 as parameters.

The first example, HoursTest(), displays the elapsed time in hours,

minutes, and seconds:

NOTE: In the following sample code, an underscore (_) is used as a

line-continuation character. Remove the underscore when recreating

this code in Access Basic.

   Function HoursTest()

   ' This function displays the total hours elapsed in this format:

   ' 48:57:04

      Time1 = CVDate("1/3/92 4:05:06")

      Time2 = CVDate("2/2/92 5:02:10")

      HoursTest = Format(Int(Abs(Time1 - Time2) * 24), "###:") + _

         Format(Abs(Time1 - Time2), "nn:ss")

   End Function

The HoursTest() function uses the CVDate() function to convert the

string expression to a date value. The HoursTest() function then takes

the absolute value of the difference between the two date/time values

and multiplies this new value by 24:

   Abs(Time1 - Time2) * 24

HoursTest() uses the Int() function to return only the integer portion

of the date/time value. The resulting integer is the total number of

hours elapsed:

   Int(Abs(Time1 - Time2) * 24)

The first Format() function returns the elapsed hours. The second

Format() function takes the absolute value of the difference between

the two time values and uses the "nn:ss" argument to capture only the

minutes and seconds. HoursTest() concatenates the results of two

Format() functions, as follows:

   Format(Int(Abs(Time1 - Time2) * 24), "###:") + _

          Format(Abs(Time1 - Time2), "nn:ss")

The second example, ElapsedTest(), adds the number of elapsed days to

the resulting value:

   Function ElapsedTest()

   ' This function displays the elapsed time as the total number of

   ' days, hours, minutes, and seconds. For example: 4 Days 01:04:05 Hours.

      Time1 = CVDate("1/31/92 4:01:05")

      Time2 = CVDate("2/4/92 5:05:10")

      ElapsedTime = Abs(Time1 - Time2)

      ElapsedDays = Int(ElapsedTime)

      ElapsedPartialDay = (ElapsedTime - ElapsedDays)

      ElapsedTest = ElapsedDays & " Days " & Format(ElapsedPartialDay,_

         "HH:NN:SS") & " Hours"

   End Function

The ElapsedTest() function uses a process similar to that used by

HoursTest(), but displays its result in a different format.

Microsoft Excel Dates vs. Microsoft Access Dates

------------------------------------------------

Microsoft Excel also uses double-precision numbers to store date/time

values, but Microsoft Excel values are limited to the range 1/1/1900

through 12/31/2078. The Microsoft Excel date and time system begins

with the double-precision number 1.0, which represents 1/1/1900

00:00:00 (12:00:00 A.M.).

Originally, Microsoft Access supported the same date range as

Microsoft Excel (1900-2078). But when Microsoft extended the date

range in Microsoft Access to 100-9999, the 1900 leap year anomaly was

corrected. This means that for dates between 1/1/1900 and 2/29/1900,

the internal integer portion of the date values for Microsoft Access

and Microsoft Excel differ by one.

Additional reference words: 1.00 1.10 2.00 date/time fractional


INF: Using TransferDatabase Macro to Attach to SQL Server Data

 Article Number: Q88658

 CREATED: 30-AUG-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article describes how to use the TransferDatabase macro action to

attach data in backend SQL tables.

MORE INFORMATION

You can use the TransferDatabase macro action to import from, export to,

or attach an external data source. This article describes how to attach

data in a SQL Server table.

When you create a macro that uses the TransferDatabase macro action, you

need to supply the following macro-specific arguments:

Transfer Type:  For this type of transfer, choose ATTACH.

Database Type:  This is the type of the external database source that

                is being attached. In this case, select <SQL DATABASE>.

Database Name:  With SQL Server, a connect string supplies the

                necessary information.

Object Type:    The type of object being attached in this case is a

                TABLE.

Source:         The name of the table in the SQL Server table goes

                here.

Destination:    This is the name of the table as it is seen in the

                Microsoft Access Database window.

Structure Only: Depends on whether the data should be attached, also.

                In most cases (as well as this case) this should be

                NO.

The connect string (Database Name) is a string of items or parameters

that defines the remote data source and the user's identification. The

connect string includes the following items:

DATA SOURCE NAME (DSN):        The name of the SQL Server computer.

DATABASE QUALIFIER (DATABASE): The name of the SQL Server database.

WORKSTATION ID (WSID):         The name of the workstation that is making

                               the connection (optional).

USER ID (UID):                 The login id*.

PASSWORD (PWD):                The user password*.

* This item is optional within the connect string. If it is not present,

the system will prompt the user with a dialog box to enter this

information at the time the macro is executed. Note that password

information is case sensitive in SQL Server.

The following is a sample connect string to SQL Server. Note that it

begins with "ODBC", which tells the system that it will use the ODBC

driver (as opposed to an installable ISAM driver):

   ODBC;DSN=ServerX;Database=Pubs;WSID=wrkstn1;UID=JohnDoe;PWD=MARCH

This string would be placed in the Database Name argument of the

TransferDatabase action.


INF: How to Use the LIKE Operator in Parameter Queries

 Article Number: Q88671

 CREATED: 30-AUG-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to search for all the records that begin

with a certain letter.

MORE INFORMATION

An easy way to prompt for a character to search for is to create a

parameter query. The LIKE operator can be used with the wildcard symbol (*)

to accomplish this task.

First, create a query for the tables you want, and then place the

following in the criteria for the field:

   LIKE "|[Enter the first char to search by: ]|*"

Note that the Parameters dialog box has a display limited of 37 characters.

When you run this query you will be prompted with the message you specified

in the LIKE statement. To find records that start with a "C", type "c"

(without the quotation marks) and begin the search.

REFERENCES

==========

For more information on parameter queries, search for "parameter query"

then "Creating a Parameter Query" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


INF: How to Import Several dBASE Databases Simultaneously

 Article Number: Q88764

 CREATED: 31-AUG-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article explains how to import dBASE databases in a batch process

using Access Basic.

Many new Microsoft Access users want to immediately import data from the

systems they are currently using. The Import dialog box in Microsoft Access

allows you to import one table at a time, which usually is sufficient.

However, some users have numerous tables to import, or they may want to

import multiple tables regularly.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

Importing tables with a batch process can be done quickly using an Access

Basic procedure and a batch table. This procedure is designed for importing

only dBASE databases, but it can easily be modified to accommodate other

file formats.

The batch table lists the tables that you want to import. The Access Basic

procedure reads the table and imports each foreign table listed there. To

do this, use the following procedure:

1. Create a table called Batch Import with the following structure:

      Field name         Type   Length

      --------------------------------

      Source Directory   Text   50

      Source Database    Text   50

      Imported Name      Text   50

      Type of Table      Text   50

2. Enter information in the new Batch Import table about the tables you

   want to import. The fields in the Batch Import table should be

   filled out as follows:

    - Source Directory: This is the full path for the location of the

      foreign database file (for example, C:\DBASE).

    - Source Database: This is the name and extension of the dBASE

      database you want to import (for example, CUSTOMER.DBF).

    - Imported Name: This is the name you want the table to have once it

      is imported into Microsoft Access (for example, Customers).

    - Table Type: This can be either dBASE III or dBASE IV. Specify dBASE

      III for both dBASE III and dBASE III PLUS databases.

   For example, to import a dBASE IV database called EMPLOYEE.DBF from the

   C:\DBASE4 directory and a dBASE III database called ORDERS.DBF from the

   D:\DBASE3\DATA directory, you would fill out the fields in the Batch

   Import table as follows:

      Source Directory   Source Database  Imported Name   Table Type

      --------------------------------------------------------------

      C:\DBASE4          EMPLOYEE.DBF     Employee Table  dBASE IV

      D:\DBASE3\DATA     ORDERS.DBF       Orders Table    dBASE III

3. Create a new module, and enter the following code:

   NOTE: In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

      Sub BatchImport ()

         Dim B_DB As Database, B_TBL As Table

         Set B_DB = CurrentDB()

         Set B_TBL = B_DB.OpenTable("Batch Import")

         DoCmd Hourglass True

         B_TBL.MoveFirst

         Do Until B_TBL.EOF

            DoCmd TransferDatabase A_IMPORT, B_TBL![Type of Table],_

             B_TBL![Source Directory], A_TABLE, B_TBL![Source Database],_

             B_TBL![Imported Name], False

            B_TBL.MoveNext

         Loop

         DoCmd Hourglass False

      End Sub

4. Import the foreign databases as follows:

   a. Open a module.

   b. From the View menu, choose Immediate Window.

   c. Type the following command, and then press ENTER:

         BatchImport

The pointer will become an hourglass and remains so until all of your

databases are imported. This process may take several minutes, depending on

the sizes of the databases.

dBASE III, dBASE III PLUS, and dBASE IV are manufactured by Borland

International, Inc., a vendor independent of Microsoft; we make no

warranty, implied or otherwise, regarding the performance or reliability of

these products.

Additional reference words: 1.00 1.10 2.00


INF: How to Modify Toolbars

 Article Number: Q88907

 CREATED: 03-SEP-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Although Microsoft Access does not include any end-user features for

modifying the toolbar at the top of the screen, you can modify the

toolbar if you know how to design a form and write Access Basic code.

This article discusses where toolbars are stored, how they work, and

how you can modify them.

Notes

-----

 - Modification of the toolbar was not intentionally designed into

   Microsoft Access, so you may run into situations where your

   modifications do not work. Test your modifications on noncritical

   databases, since making these modifications is not guaranteed to work

   correctly in every instance. Modifications to toolbars are not supported

   by Microsoft.

 - This article assumes that you are familiar with Access Basic and with

   creating Microsoft Access applications using the programming tools

   provided with Microsoft Access. For more information on Access Basic,

   please refer to the "Introduction to Programming" manual.

MORE INFORMATION

The various toolbars that appear when you are using Microsoft Access

are nothing more than forms stored in a database--the same kind of

forms that you create in Microsoft Access. These forms are stored in

UTILITY.MDA, a system database file that is loaded into memory when

you start Microsoft Access.

You cannot simply start Microsoft Access and open UTILITY.MDA to

modify these forms, however. This is because UTILITY.MDA is loaded as

a library database when you are using Microsoft Access and you are not

allowed to open a library database while it is active. To work around

this, do the following:

1. Quit Microsoft Access if you have it open and make sure that no

   instances of Microsoft Access are active.

2. Choose the MS-DOS Prompt icon in Program Manager and type the

   following commands at the MS-DOS command prompt (the example below

   assumes that your Microsoft Access system files are stored in a

   directory called C:\ACCESS). Press ENTER after each command:

      CD \ACCESS

      COPY UTILITY.MDA UTILITY.NEW

3. Start Microsoft Access.

At this point, you can begin modifying the toolbars in UTILITY.NEW.

Open UTILITY.NEW as a database (a couple alerts will appear about

loading duplicate procedure names; ignore these alerts by choosing the

OK button). In the Database window, switch to Form view and note the

names of the forms. The forms in the Database window that end with the

characters "TB" are toolbar forms. At this point, you can open a

toolbar form and make a modification. After the modification is made,

you can change a setting in your MSACCESS.INI file that will force

Microsoft Access to use UTILITY.NEW instead of UTILITY.MDA as its

utility database.

It is important to note that any functionality you add to new

controls on the toolbars must be supported by Access Basic--do not use

macros, as they will not work for this purpose.

The example below illustrates how you can add a toolbar button to your

form design toolbar that will toggle the toolbox on and off:

 1. Open the form called FDTB in Design view. This is the toolbar that

    appears when you bring up a form in Design view, as you are doing

    at this point.

 2. Add a small command button to the right of the "paint palette"

    toolbar button on the form. Make sure your button does not overlap

    any other controls and that it does not alter the height of the

    form.

 3. For the button's OnPush property, specify:

       =ToggleToolBox()

 4. Save and close the form.

 5. Create a new module called NewToolBarFunctions and add the

    following sample function:

       Function ToggleToolBox ()

          DoCmd DoMenuItem 3, 2, 8

          ' The DoCmd command above invokes the forms design menu item

          ' View->Toolbox

       End Function

 6. Save and close the module, and then close the database.

 7. Quit Microsoft Access.

 8. From Program Manager, open Notepad.

 9. In NotePad, open the file MSACCESS.INI from your Windows program

    directory.

10. In MSACCESS.INI, locate the [Options] section and modify the

    UtilityDB= line to read:

       UtilityDB=C:\ACCESS\UTILITY.NEW

11. Save and close MSACCESS.INI, and then start Microsoft Access.

12. Open any database, and open any form in Design view. Note that the

    button you added appears in the toolbar. Click the button to turn

    the toolbox on and off.

In the same way you modified your form design toolbar using the steps

above, you can make other modifications to add functionality to the

other Microsoft Access toolbars.


INF: Running MS-DOS SHARE with Windows for Workgroups

 Article Number: Q88914

 CREATED: 03-SEP-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

--------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

--------------------------------------------------------------------

SUMMARY

If you are running a regular version of Microsoft Windows 3.x (not

Windows for Workgroups or Windows NT) during the installation of

Microsoft Access version 1.0 or 1.1, Setup automatically inserts the

following MS-DOS command in the AUTOEXEC.BAT file:

   <MS-DOS directory>\SHARE.EXE /L:500

If you are running Windows for Workgroups, we recommend that you not

load this SHARE command.

MORE INFORMATION

Microsoft Access versions 1.0 and 1.1

-------------------------------------

Setup automatically detects Windows for Workgroups and does not

install SHARE if Windows for Workgroups is found.

Windows for Workgroups has its own sharing mechanism (VSHARE.386),

which is loaded with Windows by a SYSTEM.INI file entry. VSHARE.386

is intended as a replacement for SHARE.EXE.

SHARE.EXE is dependent on the number of locks specified by the /L:

parameter, with a default of 20. VSHARE.386, on the other hand,

allocates the number of locks dynamically.

Because VSHARE.386 is a 386 enhanced mode virtual device driver (VxD),

it contains features that improve file sharing when running in 386

enhanced mode.  Because it was designed to work with Windows for

Workgroups, VSHARE.386 has greater usability features than SHARE.EXE,

especially regarding access control.

If SHARE.EXE is loaded and you start Windows for Workgroups in 386

enhanced mode, VSHARE.386 takes over file sharing control until you

exit Windows. If you usually run Windows for Workgroups in 386

enhanced mode, you may not need to run SHARE.EXE at all, saving you 5K

or more of conventional memory. The number of locks available is

especially important if you are using your Windows for Workgroups

machine as a network server.

Microsoft Access version 2.0

----------------------------

Microsoft Access version 2.0 will install VSHARE.386 instead of modifying

the AUTOEXEC.BAT file to load SHARE.EXE. If you are already loading

SHARE.EXE in the AUTOEXEC.BAT file, Microsoft Access will leave the line

in the AUTOEXEC.BAT file alone, but will still install VSHARE.386. When

you enter 386 enhanced mode, VSHARE.386 will take over from SHARE.EXE.

Additional reference words: 1.00 1.10 2.00 WFW vshare


INF: How to Use the GetSystemMetrics() API Call

 Article Number: Q88922

 CREATED: 03-SEP-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

In the Windows environment, various display resolutions may cause

screens to appear out of proportion. As a developer, you can obtain

the width and height of various elements of the window display using

the Windows application programming interface (API) function

GetSystemMetrics(). Incorporating this function into a Microsoft Access

application gives the developer more information for designing the user

interface.

This article describes the GetSystemMetrics() API function and discusses

a sample application that uses the function to display various object

sizes in a message box.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

MORE INFORMATION

The Windows GetSystemMetrics() API function retrieves information about

the system metrics (the width and height of various display elements

of a particular window). The GetSystemMetrics() function can also return

flags that indicate whether a mouse is present or if the meaning of

the left and right mouse buttons have been reversed. System metrics

are dependent upon the system display, and may vary from display to

display.

To use the GetSystemMetrics() functions, do the following:

1. Place the following Declare statement in the global section of the

   Access Basic Code window:

      Declare Function GetSystemMetrics% Lib "user" (ByVal nIndex%)

2. Depending on what window property you want to determine, you must

   define the correct constant to pass to the GetSystemMetrics()

   function. Below are sample declarations of the constants and their

   meaning:

     Const SM_CXSCREEN = 0        ' Width of screen

     Const SM_CYSCREEN = 1        ' Height of screen

     Const SM_CXFULLSCREEN = 16   ' Width of window client area

     Const SM_CYFULLSCREEN = 17   ' Height of window client area

     Const SM_CYMENU = 15         ' Height of menu

     Const SM_CYCAPTION = 4       ' Height of caption or title

     Const SM_CXFRAME = 32        ' Width of window frame

     Const SM_CYFRAME = 33        ' Height of window frame

     Const SM_CXHSCROLL = 21      ' Width of arrow bitmap on

                                  '  horizontal scroll bar

     Const SM_CYHSCROLL = 3       ' Height of arrow bitmap on

                                  '  horizontal scroll bar

     Const SM_CXVSCROLL = 2       ' Width of arrow bitmap on

                                  '  vertical scroll bar

     Const SM_CYVSCROLL = 20      ' Height of arrow bitmap on

                                  '  vertical scroll bar

     Const SM_CXSIZE = 30         ' Width of bitmaps in title bar

     Const SM_CYSIZE = 31         ' Height of bitmaps in title bar

     Const SM_CXCURSOR = 13       ' Width of cursor

     Const SM_CYCURSOR = 14       ' Height of cursor

     Const SM_CXBORDER = 5        ' Width of window frame that cannot

                                  '  be sized

     Const SM_CYBORDER = 6        ' Height of window frame that cannot

                                  '  be sized

     Const SM_CXDOUBLECLICK = 36  ' Width of rectangle around the

                                  '  location of the first click. The

                                  '  second click must occur in the

                                  '  same rectangular location.

     Const SM_CYDOUBLECLICK = 37  ' Height of rectangle around the

                                  '  location of the first click. The

                                  '  second click must occur in the

                                  '  same rectangular location.

     Const SM_CXDLGFRAME = 7      ' Width of dialog frame window

     Const SM_CYDLGFRAME = 8      ' Height of dialog frame window

     Const SM_CXICON = 11         ' Width of icon

     Const SM_CYICON = 12         ' Height of icon

     Const SM_CXICONSPACING = 38  ' Width of rectangles the system

                                  ' uses to position tiled icons

     Const SM_CYICONSPACING = 39  ' Height of rectangles the system

                                  ' uses to position tiled icons

     Const SM_CXMIN = 28          ' Minimum width of window

     Const SM_CYMIN = 29          ' Minimum height of window

     Const SM_CXMINTRACK = 34     ' Minimum tracking width of window

     Const SM_CYMINTRACK = 35     ' Minimum tracking height of window

     Const SM_CXHTHUMB = 10       ' Width of scroll box (thumb) on

                                  '  horizontal scroll bar

     Const SM_CYVTHUMB = 9        ' Width of scroll box (thumb) on

                                  '  vertical scroll bar

     Const SM_DBCSENABLED = 42    ' Returns a non-zero if the current

                                  '  Windows version uses double-byte

                                  '  characters, otherwise returns

                                  '  zero

     Const SM_DEBUG = 22          ' Returns non-zero if the Windows

                                  '  version is a debugging version

     Const SM_MENUDROPALIGNMENT = 40

                                  ' Alignment of popup menus. If zero,

                                  '  left side is aligned with

                                  '  corresponding left side of menu-

                                  '  bar item. If non-zero, left side

                                  '  is aligned with right side of

                                  '  corresponding menu bar item

     Const SM_MOUSEPRESENT = 19   ' Non-zero if mouse hardware is

                                  '  installed

     Const SM_PENWINDOWS = 41     ' Handle of Pen Windows dynamic link

                                  '  library if Pen Windows is

                                  '  installed

     Const SM_SWAPBUTTON = 23     ' Non-zero if the left and right

                                  ' mouse buttons are swapped

The following sample call will return the height of a form's caption

bar:

   HeightY% = GetSystemMetrics(SM_CYCAPTION)

Additional reference words: 1.00 1.10 2.00


INF: How to Make the Immediate Window Available at All Times

 Article Number: Q88925

 CREATED: 03-SEP-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The Immediate window is helpful for debugging Access Basic code in

that you can try out an expression to see if it returns the expected

value, or any value at all. The Immediate window can also be helpful for

debugging macros, learning how to use expressions, and more. However,

the Immediate window is only available when a module window is selected.

This article describes how you can make the Immediate window available

at all times.

MORE INFORMATION

You can type an expression in the Immediate window and see the results

of that expression, without having to write and run an Access Basic

procedure. To run an expression in the Immediate window, use the Acess

Basic "?" command, as demonstrated below:

   ? 2 + 2

When you type this statement in the Immediate window and press ENTER,

Microsoft Access displays the number 4 just below the expression.

Another example of using the Immediate window is to set the value of a

variable or to test for the value of a variable. For example, set the

value of a variable and then test for the value of the variable with the

following:

   MyVar = 2

   ? MyVar

The "?" statement returns the number 2 since that is the value you

assigned to the variable MyVar.

The Immediate window is helpful for debugging Access Basic code, because

you can suspend execution of the procedure and set the values of variables

in the procedure to see what kind of result you would get with different

values. You can also use the Immediate window to suspend a procedure and

check for the value of a variable or expression to see if it is calculating

as you expect it to.

In the same way that an Immediate window can be helpful for debugging

code, it can also be helpful for other tasks, such as:

 - Trying out a form expression such as Forms!MyForm!MyControl to see

   if it returns a value.

 - Trying out a query expression, such as a DSum().

 - Trying out a macro action with the DoCmd command to see if the macro

   action produces the desired results.

However,the Immediate window is only available when a module window is

selected. You can make the Immediate window available at all times by

following these steps:

1.  In the database window, choose Macro.

2.  If you already have a macro called AutoKeys, open it in design

    mode. Otherwise, choose New.

3.  If the Macro Name column does not appear in the macro sheet,

    choose Macro Names from the View menu.

4.  If the Condition column does not appear in the macro sheet,

    choose Conditions from the View menu.

5.  Add the following action and its corresponding property:

    Macro name    Condition                                 Action

    ------------------------------------------------------------------

    ^I                                                      SendKeys

                                                            DoMenuItem

                                                            SendKeys

                  MsgBox ("IW already on the screen?")=7    DoMenuItem

    SendKeys Action Parameters

    --------------------------

    KeyStrokes: {F11}

    Wait:       Yes

    DoMenuItem Action Parameters

    --------------------------

    Menu Bar:  Database

    Menu Name: View

    Command:   Modules

    SendKeys Action Parameters

    --------------------------

    KeyStrokes: %N

    Wait:       Yes

    DoMenuItem Action Parameters

    --------------------------

    Menu Bar:  Module

    Menu Name: View

    Command:   Immediate Window

6. Save and then close the macro. If the macro is not already called

   AutoKeys, save it with that name.

From this point on, you can press CTRL+I to activate the Immediate

window. Follow these steps for an example of how this works:

1. Open any form in design mode.

2. Press CTRL+I.

   After some screen activity, a prompt appears asking if the

   Immediate window is already on the screen. If you do not see the

   Immediate window on the screen, choose No. Doing so causes

   the macro to execute one extra step that would otherwise not be

   necessary.

   Note that a small module window appears at the upper right-hand side

   of the screen.

   The Immediate window is now available to use.

3. Click once on the form design window or on the Database window.

   The Immediate window disappears.

4. Click once on the module window mentioned in step 2.

   The Immediate window reappears.

You should only need to use CTRL+I once to make the Immediate window

and the shrunken module window appear. Every subsequent request for the

Immediate window can be made by clicking once on the module window. If

the module window is closed, press CTRL+I to bring up the Immediate

window again.

Additional reference words: 1.00 1.10 2.00


INF: Cannot Group By Memo or OLE Object Fields in Query

 Article Number: Q88926

 CREATED: 03-SEP-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

If you attempt to create a select, update, or append query that groups

by a Memo field or OLE object, you receive the following error

message:

   Can't group on Memo or OLE object (<clause>).

Microsoft Access cannot group by a Memo field or OLE object in a

query. Also, the GROUP BY clause of a SQL statement cannot include

Memo or OLE object fields.

To include a Memo or OLE object field in a Totals query, drag the

field to the QBE grid and select the aggregate function First or Last

in the Total row for that field.

MORE INFORMATION

You can group by the first <n> characters in a Memo field by using an

expression. To group by the first 25 characters in a Memo field called

Description, use the following steps:

1. Enter the following expression in the QBE grid:

      Expr:Left([Description],25)

2. Choose the Totals button on the toolbar.

3. In the Total row, select Group By.

4. Switch to Datasheet view. Note that "Expr" is the column header.

Additional reference words: 1.00 1.10 2.00 errmsg


INF: Sorting/Grouping a Query Using a Portion of Field's Value

 Article Number: Q88927

 CREATED: 03-SEP-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

You can sort or group a query using only a portion of a field's value.

For example, in the sample database NWIND.MDB, you can create a query

based on the Employees table that uses the Mid() function to sort by

six characters, beginning with the fourth character in the Last Name

field. You can use the Left() and Right() functions to return the

first and last characters of a string argument.

MORE INFORMATION

The following procedure explains how to use the Mid() function to sort

data using only a portion of a field's value:

1. Enter the following in the Field row in the first column of the

   query grid:

      Sort String:Mid([Last Name],4,6)

2. Select the Sort cell in the Last Name column and choose Ascending

   or Descending.

3. Choose the Totals button on the toolbar. Group By now appears in

   the Totals row of the query grid.

4. Switch to Datasheet view. "Sort String" appears as the name of the

   column, but you can change this header to any other name.

   Note that the employee records are sorted by the fourth letters of

   the employees' last names.

This technique is useful if a field contains values with a set number

of leading or trailing characters that are insignificant to your

sorting task. An example of this is a part number field called PartNo

that contains the following values:

   PartNo

   ------

   A-453-34567

   A-123-45675

   B-234-75658

   B-645-65759 and so forth

To sort these part numbers by the third through fifth characters only,

use the following expression:

   Expr:MID([PartNo]),3,3)

REFERENCES

==========

For more information on string functions and related functions, search

for "String," "Left," "Right," and "Len" using the Help menu.

Additional reference words: 1.00 1.10 2.00 String Function


INF: Sample Function to Generate a Random Temporary File Name

 Article Number: Q88929

 CREATED: 03-SEP-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article demonstrates how to use a sample function to generate a

random file name that can be used for a temporary file.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic," in version 2.0.

MORE INFORMATION

Sometimes it is necessary for an application to create a file that is

used temporarily, then deleted. The name of temporary files are

important because you do not want your application to inadvertently

overwrite an existing file.

In such cases, you can create and use the user-defined function called

MakeTempFileName(). This function accepts a file extension and returns a

string representing a non-existent, random filename with the file extension

you specified. The filename includes a path to your Windows TEMP directory

so that the temporary file is placed in the same directory Windows uses to

write its temporary files. This is handy for those who perform periodic

maintenance on their hard drive and delete any leftover temporary files in

the Windows TEMP directory.

You can create the sample function MakeTempFileName() by entering the

following in a module:

   Function MakeTempFileName (Extension As String) As String

      On Error Resume Next

      IsFile% = False

      FHandle% = FreeFile

      Do

         WinTemp$ = Environ("TEMP") & "\"

         For Cntr% = 1 To 8

         WinTemp$ = WinTemp$ & Mid(LTrim(Str(CInt(Rnd * 10))), 1, 1)

         Next

         TF$ = Trim(WinTemp$) & "." & Extension

         Open TF$ For Input As #FHandle%

      Loop While Err > 0

      Close #FHandle%

      MakeTempFileName = TF$

   End Function

To test the function, type the following in the Immediate window. The

MakeTempFileName() function will return a name that is used as a text

file. The text file will fill with some text, and then be deleted:

   TempFileName$ = MakeTempFileName("TMP")

   Open TempFileName$ For Output As #1

   Print #1, "This is a line of text"

   Close #1

   Kill TempFileName$

Additional reference words: 1.00 1.10 2.00


INF: How to Dim (Gray) Menu Items with Access Basic

 Article Number: Q88940

 CREATED: 03-SEP-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Access Basic does not have a command that allows you to dim (make

unavailable) a menu item. There are also no properties associated with

a form that enable you to set this menu characteristic.

To change such characteristics of a menu item, you can use Windows

application programming interface (API) functions.

NOTE: This will only work for custom menus created with macros. It

will not work for the default Microsoft Access menus. This technique

will also not work for custom menu items created with the DoMenuItem

action. For example, if you add a command to the menu with the

DoMenuItem action and specify the PrintPreview arguments for the

action, Microsoft Access overrides any API function that you write to

check or gray this menu command.

MORE INFORMATION

The following Windows API function is used to dim a menu item:

EnableMenuItem% (hMenu%, wIDEnableItem%, wEnable%)

--------------------------------------------------

This function enables, disables, or grays a menu item.

   hMenu%         Specifies the menu.

   wIDEnableItem% Specifies the menu item to be checked. The

                  wIDEnableItem% parameter can specify pop-up menu

                  items as well as menu items.

   wEnable%       Specifies the action to take. It can be a

                  combination of MF_DISABLED, MF_ENABLED, and

                  MF_GRAYED. These values can be combined by using

                  the bitwise 'OR' operator.

   Return Value   The return value specifies the previous state of the

                  menu item. The return value is -1 if the menu item

                  does not exist.

Example

-------

The following example designs a menu that dims a menu item:

1. Create a new macro. After adding the following actions and their

   associated properties, save the macro and name it "Menu

   Manipulation Macro." To display the "Macro Name" column, choose the

   Macro Names command from the View menu.

    Macro Name             Action        Function Name

    ----------------------------------------------------------

    GrayItem               RunCode       Gray_Menu_Item(0,0)

    UnGray                 RunCode       UnGray_Menu_Item(0,0)

   When determining the position of a menu command, separator bars

   count as commands. For example, to get to the Import menu

   command on the File menu in the Database window, use the arguments

   0 (for the File menu) and 7 (for the Import command). Positions 3

   and 6 correspond to the separator bars on the File menu.

2. Create a new macro. After adding the action below and its

   associated property, save the macro as "Custom Demo Menu."

   Macro Name             Action        Function Name

   --------------------------------------------------

   Top Level Menu         AddMenu

   [Top Level Menu].AddMenu Action Arguments

   ------------------------------------------

   Menu Name          &Gray

   Menu Macro Name    Menu Manipulation Macro

3. Create a new blank form and display the Properties window of the

   form by choosing the Properties command from the View menu.

4. Set the OnMenu property to "Custom Demo Menu."

5. From the File menu, choose Close to close the form. Save the form

   as "Menu Manipulation Form."

6. Create a new module from the Database window. Within the new

   module, enter the Access Basic code listed further below. Save the

   module as "Menu Manipulation Code."

7. From the Database window, select the Menu Manipulation form and

   then choose the Open button to display the form in Form view. The

   normal Microsoft Access menu disappears and is replaced by the

   custom menu you created in the previous steps.

8. There are two options on the menu. Choose the GrayItem command and

   the command is dimmed (grayed). Choosing the UnGray command

   makes the GrayItem menu command available.

   NOTE: In the following sample code, an underscore _ is used as a

   line continuation character. Remove the underscore when re-creating

   this code in Access Basic.

'********************************************************************

'Declarations section of the module.

'********************************************************************

Option Explicit

Declare Function FindWindow% Lib "user" (ByVal lpClassName_

                    As Any, ByVal lpCaption As Any)

Declare Function GetMenu% Lib "user" (ByVal hWnd%)

Declare Function GetSubMenu% Lib "user" (ByVal hSubMenu%,_

                    ByVal nPos%)

Declare Function EnableMenuItem% Lib "user" (ByVal hMenu%,_

                    ByVal wItem%, ByVal wEnable%)

Declare Function IsZoomed% Lib "User" (ByVal hWnd%)

Const MF_BYPOSITION = &H400

Const MF_GRAYED = &H1

Const MyNull = 0&

Const ClassName = "OMain"

Dim ChWnd%       'handle to the Microsoft Access window.

Dim hMenuTop%    'handle to the Microsoft Access menu.

Dim hSubMenu%    'handle to the pop-up menu

Dim ItemID%      'command ID associated with menu item.

Dim ReturnVal%

'===========================================================

'This function initializes:

'

' - The window handles associated with the Microsoft Access form.

' - The handle to the menu of the specified window.

' - The menu handle of the specified pop-up menu of the window menu.

'

'The variables here are global to the database.

'===========================================================

Sub Get_Menu_Handles (TopLevel%)

   ChWnd% = FindWindow(ClassName, MyNull)

   hMenuTop% = GetMenu(ChWnd%)

   hSubMenu% = GetSubMenu(hMenuTop%, TopLevel%)

End Sub

'===========================================================

'This function dims a menu item. The text of a dimmed

'menu item appears in light gray text on the menu,

'but does not allow the user to select the item either by

'mouse or keypad. The macro action associated with the

'menu item does not execute when the user tries to select

'the menu item.

'===========================================================

Function Gray_Menu_Item (TopLevel%, SubLevel%)

   'If the form is maximized, the system menu is added to the forms

   'menu bar, so increment the actual TopLevel%

   If (IsZoomed(Screen.ActiveForm.hWnd)) Then

      TopLevel% = TopLevel% + 1

   End If

   Call Get_Menu_Handles(TopLevel%)

   Gray_Menu_Item = EnableMenuItem(hSubMenu, SubLevel%,_

                        MF_GRAYED Or MF_BYPOSITION)

End Function

'===========================================================

'This function does not ungray a menu item that also enables

'the menu item so the user can select the item and run the

'macro associated with the menu.

'===========================================================

Function UnGray_Menu_Item% (TopLevel%, SubLevel%)

   'If the form is maximized, the system menu is added to the forms

   'menu bar, so increment the actual TopLevel%

   If (IsZoomed(Screen.ActiveForm.hWnd)) Then

      TopLevel% = TopLevel% + 1

   End If

   Call Get_Menu_Handles(TopLevel%)

   UnGray_Menu_Item = EnableMenuItem(hSubMenu, SubLevel%,_

                          Not MF_GRAYED And MF_BYPOSITION)

End Function

REFERENCES

==========

For more information about the structure of the Microsoft Access menu

system, query on the following words in the Microsoft Knowledge Base:

   menu and system and findwindow and getmenu and getsubmenu

Additional reference words: 1.00 1.10 2.00 grey out


INF: Deciding Between Macros and Access Basic for Programming

 Article Number: Q88999

 CREATED: 06-SEP-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Because Microsoft Access provides two forms of programming, macros and

Access Basic, you may not be sure when to use one form of programming

rather than the other. This article contains tips on how to choose

between macro programming and Access Basic programming.

MORE INFORMATION

Microsoft Access has a very effective user interface that is powerful

enough to accommodate most needs. However, like many other database

products, Microsoft Access also provides the user with the ability to

develop his or her own way to manipulate the power of the product.

One distinct advantage of Microsoft Access over other products is that

the user has a choice of two levels of programming: macros and Access

Basic. These two programming languages are designed to complement each

other.

As a rule, you should write your applications using macros and then

supplement the application with SUB and FUNCTION procedures when you

encounter a programming situation that a macro cannot easily

accommodate.

AccessWizards are an example of a program that is beyond the

capability of macro programming. AccessWizards require functionality

that cannot be duplicated by a series of macro actions. However, resorting

to Access Basic should not be a common occurrence for most mainstream

database applications.

Knowing when to use Access Basic modules instead of macros is easier when

you understand how Microsoft Access works. If you understand and are

familiar with Microsoft Access, you will find that it is easier to

determine when modules are required to accomplish a specific task.

New users of Microsoft Access will likely be surprised at the ease, power,

and versatility that Microsoft Access macros can provide.

Additional reference words: 1.00 1.10 2.00


PRB: Arrange Icons Does Not Work on More Than 40 Windows

 Article Number: Q89546

 CREATED: 24-SEP-1992

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you have more than 40 windows open in Microsoft Access, the Arrange

Icons commands on the Windows menu does not work.

CAUSE

The functionality of this command is provided by Microsoft Windows.

Windows allocates memory to do the arrange function, but if you have

enough windows open, Windows sometimes fails when you try to arrange

the icons.

RESOLUTION

Trying the command several times may make it work. If that does not work,

close some of your windows and try the command again.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open and minimize 40 document windows.

2. Move the icons around a bit.

3. From the Windows menu, choose Arrange Icons.

Note that the icons do not get arranged.

Additional reference words: 1.00 1.10 WinIss


PRB: Floating Objects Can Cause Unusual Effects

 Article Number: Q89548

 CREATED: 24-SEP-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Floating objects such as the toolbox, the Properties window, and the

Immediate window can cause unusual effects in Microsoft Access. Objects can

obscure underlying data from view, an underlying object can be obscured

from view even if it has the focus, or is selected, and the drop-down menu

for the object's corresponding option on the menu bar can appear separated

from the object.

CAUSE

These effects are caused by the different Windows style properties

of the windows.

RESOLUTION

To minimize the impact of this behavior, keep the floating objects

from overlaying your work area by moving or closing them when

not needed.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

Menu Not Connected to the Option on the Menu Bar:

1. Open a form in Design view.

2. Display the color palette by choosing the palette button or by

   choosing Palette from the View menu.

3. Position the palette so it partially obscures a choice on the menu

   bar.

4. Choose the menu by clicking on it or by using the appropriate

   keystroke combination.

5. The drop-down menu related to that menu bar choice should then be

   displayed. At this time, the top level menu item will not overlap the

   palette, but the popup menu will overlap, giving a disjoint look.

Immediate Window Obscures Code During Replace Operation:

1. Open a module in Design view.

2. Display the Immediate window by choosing Immediate Window from the

   View menu.

3. Position the Immediate window so it obscures a section of code in

   the Module window.

4. Start a replace operation that would attempt to replace a piece of

   code in the section of code which is obscured by the Immediate window.

   To do this choose Replace from the Edit menu, enter the information to

   find and replace, and choose Verify.

5. When Microsoft Access finds the information obscured by the

   Immediate window, the dialog box that asks you to verify that you

   want to change the information is displayed, but you cannot see the

   code.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, page 195

Microsoft Access "Introduction to Programming," version 1.0, pages

2-3 and 9-10

Additional reference words: 1.00 1.10 2.00 checkpage


PRB: Table Design Does Not Check Validity of Default Value

 Article Number: Q89549

 CREATED: 24-SEP-1992

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The default value in a field is not checked to see that it is a valid entry

for that field. For example, if the default value for a numeric field is

100, and the validation rule for that field states that values in the field

must be greater than 1000, the default value of 100 will be accepted even

though it violates the field's validation rule.

If you add a new record and tab or move past the field containing the

default value, the validation rule for the field will not be applied.

However, if you make any change to the default value, the validation rule

will be correctly applied to the field.

CAUSE

This behavior is by design.

REFERENCES

==========

For more information on validation rules, search for "ValidationRule" using

the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


PRB: Reserved Words Do Not Capitalize in Module Window

 Article Number: Q89576

 CREATED: 27-SEP-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you type reserved words in a Module window, the words

usually format themselves once you move to another line so that

they are easier to read. For example, if you type in a Module window

the line

   dim q as querydef

the line will reformat to be:

   Dim q As QueryDef

However, not all reserved words are formatted automatically.

CAUSE

Microsoft Access capitalizes methods, such as Close and FindNext.

Properties, such as SQL, Format, RecordCount, and LastUpdated are

not capitalized.

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10 2.00


INF: Topics Supported by Microsoft Access as a DDE Server

 Article Number: Q89586

 CREATED: 27-SEP-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access supports dynamic data exchange (DDE) as both a client

(destination) and a server (source) application. This article lists the DDE

topics that Microsoft Access supports as a DDE server, and the valid DDE

items for each topic.

Notes

-----

 - In this article, an asterisk (*) indicates a feature that is not

   available in Microsoft Access version 1.0.

 - All the examples below require that you have the sample database

   NWIND.MDB open.

MORE INFORMATION

As a DDE server, Microsoft Access supports the following topics:

 - The System topic

 - The name of a database, table, or query

 - A Microsoft Access SQL statement

The System Topic

----------------

The System topic is a standard topic for all Microsoft Windows-based

DDE server applications, and returns information about the topics

supported by the application. The System topic supports the following

Microsoft Access data items:

 - SysItems: A list of items supported by the System topic in Microsoft

             Access

 - Formats:  A list of formats Microsoft Access can copy to the Clipboard

 - Status:   "Busy" or "Ready"

 - Topics:   A list of all open databases

Note that any information returned from any item used with the System topic

is tab delimited.

The following sample Microsoft Word for Windows WordBasic macro

demonstrates how to use the System topic to get information on available

topics from Microsoft Access:

   Chan = DDEInitiate("MSAccess", "System")

   Topics$ = DDERequest$(Chan, "Topics")

   DDETerminate Chan

   MsgBox Topics$, "Topics", 64

The Database Topic

------------------

The database topic is the filename of an existing database. After you

initiate a DDE conversation with the database, you can request a list of

objects in that database. This list of information is tab delimited. Note

that you cannot query the SYSTEM.MDB database using DDE.

The database topic supports the following items:

 - TableList

 - QueryList

 - FormList

 - ReportList

 - MacroList

 - ModuleList

The following sample Word for Windows WordBasic macro demonstrates how to

retrieve a list of table names in the NWIND database:

   Chan = DDEInitiate("MSAccess", "NWIND")

   TableList$ = DDERequest$(Chan, "TableList")

   DDETerminate Chan

The TABLE TableName, QUERY QueryName, and SQL SQLString Topics

--------------------------------------------------------------

The TABLE, QUERY, and SQL DDE topics are used to retrieve information

from Microsoft Access tables. The returned information is tab delimited.

The syntax for these topics is as follows:

   <DatabaseName>; TABLE <TableName>

   <DatabaseName>; QUERY <QueryName>

   <DatabaseName>; SQL <SQLString>

Description of Syntax:

<DatabaseName>   The name of the database to which the table or query

                 belongs or the SQL statement applies, followed by

                 a semicolon (;). The database name can be either the

                 base name only (for example, NWIND), or its full path

                 and .MDB extension (for example, C:\ACCESS\NWIND.MDB).

<TableName>      The name of an existing table.

<QueryName>      The name of an existing query.

<SQLString>      A valid SQL SELECT statement of up to 255 characters,

                 ending with a semicolon (;). Note that you can exchange

                 more than 255 characters by omitting the <SQLString>

                 statement and using successive DDEPoke() statements to

                 build an SQL statement. For example, the following

                 WordBasic code uses the DDEPoke() function to build an

                 SQL statement and request the results of the query:

                   Chan = DDEInitiate("MSAccess", "NWIND;SQL")

                   DDEPoke Chan, "SQLText", "SELECT * FROM Orders "

                   DDEPoke Chan, "SQLText", "WHERE [Order Amount] > 1000;"

                   Results = DDERequest$(Chan, "Data")

                   DDETerminate Chan

Note that you cannot initiate a DDE link with Microsoft Access using an

action query. Action queries, such as Append (INSERT INTO), Update

(UPDATE...SET), Delete (DELETE...FROM), and Make-table (SELECT...INTO)

perform an action on data. A Select query, which finds and returns data,

can be used as the topic of a DDE conversation.

*You can perform SQL action queries using DDE by running the RunSQL macro

action using the DDEExecute() function.

The following is a list of valid DDE items for the TABLE TableName,

QUERY QueryName, and SQL SQLString DDE topics:

   All              All data in the table, including field names.

   Data             All rows of data, without field names.

   *FieldNames      A single-row list of field names.

   FieldNames;T     Two data records, the first a list of field names,

                    and the second a list of data types. The data types

                    are:

                     0    Invalid

                     1    True/False (non-NULL)

                     2    Unsigned byte (Byte)

                     3    2-byte signed integer (Integer)

                     4    4-byte signed integer (Long)

                     5    8-byte signed integer (Currency)

                     6    4-byte single-precision floating point (Single)

                     7    8-byte double-precision floating point (Double)

                     8    Date/Time (date is integer, time is fraction)

                     9    Binary data, 255-byte maximum

                    10    ANSI text, not case sensitive, 255-byte

                          maximum (Text)

                    11    Long binary (OLE Object)

                    12    Long text (Memo)

   NextRow          The data in the next row in the table or query.

                    When you first open a channel, NextRow returns the

                    data in the first row. If the current row is the last

                    record and you execute NextRow, the request fails.

   PrevRow          The data in the previous row in the table or query.

                    If PrevRow is the first request on a new channel, the

                    data in the last row of the table or query is

                    returned. If the first record is the current row, the

                    request fails.

   FirstRow         The data in the first row of the table or query.

   LastRow          The data in the last row of the table or query.

   FieldCount       The number of fields in the table or query.

   *SQLText         An SQL statement representing the table or query.

                    For tables, this item returns an SQL statement in the

                    format "SELECT * FROM table;".

   *SQLText;<n>     An SQL statement in <n>-character chunks that

                    represents the table or query, where <n> is an

                    integer lower than 255. For example, for a query

                    represented by the SQL statement "SELECT * FROM

                    Orders;" the item "SQLText;7" would return the

                    following tab-delimited chunks:

                       SELECT

                       * FROM

                       Orders;

The following sample WordBasic macro demonstrates how to get information

from the Employees table in NWIND.MDB:

   Chan1 = DDEInitiate("MSAccess", "NWIND;TABLE Employees")

   ' Get a count of the number of Employee records.

   SQL$ = "SELECT Count([Employee ID]) AS [CountOfEmployees] "

   SQL$ = SQL$ + "FROM Employees;"

   Chan2 = DDEInitiate("MSAccess", "NWIND;SQL " + SQL$)

   EmployeeCount =  Val(DDERequest$(Chan2, "FirstRow"))

   DDETerminate Chan2

   ' Quit if there are no records.

   If EmployeeCount <> 0 Then

      Msg$ = "NWIND Employee Information:"

      Msg$ = Msg$ + "       Record Count:" + Str$(EmployeeCount)

      MsgBox Msg$

      ' Request the first row of data from the Employees table.

      Data$ = DDERequest$(Chan1, "FirstRow")

      ' Display the records.

      For i = 1 To EmployeeCount

         MsgBox Data$

         ' Get the next row of data, if not at the end.

         If i <> EmployeeCount Then

            Data$ = DDERequest$(Chan1, "NextRow")

         End If

      Next i

   End If

Executing Macros and Commands in Microsoft Access Using DDE

-----------------------------------------------------------

When you are using Microsoft Access as a DDE server, you can use the

DDEExecute() function to instruct your application to execute a

command. Microsoft Access recognizes any of the following valid

commands:

 - The name of a macro in the currently open database. A macro

   can be executed on a channel with any of the five topics described

   above.

*- Any action that you can execute in Access Basic using the DoCmd()

   statement. You cannot execute the following macro actions: AddMenu,

   MsgBox, RunApp, RunCode, SendKeys, SetValue, StopAllMacros,

   and StopMacro.

*- The OpenDatabase and CloseDatabase actions, executed only for DDE

   operations using the System topic.

Note that when you specify an action as a DDEExecute command, the action

and any arguments follow the DoCmd() syntax and must be enclosed in

brackets ([]). However, applications that support DDE do not recognize

intrinsic constants, such as A_NORMAL, in DDE operations. Therefore,

you must use the actual number as an argument. Also, string arguments

must be enclosed in quotation marks only if the string contains a

comma. Otherwise, quotation marks are not required.

The following sample macro opens the Categories form, first minimized and

then restored:

   Chan = DDEInitiate("MSACCESS", "System")

   AppActivate "Microsoft Access"

   DDEExecute Chan, "[OpenForm Categories,,,,,2]"

   DDEExecute Chan, "[OpenForm Categories]"

   DDETerminate Chan

*Using the OpenDatabase and CloseDatabase Commands

--------------------------------------------------

The following commands can be executed on a channel opened to the System

topic. These commands facilitate the remote opening and closing of

databases in Microsoft Access from the client application.

 - OpenDatabase <DatabaseName> [, Exclusive[, ReadOnly]]

 - CloseDatabase

   <DatabaseName>   A string expression that is the name of an existing

                    database. This can include the fully qualified

                    MS-DOS path.

   [Exclusive]      A Boolean value that is True (-1) if the database is to

                    be opened with exclusive (nonshared) access and False

                    (0) if the database is to be opened with shared access.

                    The default is shared access.

   [ReadOnly]       A Boolean value that is True if the database is to be

                    opened with read-only access and False if it is to be

                    opened with read/write access. The default is

                    read/write access.

The following sample WordBasic macro demonstrates how to use the

OpenDatabase actions to remotely open NWIND.MDB and then open the Employees

form:

   Chan = DDEInitiate("MSACCESS", "System")

   DDEExecute Chan, "[OpenDatabase NWIND.MDB]"

   DDEExecute Chan, "[OpenForm Employees,0,,,1,0]"

   DDETerminate Chan

REFERENCES

==========

For more information on using Microsoft Access as a DDE server, search for

"DDE" then "Using Microsoft Access As a DDE Server" using the Microsoft

Access Help menu.

For more information on using DDE with Microsoft Access, query on the

following words here in the Microsoft Knowledge Base

   dde and <the name of the other application in the conversation>

Microsoft Access "User's Guide," Chapters 9 and 13

The README.TXT file that is shipped with Microsoft Access version 1.0

Additional reference words: 1.00 1.10 2.00 checkpage


INF: Sample Function to Make ENTER Add Lines in a Text Box

 Article Number: Q89590

 CREATED: 27-SEP-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Text boxes in Microsoft Access do not support using the ENTER key to

add lines within a field. When ENTER is pressed in a text box, the next

field or control is selected. This article describes a sample function

that you can use to modify the action that results when you press ENTER so

that a line is added to the current field instead of selecting the next

field.

MORE INFORMATION

The following sample function changes the behavior of the ENTER key in

text boxes to allow adding lines instead of selecting a different field

or control. This code should be attached to the BeforeUpdate event of the

text box:

In the Declarations section of a module, enter the following:

   Option Explicit

   Declare Function GetKeyState% Lib "user.exe" (ByVal nKey%)

   Const VK_RETURN = &HD

The following is the sample function MakeEnterWork():

   Function MakeEnterWork()

      If GetKeyState(VK_RETURN) < 0 Then

         DoCmd CancelEvent

         SendKeys "^{ENTER}"

      End If

   End Function

NOTE: Some change must be made to the text box before this function

will work because Microsoft Access evaluates controls only after they

have been modified.

Additional reference words: 1.00 1.10 2.00 carriage return


INF: Error() Function Does Not Return Detailed Information

 Article Number: Q89591

 CREATED: 27-SEP-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When errors are trapped in Access Basic, Error(Err) returns a minimal

message. To receive full extended error messages, use Error or Error$. For

example, Error(Err) or Error$(Err) might return "Table not found," whereas

Error or Error$ would return the message "Table MyTable not found."

MORE INFORMATION

The following is an example of a common format for error handling in

Access Basic using MsgBox to display the error text:

   MsgBox "Error #" & Err & ": " & Error(Err)

This line would say return an error message like "Error #15: File | Not

found" if Err had trapped a "file not found" error.

To get the extended error message use:

   MsgBox "Error #" & Err & ": " & Error

Note the use of Error and not Error(Err).

Error(Err) returns a generic error message for the given error number,

whereas Error returns a specific error message.

Additional reference words: 1.00 1.10 2.00


INF: DoEvents, SendKeys May Not Be Supported in UDFs

 Article Number: Q89592

 CREATED: 27-SEP-1992

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Under certain circumstances, DoEvents and SendKeys are not supported

when called by user-defined functions (UDFs) in Access Basic.

MORE INFORMATION

DoEvents and SendKeys are not supported in UDFs in the following

situations:

 - When calculating a field in a query

 - When calculating a control on a form or report

 - From an Access Basic Fill function for a list box, combo box, or

   OLE object

The DoEvents statement will not allow messages to be processed in

these circumstances; instead, it will immediately return. Thus, any

keys sent through SendKeys statements or functions will not be

processed until all the computations listed above have been completed

and responses have been returned to the user.

Additional reference words: 1.00 1.10 2.00 UDF


PRB: Autokeys Macros with the Same Name Are Still Executed

 Article Number: Q89593

 CREATED: 27-SEP-1992

 MODIFIED: 25-JUN-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

- Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

Summary:

Under certain circumstances, DoEvents and SendKeys are not supported

when called by user-defined functions (UDFs) in Access Basic.

More Information:

DoEvents and SendKeys are not supported in UDFs in the following

situations:

 - When calculating a field in a query

 - When calculating a control on a form or report

 - From an Embedded Basic Fill function for a list box, combo box, or

   OLE object

The DoEvents statement will not allow messages to be processed in

these circumstances; instead, it will immediately return. Thus, any

keys sent through SendKeys statements or functions will not be

processed until all the computations listed above have been completed

and responses have been returned to the user.

Additional reference words: 1.00 1.10 UDF


INF: How to Display Immediate Window Without Module Window

 Article Number: Q89594

 CREATED: 27-SEP-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access does not display the Immediate window unless the

Module window is visible. This can be a problem if the user wants to

print to the Immediate window while in Datasheet view of a form. By

calling two Windows application programming interface (API) functions

from Access Basic, the Immediate window can be displayed at any time,

even without the Module window visible.

MORE INFORMATION

To display the Immediate window at any time, you need to call the

FindWindow() API function to get the handle to the Immediate window,

and then call the ShowWindow() API function to make the actual window

visible. You can attach the Access Basic function that includes these

API functions to a command button, a RunCode action in the Autokeys

macro, or add it to your toolbar.

To display the Immediate window, do the following:

1. Create a new module, or open an existing module.

2. Add the following declarations to the Global section of the module:

   Note: In the following sample code, an underscore _ is used as a

   line continuation character. Remove the underscore when re-creating

   this code in Access Basic.

   Option Explicit

   Declare Function ShowWindow% Lib "user" (ByVal hWnd%, ByVal nCmd%)

   Declare Function FindWindow% Lib "user" (ByVal lpClassName As Any,_

                                           ByVal lpWindowName As Any)

3. Add the following ShowImmediateWindow function:

   Function ShowImmediateWindow ()

      Dim IhWnd%                ' Handle to the Immediate Window.

      Dim ApiResults%           ' Returns the previous state of IW.

      Const MyNull = 0&

      Const SW_SHOW = 5         ' Internal constant to show window.

      Const ClassName = "OImmediate"    ' Internal ClassName of IW.

      IhWnd% = FindWindow(ClassName, MyNull)

      If IhWnd% = 0 Then

         MsgBox ("You need to open the IW once for this to work.")

      End If

      ApiResults% = ShowWindow(IhWnd%, SW_SHOW)

   End Function

4. Attach the code to a command button of a form.

5. When you first start Microsoft Access, the Immediate window is not

   displayed. When you open a module and display the Immediate window,

   then close it, Microsoft Access sets the window's Visible property to

   False. Calling ShowWindow resets the Visible property to True. If you

   call this function without first displaying the Immediate window at

   least once, you receive the error message because Microsoft Access has

   not created the Immediate window yet and therefore cannot return a

   window handle.

   For more information on how to display the Immediate window

   automatically from a module, query on the following words in the

   Microsoft Knowledge Base:

      immediate and window and macro

   With the information in the article referenced above, you can open

   the Immediate window with macros once, then use the code from this

   article to display the Immediate window at any time.

6. If you have registered the Immediate window with Windows by opening

   it at least once, pressing the command button of the form while in

   Datasheet view displays the Immediate window. Any Debug.Print

   statements should then be visible.

NOTE: This is unsupported code, and there may be instances when this

example does not work.

Additional reference words: 1.00 1.10 2.00 desktop iw


INF: Using Scroll Bars Does not Change Record Pointer

 Article Number: Q89595

 CREATED: 27-SEP-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

In Datasheet view, the record pointer does not change if you scroll

using the scroll bars; likewise, the record number in the VCR control

does not change. However, keyboard actions, such as pressing PAGE

DOWN, do change the record pointer and record number.

To change the record pointer after scrolling, use the mouse to select

the record that you want to make the current record. This also updates

the record number in the VCR control.

MORE INFORMATION

By using the scroll bars, you can view large amounts of information

without changing the record pointer. You can view other records by

either clicking one of the scroll bar arrows or by moving the scroll box

on the scroll bar.

In contrast, keyboard actions always remain relative to the record

pointer regardless of what records are being viewed in Datasheet view.

Additional reference words: 1.00 1.10 2.00


INF: Using Microsoft Access Macro to Quit Windows

 Article Number: Q89596

 CREATED: 27-SEP-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

It is possible to quit Microsoft Windows from within a Microsoft

Access application by using the Windows application programming interface

(API) function ExitWindows(). To do this, you must create a module

that declares the ExitWindows() function and then can call the

Microsoft Access function in a macro using the RunCode action.

MORE INFORMATION

The call to the Windows dynamic-link library (DLL) behaves in the same

way as does the Exit command from the File menu in Program Manager.

Each application must agree to be closed; for example, if you choose

Cancel when you are prompted to save a file, your exit request is also

canceled.

To create a Microsoft Access function to quit Windows, use the

following steps:

1. From the File menu, choose New and then Module.

2. In the Declarations section, type the following statements:

   NOTE: In the following sample code, an underscore (_) is used as a

   line-continuation character. Remove the underscore when re-creating

   this code in Access Basic.

      Option Explicit

      Declare Function ExitWindows% Lib "user" (ByVal dwReserved&,_

                                                ByVal wReturnCode%)

3. Create a Microsoft Access function that calls the ExitWindows()

   function, as follows:

      Function ExitNow ()

         Dim RetVal as Integer

         RetVal = ExitWindows(0, 0)

      End Function

4. Save the module.

5. From the File menu, choose New and then Macro. Add the following

   action and its properties:

      Action       Function Name

      --------------------------

      RunCode      ExitNow()

6. Save the macro.

You can now add the macro to a form and use it as you would any other

Microsoft Access macro.

Microsoft does not recommend exiting from Microsoft Access using

Windows API calls, though exiting can be safely accomplished. In some

cases, temporary files can be left in the Windows Temp directory;

however, you can safely delete the Temp files. To automatically remove

temp files each time the computer is started, add the folloing line to

the AUTOEXEC.BAT file:

   del c:\windows\temp\~*.tmp

NOTE: This line should be placed before the line that begins

"Windows...." This line assumes that c:\windows\temp is the location

of the Windows Temp directory specified by the SET TEMP statement in

the AUTOEXEC.BAT file.

REFERENCES

==========

"Programming Windows: The Microsoft Guide to Writing Applications for

Windows 3," by Charles Petzold, Microsoft Press, 1990

"Programmer's Reference Library: Microsoft Windows 3.1 Guide to

Programming Reference," Volumes 1-6, Microsoft Press, 1992

Additional reference words: 1.00 1.10 2.00 SDK


INF: How to Minimize, Maximize, and Restore Microsoft Access

 Article Number: Q89597

 CREATED: 27-SEP-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Use Microsoft Windows API calls in Microsoft Access modules to maximize,

minimize, and restore Microsoft Access. Microsoft Access does not

provide a function to perform these actions in a module or macro.

MORE INFORMATION

Once the following sample functions are defined in a module they can be

used in macros as RunCode actions. Define the functions with these steps:

1. From the File menu, choose New, then Module. In the

   Declarations section add both of the following declarations:

   NOTE: In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

      Option Explicit

      Declare Function GetActiveWindow% Lib "User" ()

      Declare Function ShowWindow% Lib "User" (ByVal hWnd%,_

                                               ByVal nCmdShow%)

2. Create the function MaximizeAccess():

      Function MaximizeAccess ()

         Dim ActiveWnd%, Maxit%

         ActiveWnd% = GetActiveWindow()

         Maxit% = ShowWindow(ActiveWnd%, 3)

      End Function

3. Create the function MinimizeAccess():

      Function MinimizeAccess ()

         Dim ActiveWnd%, Minit%

         ActiveWnd% = GetActiveWindow()

         Minit% = ShowWindow(ActiveWnd%,2)

      End Function

4. Create the function RestoreAccess():

      Function RestoreAccess ()

         Dim ActiveWnd%, Restoreit%

         ActiveWnd% = GetActiveWindow()

         Restoreit% = ShowWindow(ActiveWnd%, 1)

      End Function

5. The following sample macro action will minimize the Microsoft

   Access window:

      Action       FunctionName

      -----------------------------

      RunCode      MinimizeAccess()

REFERENCES

==========

"Microsoft Windows Software Development Kit," Microsoft Press, 1992

"Programming Windows: the Microsoft Guide to Writing Applications for

Windows 3," Charles Petzold. Microsoft Press, 1990

"Programmer's Reference Library: Microsoft Windows 3.1 Guide to

Programming Reference" Volumes 1-6, Microsoft Press, 1992

Additional reference words: 1.00 1.10 2.00 checkpage


INF: ENTER in Multiline Text Box Does Not Move to Next Line

 Article Number: Q89598

 CREATED: 27-SEP-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The insertion point in a multiline text box does not move to the next line

in the text box when you press ENTER; instead it moves to the next control

in the tab order on the form.

MORE INFORMATION

To move the insertion point to the next line of a multiline text box in

Microsoft Access version 1.x, press CTRL+ENTER. CTRL+ENTER can also be used

in Microsoft Access version 2.0, but there is another method as well.

Microsoft Access 2.0 text boxes have an EnterKeyBehavior property. The

settings available for this property are Default and New Line In Field.

Setting the EnterKeyBehavior property to New Line In Field will move the

insertion point to a new line in the text box when ENTER is pressed.

Additional reference words: 1.00 1.10 2.00


INF: END Key Behavior in Edit Boxes

 Article Number: Q89599

 CREATED: 27-SEP-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Pressing the END key in a form or table sometimes places the focus on

the last control in the tab order, while at other times it places the

cursor at the end of a string of characters in an edit box (for

example, a text box, list box, or combo box in a form, or a field in a

table).

STATUS

This behavior is by design.

MORE INFORMATION

Once text is typed into an edit box (or table field), the Microsoft

Access text editor goes from "enter" mode to "edit" mode. "Enter" mode

means that the arrow (direction) and cursor-movement keys (such as

END, HOME, and so on) will move the focus from control to control.

"Edit" mode means the arrow and cursor-movement keys affect cursor

control within that control only.

Therefore, if no characters have been typed in the box, the END key

moves the focus to the last control in the tab order. If a character

has been typed in the box, the END key will move the cursor to the end

of the character string in the edit control.

Once the "edit" mode has been invoked (pressing the function key F2),

pressing the TAB key moves the cursor to the next control and exits

"edit" mode.

Additional reference words: 1.00 1.10 2.00 textbox keys listbox combobox


INF: AutoExec Macro Runs Only When Database Is Opened

 Article Number: Q89602

 CREATED: 27-SEP-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

The AutoExec macro will not run when a previously hidden database

is unhidden or when a minimized database window is maximized again.

The AutoExec macro will run only when a database that contains an

AutoExec macro is opened. It will not run at any other time unless

it is called from Access Basic or another macro.

Additional reference words: 1.00 1.10 2.00


PRB: Close Action from Function Does Not Trigger OnClose Error

 Article Number: Q89603

 CREATED: 27-SEP-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If a form's OnClose property points to a nonexistent Access Basic function,

no error message is generated when you exit the form with a Close action

called from an Access Basic function.

RESOLUTION

Close the form with a Close action called from a macro, rather than closing

the form with a Close action called from a function.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1, and 2.0. We are researching this problem and will post new

information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Create a module with the sample function CloseMe() as follows:

      Function CloseMe()

         DoCmd Close

      End Function

2. Save the module with the default name, Module1.

3. Create a new form.

4. Set the new form's OnClose property to:

      =Bogus()

5. Place a command button on the form.

6. Set the command button's OnPush property (in Microsoft Access version

   2.0, the OnPush property is called OnClick) to:

      =CloseMe()

7. View the form in Form view.

8. From the File menu, choose Close. An error message will occur.

9. Open the form in Form view again. Click the command button to close the

   form. Note that no error message occurs, even though the same

   nonexistent function is called.

Additional reference words: 1.00 1.10 2.00 on close


PRB: New Label Controls Inherit FormWizards' Label Text Align

 Article Number: Q89604

 CREATED: 27-SEP-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

After creating a form with certain FormWizards (Single-Column and

Main/Subform), TextAlign properties of new label controls placed

on the new form will have different defaults than they do when

using the Tabular and Graph FormWizards, or when creating a new

form without using FormWizards. (Tabular and Graph FormWizard

labels, as well as labels on forms created without FormWizards,

default to General text alignment.)

CAUSE

It is a feature of Microsoft Access that controls placed on a form

created with FormWizards default to the same properties as the

Wizard-created controls.

For example, when you create a blank form (not using a FormWizard),

a label control's TextAlign property normally defaults to

General. With the Single-column and Main/Subform FormWizards,

however, label controls placed on the new form by the FormWizard

default to Right alignment. As a result, all subsequent new

labels placed on that form will also default to Right alignment.

Please bear in mind that this is only a default value, and can be

changed.

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10 2.00


INF: OLE: New Graph Object Frames are Blank

 Article Number: Q89607

 CREATED: 27-SEP-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you create an unbound graph on a form or report it will appear as a

blank object frame until you either view the form in Form view or print

or preview the report.

CAUSE

Microsoft Access does not run the query that an unbound graph is based on

until the form is viewed in Form view or the report is printed or

previewed. Until the query is run, the object frame will remain blank.

STATUS

This behavior is by design.

MORE INFORMATION

Steps To Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Click the New Form button on the toolbar.

3. In the Select A Table/Query box, select Category Sales For 1991.

4. Choose the FormWizards button.

5. Select Graph, and then choose OK.

6. Choose Next to accept the default graph.

7. Choose the ">>" button, and then choose Next.

8. Choose the Design button. Note that the object frame is blank.

9. View the form in Form view. The underlying query will run, and then

   the graph will be displayed.


INF: Tips on How to Troubleshoot Microsoft Access Macros

 Article Number: Q89610

 CREATED: 27-SEP-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article presents five methods of troubleshooting a Microsoft

Access macro. When a macro fails to perform correctly, there are

several tools that can be used to help isolate where the problem is:

 - Single Stepping - This feature steps through a macro one action at

   a time with a pause between each action. To activate single step

   mode, choose the Single Step button on the toolbar or choose

   Single Step from the Macro menu. When any macro is run, it will

   execute in single step mode until you turn this feature off or

   choose the Continue button in the Macro Single Step dialog box.

   This feature make it easy to determine if the action items are

   listed in the correct sequence. During single step mode, Microsoft

   Access displays the Macro Single Step dialog box, which displays

   the macro name, the name of the first action in the macro, and the

   arguments for this action. To continue macro execution, you can

   choose the Step, Halt, or Continue button.

 - Action Failed Dialog Box - This feature displays an error message

   caused by an invalid action. The same information displayed by the

   Single Step dialog box is displayed in this dialog box. To return

   to the Macro window and correct the problem, choose the Halt

   button.

 - MsgBox Action - Insert the MsgBox action in your macro wherever you

   want to display the value of a control. The action argument for the

   message will be the name of the control you want to check. For

   example, to display the value of an unbound control named Field1 in

   Form1, enter the expression "=Forms!Form1!Field1" (without

   quotation marks) for the message.

 - StopMacro Action - This macro action takes no arguments and will

   stop the macro. Use this action to check the results that have been

   calculated so far. Use this feature together with the Immediate

   window to display calculated values.

 - Immediate Window - This tool can be used to display any values that

   have been declared. The Immediate window is associated with module

   objects. To display the Immediate window, open an existing module,

   or create a new module, then choose Immediate window from the View

   menu. To display a value, type a question mark, then the variable

   name, and then press the ENTER key.

   For information on displaying the Immediate window without displaying

   the Module window, search on the following words in the Microsoft

   Knowledge Base:

      immediate and findwindow and showwindow

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 523-524

Additional reference words: 1.00 1.10 2.00 debugging


INF: Delete Command Available if Counter Field Selected

 Article Number: Q89617

 CREATED: 27-SEP-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

When a form is open in Form view and the first control selected is a

counter, the Delete command will be enabled on the Edit menu, even though

you cannot execute the Delete command. If you choose the Delete command

at this point, the error message

   Command not Available: Delete

may occur.

MORE INFORMATION

The Delete command in the Edit menu will be disabled after this error

message appears. One workaround for this behavior would be to create a

macro that uses the DoMenuItem command and a Select Record from the Edit

menu prior to running the macro that calls Delete from the Edit menu.


INF: Import/Export Accepts Only 24-Hour Time Format

 Article Number: Q89618

 CREATED: 27-SEP-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When importing or exporting time values, Microsoft Access works only

with 24-hour time values.

MORE INFORMATION

If you try to import a time value such as 1:00 P.M. into an existing

time column, the record will not be loaded and you will get an Import

Errors table that has a "Type Conversion Failure" on the value. To

import a time value such as 1:00 P.M., the value must be in the

24-hour format (in this case, 13:00).

To work around this behavior, import your time values into an existing

text column and use Microsoft Access Basic code to manipulate the

values into the correct data type format.

If you try to export a value such as 1:00 P.M. to an ASCII text file,

the value will be exported in the 24-hour format (13:00).

Additional reference words: 1.00 1.10 2.00 military clock


PRB: Avery 4xxx-Series Labels Do Not Work on Laser Printer

 Article Number: Q89621

 CREATED: 27-SEP-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you are using Microsoft Access ReportWizards for mailing labels, note

that the Avery labels 4xxx series are intended for dot-matrix printers, and

the 5xxx series are intended for laser printers. The dot-matrix, or

continuous, labels will print incorrectly when they are printed on a laser

printer.

CAUSE

These labels are meant for dot-matrix printers and their sizes do not match

the standard page sizes available for laser printers.

STATUS

This behavior is by design.

REFERENCES

==========

For more information on creating mailing labels for dot-matrix printers,

query on the following words here in the Microsoft Knowledge Base:

   creating and mailing and labels and "dot-matrix" and printers

Additional reference words: 1.00 1.10 2.00


INF: How to Use a Toggle Button to Hide and Display a Subform

 Article Number: Q89622

 CREATED: 27-SEP-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

You can use a toggle button to hide and show a subform. This article

describes how to use a toggle button to hide and show the Quarterly Orders

subform in the Quartely Orders form in the sample database NWIND.MDB.

MORE INFORMATION

The following steps demonstrate how to use a toggle button to hide and show

a form:

1. Open the NWIND.MDB database.

2. Create the following new macro, and then save it as Toggle Macro:

       Action: SetValue

       Arguments:

          Item: [Quarterly Orders Subform].Visible

          Expression: Not [Quarterly Orders Subform].Visible

3. Open the Quarterly Orders form in Design view.

4. Set the form's DefaultEditing property to Allow Edits.

5. Add a toggle button to any open area on the form.

6. Set the toggle button's properties as follows:

      Caption: Toggle Subform

      After Update: Toggle Macro

      Width: 1 in

7. View the form in Form view. When you choose the toggle button, the

   Quarterly Orders subform will be hidden or shown.

Additional reference words: 1.00 1.10 2.00 togglebutton checkpage


INF: Cut, Copy, Paste for Immediate Window and SQL Window

 Article Number: Q89680

 CREATED: 28-SEP-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

In the Immediate window and in the SQL View window, you do not have

access to the Cut, Copy, or Paste menu items from the Edit menu.

MORE INFORMATION

Use the following key combinations for cutting, copying, and pasting:

   Cut     SHIFT+DEL

   Copy    CTRL+INS

   Paste   SHIFT+INS

This will work for Windows 3.0 and 3.1. You could also use the

following key combinations for Windows 3.1:

   Cut     CTRL+X

   Copy    CTRL+C

   Paste   CTRL+V

Note that in Microsoft Access 2.0, you do have access to the Cut and Copy

commands.

Additional reference words: 1.00 1.10 2.00


INF: Obtain Name of Current User Database Using Access Basic

 Article Number: Q89681

 CREATED: 28-SEP-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access version 1.x does not have a built-in way to determine the

name of the database that the user currently has open. This article lists a

sample Access Basic function you can use in Microsoft Access 1.x to find

the name of the database.

In Microsoft Access version 2.0, you can find the name of the database

using data access objects (DAO). With DAO, you can use the Name property of

the DBEngine object to find the path and name of the currently open

database. For more information on the DBEngine object, search for

"DBEngine" then "DBEngine Object" using the Microsoft Access 2.0 Help menu.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

MORE INFORMATION

Although you can obtain the object variable of the current user

database using the CurrentDB() function, you are unable to obtain the

text representation of the database name. The example provided shows

how a user-defined function called GetUserDBName() obtains a text

representation of the user database name.

The GetUserDBName() function returns the name of the database with no

path or extension. You must add your own path or extension string to

the result of the GetUserDBName() function when necessary.

NOTE: The code to determine the current database does not work with

run-time versions of Microsoft Access (MSARN110.EXE).

1. Enter the sample code listed below into a module.

2. From the Immediate window of the module, type the following, and then

   press ENTER:

      ?GetDBName()

The name of the database will be returned.

Sample Module Code

------------------

Notes:

 - In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

 - You may have some Microsoft Windows API functions defined in an existing

   Microsoft Access library; therefore, your declarations may be

   duplicates. If you receive a duplicate procedure name error message,

   remove or comment out the declarations statement in your code.

Option Compare Database   'Use database order for string comparisons

Option Explicit

Declare Function GetWindow% Lib "USER" Alias "GetWindow" _

                 (ByVal hwnd%, ByVal Relationship%)

Declare Function GetClassName% Lib "USER" Alias "GetClassName" _

                 (ByVal hwnd%, ByVal ClassName$, ByVal Size%)

Declare Function GetWindowText% Lib "User" Alias "GetWindowText" _

                 (ByVal hwnd%, ByVal StringText$, ByVal wInt%)

Declare Function GetActiveWindow% Lib "USER" Alias _

                 "GetActiveWindow" ()

Declare Function GetParent% Lib "USER" Alias "GetParent" (ByVal hwnd%)

Const GW_HWNDNEXT = 2

Const GW_CHILD = 5

Const AccessDBC = "ODb"

Const AccessMDICLIENT = "MDIClient"

Const ACCESSMain = "OMain"

Function GetDBName ()

   Dim hwnd As Integer

   Dim ClassName As String, ClassLen As Integer

   Dim Caption As String, CaptionLen As Integer

   Dim Start As Integer, fMDIClient As Integer

   Dim RetVal

   '

   ' Get the handle to the Access window

   '

   hwnd = GetActiveWindow()

   ClassName = Space(127)

   ClassLen = GetClassName(hwnd, ClassName, Len(ClassName))

   While ((Left$(ClassName$, ClassLen) <> "OMain"))

      hwnd = GetParent(hwnd)

      ClassLen = GetClassName(hwnd, ClassName, Len(ClassName))

   Wend

   '

   ' Traverse the children looking for the 'MDIClient' child

   '

   hwnd = GetWindow(hwnd, GW_CHILD)

   Do While hwnd And Not fMDIClient

      ClassLen = GetClassName(hwnd, ClassName, Len(ClassName))

      If Left$(ClassName, ClassLen) = "MDIClient" Then

         fMDIClient = True

      Else

         hwnd = GetWindow(hwnd, GW_HWNDNEXT)

      End If

   Loop

   '

   ' Traverse children until we find the Database Window 'ODb' child

   ' .. which has a title of "Database: <app name>"

   '

   hwnd = GetWindow(hwnd, GW_CHILD)

   Do While hwnd

      ClassLen = GetClassName(hwnd, ClassName, Len(ClassName))

         ClassName = Mid$(ClassName, 1, ClassLen)

         If Left$(ClassName, ClassLen) = "ODb" Then

            Caption = Space$(127)

            RetVal = GetWindowText(hwnd, Caption, Len(Caption))

            Start = InStr(Caption, ":") + 2

            GetDBName = Mid$(Caption, Start)

            Exit Function

         End If

         hwnd = GetWindow(hwnd, GW_HWNDNEXT)

   Loop

   GetDBName = "Not Found"

End Function

Additional reference words: 1.00 1.10 2.00 DDE dbname


PRB: In Extend Mode, Text to Right of Indicator Is Selected

 Article Number: Q89683

 CREATED: 28-SEP-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you try to select any text in Microsoft Access (for example, data

in text boxes), all the text to the right of the indicator is also

selected, even if you are not holding down the left mouse button.

CAUSE

This occurs because Microsoft Access has been set to Extend mode,

indicated by the letters "EXT" on the status bar. You can turn on

Extend mode by pressing the F8 key.

Extend mode allows you to select large blocks of text without holding

down the right mouse button and is a feature of Microsoft Access and

other desktop applications, such as Microsoft Excel and Microsoft

Word for Windows.

RESOLUTION

Press the ESC key to turn off Extend mode.

REFERENCES

==========

For more information about Extend mode, search for "Extend mode" then

"Microsoft Access Window" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 UI


PRB: Compile All Command is Enabled After Saving a Module

 Article Number: Q89684

 CREATED: 28-SEP-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article explains why the Compile All command (in Microsoft Access

version 1.x) or the Compile Loaded Modules command (in Microsoft Access

version 2.0) is enabled after saving a module.

MORE INFORMATION

After you compile a module by choosing Compile All or Compile Loaded

Modules from the Run menu, the Compile All or Compile Loaded Modules

command is grayed out. This is expected since you do not need to recompile

a module until you make a change to it.

However, if you save the module by choosing Save from the File menu, the

Compile All or Compile Loaded Modules command is no longer grayed out even

though you have not made any changes to the module.

Modules are always saved in an uncompiled state. When you save the

module, some of the program code in memory actually is "de-compiled"

for internal requirements for saving the module. Since there may be

uncompiled code in memory, the command is enabled again.

Note that this does not affect startup performance.

REFERENCES

==========

For more information, query on the following words in the Microsoft

Knowledge Base:

   compile and parser

Additional reference words: 1.00 1.10 2.00


INF: Flexible Formatting of Phone Numbers

 Article Number: Q89685

 CREATED: 28-SEP-1992

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

This article describes sample functions that you can use to

determine the

format of a field or control.

MORE INFORMATION

This article assumes that you are familiar with Access Basic

and with

creating Microsoft Access applications using the programming

tools provided

with Microsoft Access. For more information on Access Basic,

please refer

to the "Introduction to Programming" manual.

This example demonstrates a sample function to take the

phone number value

entered by the user and determine if an area code was

entered. If not, it

will not display the parentheses.

NOTE:  This example does not take into account phone

extensions or international numbers.

By creating two functions, intelligent formatting is

possible.

NOTE: In the following sample code, an underscore (_) is

used as a line-

continuation character. Remove the underscore when re-

creating this code in

Access Basic.

'**********************************************************

   'Declarations section of the module

'**********************************************************

      Option Explicit

'==========================================================

   'The following function is designed for use in the

AfterUpdate

   'property of a Form Control.

   '   AfterUpdate: =Format_Phone([<control name>])

'==========================================================

     Function Format_Phone (PhoneNumber As Control)

     '* Exit the function if there is no information passed

     If IsNull(PhoneNumber) Then

        Exit Function

     End If

     '* Need to strip out unwanted characters leaving only

numbers

     PhoneNumber = SStrip(PhoneNumber, "-")

     PhoneNumber = SStrip(PhoneNumber, " ")

     PhoneNumber = SStrip(PhoneNumber, ")")

     PhoneNumber = SStrip(PhoneNumber, "(")

     '* Reformat the character string

     Select Case Len(PhoneNumber)

        Case 7

         Screen.ActiveControl = Format(PhoneNumber, "@@@-

@@@@")

        Case 10

         Screen.ActiveControl = Format(PhoneNumber, "(@@@)

@@@-@@@@")

        Case 11

         'Note that this should be on one line.

        Screen.ActiveControl = Format(PhoneNumber, "@ (@@@)

@@@-@@@@")

        Case Else

          MsgBox "This is not a valid phone number."

          Screen.ActiveControl = PhoneNumber

      End Select

  End Function

  Function SStrip (InWord, StripStr)

   Do While InStr(InWord, StripStr)

      'Note that this should be on one line

      InWord = Mid(InWord, 1, InStr(InWord, StripStr) - 1) &

_

               Mid(InWord, InStr(InWord, StripStr) + 1)

   Loop

   SStrip = InWord

  End Function

The Format_Phone() function massages the phone number into a

common string

(void of parentheses, spaces, and dashes) and then

determines the most

appropriate format. This function returns the phone number

back to the form

in that format.

The SStrip() function is a very important concept. It

continues to operate

until it eliminates a specified character (StripStr) from

the string

(InWord). This is used to eliminate extra characters

(dashes, spaces, and

so on) from the phone number.

Additional reference words: 1.00 1.10 mask input format

telephone

Access.


PRB: "Field0" Appears in a Query But Not in the Source Table

 Article Number: Q89686

 CREATED: 28-SEP-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The resulting Datasheet view of a query reveals that a field called

Field<n> (where n is a number, for example, Field0) exists, but

you do not have a field by that name in the source table. The

SELECT statement of this query includes an asterisk (*) to indicate

that all fields should be displayed.

CAUSE

The resulting data set of a query cannot contain two columns with

the same name. When you create an SQL statement with an asterisk as

the result of dragging the asterisk from the field list to a

column in the query grid, then you include another field from the

same table, there are in effect two fields with the same name. The

first field is from the group of fields represented by the

asterisk, and the second field is the one that was explicitly

included in the query grid. Note that this could also occur if you

try to add a field to the grid that is already there.

Rather than present an error message indicating that there are two

columns with the same name in the view, Access substitutes the name

of the second and subsequent duplicate fields with Field<n>.

RESOLUTION

If you want to have the datasheet display a more meaningful name

than Field<n>, do the following (the steps below assume that you

have included an asterisk in the query grid and that you are ready

to add the duplicate field):

1. In the column of the query grid where the duplicate field is to

   appear, type the name of the heading you want to see in the

   datasheet followed by a colon (:). For example:

      EmployeeName2:

2. Following the colon, type the name of the field value you want

   to appear in this column.

When you display the query in datasheet mode, the field will

display with the alias name given in step 1.

Additional reference words: 1.00 1.10 2.00 crosstab xtab


INF: Allowing an Ampersand to Appear in a Caption

 Article Number: Q90090

 CREATED: 08-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

A caption containing an ampersand (&) will result in a value that

replaces the ampersand with an underscore character (_). For example,

entering the caption

   Jack & Jill

in the property sheet will result in the following caption on the

form or control:

   Jack _Jill

MORE INFORMATION

Microsoft Access allows you to underline a character in a caption,

giving it ALT key access, by specifying an ampersand before the

character that is to be underlined. Because the ampersand appears

before the space in the following caption

   Jack & Jill

Microsoft Access assumes that the intention is to underline the space

following the ampersand.

If an ampersand is to appear in a caption, you must specify two ampersand

characters in a row. For example, entering the following caption in the

property sheet

   Jack && Jill

will result in the following caption in the resulting form or control:

   Jack & Jill

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, page 598

Additional reference words: 1.00 1.10 2.00 title checkpage


PRB: Arrange Icons Does Not Locate Icons in Correct Place

 Article Number: Q90091

 CREATED: 08-OCT-1992

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Icons do not always stay where you expect them to. See "More

Information" below for more details.

CAUSE

Icons and their placement are handled entirely by Windows. The same

behavior can be reproduced in Program manager.

STATUS

This behavior is by design.

MORE INFORMATION

1. In the Database window, create several objects, maybe five,

   such as forms, queries, and macros.

2. Minimize all the objects to icons.

3. Randomly place the icons around the screen. Make sure that a

   couple of the icons are placed off the Microsoft Access client

   area. You can do this by dragging the icon as far right as

   possible. When the icon is touching the window's border, a

   horizontal scroll bar will appear. Move the scroll box as far to

   the right as possible. Repeat this process until you can move the

   scroll box back to the left and no longer see the moved

   icon.

4. From the Windows menu, choose Arrange Icons.

5. Double-click one of the icons.

6. The document from step 5 should be open. Now minimize it.

Result: The icon is not in the same place as before step 5. If you

do this with each icon they all end up moving. If you do a second

Arrange Icons after step 6 they move to the correct location.

Arrange Icons with icons on Microsoft Access windows with

horizontal or vertical scroll bars displays this problem.

REFERENCES

==========

Microsoft Access "Getting Started," version 1.0, pages 154 and 158

Additional reference words: 1.00 1.10 2.00 WinIss


INF: Close Action has Blank Line in Object Type Argument

 Article Number: Q90092

 CREATED: 08-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The Close action has a blank line as the first choice in the drop-down

list for the Object Type argument in a macro. To reproduce this, do the

following:

1. Create a macro.

2. Add the action Close.

3. Select the drop-down menu for the Object Type argument.

RESOLUTION

This behavior is by design to allow the Close action to execute on the

current window.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 21, "Macro

Basics"

Additional reference words: 1.00 1.10 2.00 checkpage


PRB: ESC While Creating Control Does not Deselect Control

 Article Number: Q90094

 CREATED: 08-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Pressing ESC while creating a control on a form does not deselect

the control in the toolbox.

CAUSE

The toolbox is not reset until the mouse button is released. This

behavior allows you to press ESC so that you can realign a control

on the form.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open a new form.

2. From the View menu, choose Toolbox.

3. Using the left mouse button, select the text box control in the

   toolbox and drag the control to the new form, but do not release

   the left mouse button.

4. Press ESC.

   The text box is canceled but the text box control remains selected

   in the toolbox.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 214-230

Additional reference words: 1.00 1.10 2.00 toolbox deselect checkpage


PRB: Margins Do Not Relate to Printable Area

 Article Number: Q90095

 CREATED: 08-OCT-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you print or preview a report with the margins set to fall outside the

printable area defined by your printer driver, the information in the

report falling outside of the printable area will not be printed correctly.

Depending on the printer and driver being used, the output may be

truncated, shifted so it falls within the printable area, or flow onto

another page. Also, output from the second page to the end of the report

may vary from that of the first page. For example, the printer may shift

the output on those pages so the top and left sides of the report

correspond to the top and left sides of the printable area.

CAUSE

Microsoft Access sets margins based on the page size selected, not on the

printable area of that page. Therefore, if you set your margins to have

output go beyond the printable area, the information that would be placed

in that area will not print correctly.

RESOLUTION

Preview any output from Microsoft Access to make sure that no information

is truncated. If information is truncated, increase the margins by choosing

the Setup button and changing the margin settings.

For example, if your top margin is set to 0 and the information at the top

of the pages appears to be truncated, increase the top margin (for example,

to 0.5) and preview the information again. Continue increasing the margins

until the information is no longer truncated.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1, and 2.0. We are researching this problem and will post new

information here in the Microsoft Knowledge Base as it becomes available.

Additional reference words: 1.00 1.10 2.00


PRB: Update Queries Do Not Check Validation Rules

 Article Number: Q90096

 CREATED: 08-OCT-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

During update queries, validation rules are not checked, and no

error log is generated for invalid records.

RESOLUTION

Run a query to see which rows violate the validation rules. For example, if

you defined "<500" as the rule for the Units In Stock field in the Products

table, and then ran an update query to update Units In Stock + 450, some of

the fields might be greater than 500. You could then run a select query

checking for Units In Stock > 500.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Update queries are queries that change existing data in a table.

Validation rules are rules placed on a field when it is defined to

prevent that field from accepting data that does not meet the

specified rules.

When an update query is executed, as long as the data that is being

changed is the correct data type for the field, it will be changed

even if it violates the validation rules for field.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 174-178

Additional reference words: 1.00 1.10 update


INF: AccessWizards Button Grayed Out

 Article Number: Q90097

 CREATED: 08-OCT-1992

 MODIFIED: 01-SEP-1993

 VERSION(S): 1.00 1.10

----------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

----------------------------------------------------------------------

When creating forms or reports in Microsoft Access version 1.0, the

FormWizards or ReportWizards button is grayed out. This occurs because

in the MSACCESS.INI file, the section [Libraries] must contain the

entry wizard.mda = ro. If this entry is missing, the FormWizards or

ReportWizards button will be grayed out. The entry in the MSACCESS.INI

file should look like the following:

   [Libraries]

   wizard.mda = ro

Another reason for the FormWizards and ReportWizards button to be

grayed out is that there are no table or query objects in the

database window.

Additional reference words: 1.00 1.10 report wizard grey disable


INF: Creating a Snapshot Is Slower Than Creating a Dynaset

 Article Number: Q90098

 CREATED: 08-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

A dynaset is a dynamic set of records that results from running a

query or applying a filter. A snapshot is a static image of a set of

data, such as the records displayed as the result of a query.

Snapshots are not updateable, whereas dynasets are updateable.

Creating a snapshot takes longer than creating a dynaset because the

snapshot table is populated with data, and the dynaset is populated

with bookmarks, which are significantly smaller than data.

MORE INFORMATION

The results from testing have resulted in only slight speed differences

between the dynaset and snapshot, but the dynaset has been found to be

faster.

Additional reference words: 1.00 1.10 2.00


INF: Hiding Rows and Columns in Tables

 Article Number: Q90099

 CREATED: 08-OCT-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

--------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

--------------------------------------------------------------------

To decrease the width of a datasheet column, position the mouse pointer at

the right side of the field selector for the column you want to resize.

Then, drag the column border to the left. To hide the column, or make it

not visible, drag the right side beyond the left side.

To decrease the height of a datasheet row, position the pointer between two

record selectors at the left side of the datasheet. Drag the bottom of the

row toward the top. Note that dragging the bottom beyond the top does not

hide the row, as row sizing resizes all rows, and this would leave no rows

visible in the window.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.1, Chapter 14, "Adding and

Editing Data"

Additional reference words: 1.00 1.10 2.00 Tables


PRB: Remote ODBC Tables Are Read-Only Without a Unique Index

 Article Number: Q90100

 CREATED: 08-OCT-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you edit an attached SQL Server table that does not have a unique

index defined, Microsoft Access beeps and the message "Form is read only"

appears in the status bar.

CAUSE

Microsoft Access requires that a unique index be defined for each table.

Database tables from products such as Oracle, Sybase, Ingres, and DB2

that are attached to Microsoft Access using ODBC are read-only unless

they have a unique index. Views and synonyms are also read-only without a

unique index.

RESOLUTION

You can use Microsoft SQL Server to define a unique index for each table

with the SQL command CREATE UNIQUE INDEX. The basic syntax for this

command is:

   CREATE UNIQUE INDEX <index_name>

      ON [[<database.>]<owner.>]<table_name.> (<column_name>

         [, <column_name>]...)

You cannot run this command from within Microsoft Access; it must be run

in the system administration facility (SAF) on a SQL Server computer or

from a program such as Q+E, which is shipped with Microsoft Excel and can

run SQL commands directly on the SQL Server computer.

After you create the unique index for the table, reattach the table in

Microsoft Access to implement the change.

STATUS

This behavior is by design.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 66-68


PRB: When Column Selected and Deleted, Query Grid Disappears

 Article Number: Q90101

 CREATED: 08-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The Query By Example (QBE) grid, which appears when you open a

Microsoft Access query in Design view, disappears when you do the

following:

1. Select the grid by highlighting the column header.

2. Extend your selection to the end of the query grid.

3. From the Edit menu, choose Delete.

CAUSE

When you select an entire column on the query grid and choose Delete

from the Edit menu, Microsoft Access deletes the columns, rather than

deleting the data within the columns.

RESOLUTION

To display a blank column after the query grid has disappeared, choose

Insert Column from the Edit menu.

To display a column in which the fields already contain data, either

select a field from one of the lists displayed and drag it to the

query grid, or double-click the field.

STATUS

This behavior is by design.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 92-100

Additional reference words: 1.00 1.10 2.00 Blank checkpage


INF: How to Get SQL Pass-Through Functionality Using Q+E

 Article Number: Q90102

 CREATED: 08-OCT-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Microsoft Access does not directly support the use of pass-through SQL

(the ability to pass SQL commands directly to a server). However, you can

use Access Basic to perform dynamic data exchange (DDE) with the Q+E

application, which does support pass-through SQL. Using this method, you

can pass SQL commands to run stored procedures and other SQL commands.

MORE INFORMATION

To use Q+E's pass-through SQL capabilities in Microsoft Access, create

the following function in a new or existing module:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code

in Access Basic.

   Function SQLPassThru (SQLCommandText, SQLDatabaseText)

      On Error Resume Next

      Err = 0

      chan = DDEInitiate("QE", "System")

      If Err Then

         Err = 0

         Result = Shell("QE", 2)

         If Err Then

             MsgBox "ERROR: Unable to start Q+E. Q+E must be in your _

                PATH statement", 16, "SQL PassThru"

             Exit Function

         End If

         chan = DDEInitiate("QE", "System")

      End If

      DDEExecute chan, "[LOGON(SQLServer)]"

      DDEExecute chan, "[OPEN('USE " & SQLDatabaseText & "; " & _

         SQLCommandText & "','SQLSERVER')]"

      DDEExecute chan, "[EXIT()]"

      DDETerminate chan

   End Function

The SQLPassThru() function initiates a DDE channel with Q+E. If Q+E is

not available, the function attempts to start Q+E. If Q+E cannot be

started, the function displays an error message and ends. If Q+E can be

started, a DDE channel is initiated. The SQLPassThru() function then

directs Q+E to display its Logon dialog box so you can log on to SQL

Server. The SQL USE command is used to ensure that SQLPassThru() is in

the database you specify, and SQLPassThru() runs the SQL command. After

the command is run, SQLPassThru() exits the Q+E application and

terminates the DDE channel that the function established.

The following demonstrates a sample call to the SQLPassThru() function:

   =SQLPassThru("sp_addlogin Ted, ted","master")

In the above example, the SQLPassThru() function will start Q+E and

initiate a DDE channel, if possible. You will then be prompted to log on

to a SQL Server. After you log on, the function will use the master

database on the SQL Server and run the stored procedure sp_addlogin,

which will add a login for a user named Ted with a password of ted. After

the command runs the function will exit the Q+E application and terminate

the DDE channel.

NOTE: You must include quotation marks around both of the parameters to

ensure that they are used properly. You may also have to include

additional quotation marks in the SQL command you are sending to the

SQL Server to ensure that the command is being processed correctly.

For examples of the types of adjustments that you may need to make to

the SQL command string, see the "Q+E for Microsoft Excel User's Guide"

or the application note "A Practical Guide to Using Q+E," which can

be obtained by calling Microsoft Product Support at (206) 454-2030.

You can modify this function in many different ways, including:

 - To accept additional parameters and have additional corresponding

   DDEExecute commands, thereby allowing the execution of multiple SQL

   commands with one function call

 - To use as a subprocedure in which you can hard-code the parameters for

   the command and SQL database in the Access Basic code

 - To retrieve information from the SQL server, or send information to

   the SQL server using the DDERequest and DDEPoke commands

 - To use in conjunction with a form to allow on-line SQL command

   execution

 - To break into multiple functions with different capabilities, such as

   one function to initiate the channel, another function to execute

   the commands, and another function to terminate the channel

 - To access database types that Microsoft Access does not support but

   that Q+E does

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 115-126


INF: Error Message with Blank or Incorrect Data Type

 Article Number: Q90103

 CREATED: 08-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When designing a new table, a valid data-type name from the data type

combo box must be associated with each field, otherwise, you get the

error message:

   The text you enter must match an entry in the list.

This is by design, and is due to the field validation that is performed

when you exit the field.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open a new table.

2. Select any data type for the first row from the Data Type

   combo box.

3. Remove the data type selected using either the DEL or the BACKSPACE

   key.

4. Try to move to the next row. You get the error message:

      The text you enter must match an entry in the list.

The only way to move to another row is to do one of the following:

 - Fill in the Data Type field by selecting (or typing in) a data type from

   the Data Type combo box.

 - Cancel the entry by pressing the ESC key (which fills in the Data

   Type field with a default entry of Text).

 - Choose Delete Row from the Edit menu.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, page 27

Additional reference words: 1.00 1.10 2.00


PRB: OpenTable Action Ignores Data Mode If Table Open

 Article Number: Q90104

 CREATED: 08-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

In a macro, the OpenTable action ignores the Data Mode parameter if

the table being opened is already active. If table A is opened in

read-only mode and then it is opened a second time in edit mode

without being closed first, the table will still be in read-only

mode.

CAUSE

If OpenForm, OpenTable, or OpenQuery is called, and the window is

already opened, you will switch to the new view, but the data mode

cannot be switched.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a macro, as follows:

      MacroName      Action

      ----------------------------

      Test1          OpenTable

      OpenTable Actions

      ----------------------------------------------------

      Table Name:       (Give an existing table name here)

      View:             Datasheet

      Data Mode:        Read Only

2. Save and run the macro.

3. Leave the table open and return to the Macro window.

4. Make the following change to the OpenTable action of MacroName

   Test1.

      OpenTable Actions

      ----------------------------------------------------

      Table Name:       (Give an existing table name here)

      View:             Datasheet

      Data Mode:        Edit

5. Save the macro and run it again.

When the macro is run a second time (step 5) with a different data

mode, the Table window is activated but it is still in read-only mode.

Again, this behavior only occurs if the table is already open when

executing the OpenTable action.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 22, "Using

Macros with Forms"

Additional reference words: 1.00 1.10 2.00 checkpage


INF: Could not Find SYSTEM.MDA or UTILITY.MDA File

 Article Number: Q90105

 CREATED: 08-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When Microsoft Access is started, one or both of the following error

messages may be displayed:

   Couldn't find file 'SYSTEM.MDA' (version 1.x)

   Couldn't find file '<path>\SYSTEM.MDA' (version 2.0)

   Couldn't find file 'UTILITY.MDA' (version 1.x)

   Couldn't find file '<path>\UTILITY.MDA' (version 2.0)

These errors occur if the SystemDB and UtilityDB settings in the [Options]

section of the MSACCESS.INI file in version 1.x, or the MSACC20.INI file in

version 2.0, point to a directory that does not contain the SYSTEM.MDA or

UTILITY.MDA file. These errors also occur if the directory points to a

share to which there is no connection.

If the directory does not exist, the following error message is

displayed:

   Invalid Path '<pathname>' (version 1.0)

   '<pathname>' isn't a valid path (versions 1.1 and 2.0)

MORE INFORMATION

A good way to manage the MSACCESS.INI or MSACC20.INI file is to keep backup

copies that pertain to particular setups. Have one set up for starting in a

workgroup on a network and have another that allows for starting on a local

machine. To change setups, copy the appropriate backup .INI file over the

MSACCESS.INI or MSACC20.INI file.

Additional reference words: 1.00 1.10 2.00 errmsg checkpage


PRB: Error Message "Expression Is Too Long for the QBE Grid"

 Article Number: Q90106

 CREATED: 08-OCT-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You receive either of the following error messages:

   Expression is too long for the QBE grid

   -or-

   Expression is too long for the QBE grid and has been truncated:

   '<Expression>'

CAUSE

Microsoft Access combines Criteria columns in the Query by Example (QBE)

grid if two or more columns in the grid have the same field name, in order

to avoid repetitive columns. You will see this behavior after you save the

query and then open it again.

This behavior only causes a problem when you are trying to use a long WHERE

clause. In Microsoft Access version 2.0, each cell of the QBE grid is

limited to 1024 characters. If your expression is longer than this, you

will receive the error message:

   Expression is too long for the QBE grid

In Microsoft Access version 1.x, each cell of the query grid is limited to

255 characters. If your expression is longer than this, you will receive

the error message:

   Expression is too long for the QBE grid and has been truncated:

   '<Expression>'

This error can also occur if you type too long a WHERE clause in the SQL

View window and then switch back to Design view.

RESOLUTION

There are two workarounds for this behavior. The first is to break the

larger statement into two smaller statements. The other method is to use

SQL view only, avoiding displaying the query in Design view. This method is

only available in Microsoft Access version 2.0.

To break a long statement into two smaller statements, choose either of the

two columns with the same field name and put parentheses around the field

name. The following example demonstrates this method:

1. Create the following sample query:

      Query1

      --------------------------

      FieldName: UserID

         Criteria: Like "DON*"

      FieldName: UserID

         Criteria: Like "DONFU*"

2. Save and then close the query.

3. Open the query in Design view. Note that the query is now:

      Query1

      ------------------------------------------

      FieldName: UserID

         Criteria: Like "DON*" And Like "DONFU*"

      FieldName: UserID

4. Re-create the original query from step 1.

5. Place parentheses around the second field name, so the query is:

      Query1

      --------------------------

      FieldName: UserID

         Criteria: Like "DON*"

      FieldName: (UserID)

         Criteria: Like "DONFU*"

   NOTE: If the field name is more than one word, place brackets

   around the field name before putting the field name in parentheses.

6. Save and then close the query.

7. Open the query in Design view. Note that the query is now:

      Query1

      ----------------------------

      FieldName: UserID

         Criteria: Like "DON*"

      FieldName: Expr1: ([UserID])

         Criteria: Like "DONFU*"

Putting parentheses around the field name turns it into an expression. This

differentiates the column from the other column with the same field name,

and prevents Microsoft Access from combining the columns.

STATUS

This behavior is by design.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 5, "Query Basics"

Microsoft Access "User's Guide," version 2.0, Chapter 10, "Query Basics,"

and Chapter 11, "Designing Select Queries"

Additional reference words: 1.00 1.10 2.00


PRB: Minimizing, Maximizing the Desktop Flashes Slightly

 Article Number: Q90107

 CREATED: 08-OCT-1992

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

- Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If you are using a bitmap for the Windows desktop, the desktop

flashes slightly when you minimize or maximize Microsoft Access.

CAUSE

Microsoft Access is setting the system palette to its own, which

changes the colors of all the bits on the screen. You will observe

the same behavior if you run Paintbrush, load a 256-color bitmap,

and do the same steps as above.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Minimize all extra applications running.

2. Set your desktop to a bitmap (for most noticeable flash, use the

   256-color bitmap that comes with Windows 3.1).

3. Open Microsoft Access.

4. Maximize Microsoft Access.

5. Minimize Microsoft Access. Note the flash as the desktop is repainted.

6. Click the Microsoft Access icon.

NOTE: If you click another minimized application after you click the

Microsoft Access icon, the screen again repaints inversely, then repaints

correctly.

Additional reference words: 1.00 1.10 WinIss


INF: Links to Formatted DDE Items Result in Text

 Article Number: Q90108

 CREATED: 08-OCT-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Dynamic data exchange (DDE) links to numeric items that have been formatted

will result in text. To perform calculations on the results of these links,

you must convert the results to a numeric data type, as described below.

MORE INFORMATION

The following example demonstrates how to create a DDE link to a numeric

item that has been formatted:

 1. Start Microsoft Excel.

 2. In cell A1 of Sheet1, type "80" (without the quotation marks).

 3. Select cell A1, and choose Number from the Format menu.

 4. From the Format Codes list, select a currency format, such as

    $#,##0_);($#,##0), and then choose the OK button.

 5. Select cell A1, and choose Copy from the Edit menu.

 6. Start Microsoft Access and open any database.

 7. Create a new, unbound form.

 8. From the Edit menu, choose Paste Special, then select Text from

    the Data Type list.

 9. Choose Paste Link. A text box with the following formula will be

    created on the form:

       =DDE("Excel","Sheet1","R1C1")

10. Create a new text box on the form, and enter the formula:

       =Field0+100

11. View the form in Form view. Note that the first text box, Field0,

    displays "$80." The second text box displays "#Error."

The following steps demonstrate how to convert the DDE-linked item to a

Numeric data type:

1. View the form in Design view.

2. Change Field0 to be:

      =CCur(DDE("Excel","Sheet1","R1C1"))

3. View the form in Form view. Note that the second text box now displays

   the value 180.

REFERENCES

==========

For more information about data type conversions, search for "conversions"

using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


PRB: Pressing SHIFT While Dragging Not Working on New Control

 Article Number: Q90109

 CREATED: 08-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Pressing SHIFT while dragging a control is used to restrict

movement horizontally or vertically. However, this procedure works

only if the item is not selected beforehand.

RESOLUTION

A better method, if the control is already selected, is to click

anywhere in the form, then reselect the control and move it by

pressing SHIFT while dragging the control.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new form.

2. Place a text box on the form.

3. Hold the SHIFT key down.

4. Click the border of the text box and move it around.

If the text box was not selected before you performed the above steps,

you will notice the restricted movement (either horizontal or

vertical, depending on which text box border you clicked).

Additional reference words: 1.00 1.10 2.00


PRB: Database Window Loses its Focus

 Article Number: Q90110

 CREATED: 08-OCT-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 -  Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If no documents are open and you have the Database window minimized,

pressing ENTER opens the document selected in the Database window.

If there is another document opened and minimized, nothing happens

when you press ENTER on the minimized Database window icon.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Minimize the Database window.

3. Press ENTER. A table will open.

Additional reference words: 1.00 1.10


PRB: 'Couldn't Find Installable ISAM' Error

 Article Number: Q90111

 CREATED: 08-OCT-1992

 MODIFIED: 10-AUG-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

- Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Importing, exporting, or attaching to a file using an indexed

sequential access method (ISAM) driver returns an error if

Microsoft Access cannot find the ISAM driver.

CAUSE

An ISAM driver is used by Microsoft Access to update file formats

other than its own. If the path to the ISAM driver in the

MSACCESS.INI file is invalid or the ISAM driver does not exist, you

will receive the following error:

   Couldn't find installable ISAM.

RESOLUTION

Edit the MSACCESS.INI file to specify the correct path, or reinstall

Microsoft Access using the Custom option.

STATUS

This behavior is by design.

References:

"Microsoft Access User's Guide" version 1.0, Chapter 4, "Importing,

Exporting, and Attaching," pages 60-69.

Additional reference words: 1.00 1.10 errmsg checkpage


PRB: Make-Table Query Causes Existing Table to Be Deleted

 Article Number: Q90112

 CREATED: 08-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Running a make-table query that creates a table with the same name

as the table the query is based on deletes the table that the query

is based on.

CAUSE

Microsoft Access deletes a table before creating a new table with

the same name.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Save an existing table as Author.

2. Create a make-table query based on Author and type "Author"

   (without the quotation marks) for the name of the table to be

   created.

3. Run the make-table query. A dialog box with the following warning

   appears:

      Existing Table 'Author' will be deleted before running the

      query. Continue anyway?

   If you choose the Yes button, a dialog box with the following error

   message will appear:

      Couldn't find input table or query 'Author'

   At this point, the table Author will no longer exist and the

   query will fail. You will not be able to retrieve the table, even

   by choosing the Undo command from the Edit menu.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 7, "Designing

Action Queries and Parameter Queries," page 164

Additional reference words: 1.00 1.10 2.00 checkpage


PRB: Nulls Not Concatenated with "+" Operator

 Article Number: Q90114

 CREATED: 08-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When the & operator is used, text can be concatenated to either

side of a null. However, when this is done with the + operator,

a null is returned.

CAUSE

The & operator treats nulls as empty strings. The + operator

propagates nulls.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a form called Form1.

2. Place a text box field called Field0 on this form.

3. Switch Form1 to Form view.

4. Add the following function to a module:

      Function Demonstrate ()

         Forms!Form1!Field0 = Null + "This is a string"

         Debug.Print Forms!Form1!Field0

         Forms!Form1!Field0 = Null & "This is a string"

         Debug.Print Forms!Form1!Field0

      End Function

5. In the Immediate window, type the following and press ENTER:

      ?Demonstrate()

   The Immediate window will now show the following results:

      ?Demonstrate()

      #NULL#

      This is a string

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Appendix C

Additional reference words: 1.00 1.10 2.00 expressions strings checkpage


PRB: OnDblClick Macro Requires CancelEvent to Change Focus

 Article Number: Q90115

 CREATED: 08-OCT-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The macro action GotoControl does not successfully change the focus

to another control if the macro is attached to the OnDblClick

property of a text box, list box, or combo box.

CAUSE

This behavior occurs because the second click of a double-click is

not processed until after the event is completed. The second click

on the same field forces Microsoft Access to return the focus to

that field.

RESOLUTION

To prevent the second click in the double-click from being processed,

add a CancelEvent action to the macro after the GotoControl action.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 21, page 541

Additional reference words: 1.00 1.10


PRB: Cannot Delete Item When You Exit a LimitToList Combo Box

 Article Number: Q90116

 CREATED: 08-OCT-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you delete an entry in a combo box, you receive the following error

message when you attempt to leave the control:

   The text you enter must match an entry in the list.

CAUSE

This behavior is by design in order to prevent Microsoft Access from adding

nulls to the list just as it would any other new value. When LimitToList is

set to YES, no new values are accepted by the list, including nulls.

RESOLUTION

To add a blank entry to a combo box list, include a blank value in

the combo box's source table. You can then select the blank value

from the list rather than deleting the entry in the field.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create an unbound form with a combo box row source attached to any

   table. Set the LimitToList property to Yes.

2. Browse the form. Choose a value from the combo box and press ENTER.

   Note that the field is committed.

3. Choose the combo box again. Delete the value and attempt to leave

   the control. The error mentioned above will appear.

REFERENCES

==========

For more information about the LimitToList property, search for

"LimitToList" then "LimitToList Property" using the Microsoft Access Help

menu.

Additional reference words: 1.00 1.10 2.00 controls commit


PRB: List Box Not Dimmed When Disabled

 Article Number: Q90117

 CREATED: 08-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The contents of a disabled list box are not dimmed (grayed) as they

are in other disabled controls.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create a new form.

3. Place a list box control on the form and set its RowSource property

   to Customers.

4. Set the Enabled property to No.

5. Choose the Form View button.

Note that the list box's label is dimmed, but the contents of the list

box are not dimmed, as you would expect from a disabled control.

The problem, however, is only visual; the list box control is truly

disabled and you cannot alter its contents.

Additional reference words: 1.00 1.10 2.00 scroll grey out unavailable


PRB: Cannot Undo Property Settings in Table Design View

 Article Number: Q90119

 CREATED: 08-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Choosing Undo from the Edit menu while in table Design view will

not completely undo adding a field.

RESOLUTION

To completely undo the operation, choose Delete Row from the Edit

menu.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new table.

2. Enter a field name then press TAB twice.

3. Choose Undo Property Setting from the Edit menu.

The field name will be removed, but the data type will remain.

REFERENCES

==========

Microsoft Access "Getting Started," version 1.0, chapter 3, "Creating

a Table," pages 36-45

Additional reference words: 1.00 1.10 2.00 checkpage


PRB: CTRL+BREAK Makes Mouse Pointer Disappear in Module

 Article Number: Q90120

 CREATED: 08-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Pressing CTRL+BREAK causes the mouse pointer to disappear when a module

is active.

STATUS

This behavior is by design.

MORE INFORMATION

The Module window makes the mouse pointer disappear when you type so that

the mouse pointer will not obscure what you are typing. The use of

CTRL+BREAK triggers this behavior.

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access.

2. Open a database.

3. Open a module.

4. Press CTRL+BREAK.

The mouse pointer will disappear until you move the mouse.

Additional reference words: 1.00 1.10 2.00


PRB: Microsoft Access GP Faults with ATI Ultra Video Card

 Article Number: Q90121

 CREATED: 08-OCT-1992

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If you are using an ATI Graphics Ultra video driver and you select 1024 x

768 resolution, you will get a general protection (GP) fault when you

create a new form and choose Align from the Layout menu unless you first

select a control or field on the form. This error cannot be reproduced

using an ATI Graphics Ultra video driver at a lower resolution or with

any of the video drivers packaged with Microsoft Windows version 3.1.

RESOLUTION

To work around this problem, select a control on the form before

choosing Align from the Layout menu.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Microsoft has only been able to reproduce this problem on the ATI

Graphics Ultra video card running in 8514 mode (that is, 1024 x 768) and

800 x 600, 16/256 mode.

Steps to Reproduce Behavior

---------------------------

1. Create a new form.

2. From the Layout menu, choose Align.

   The following error message appears:

      MSACCESS caused a General Protection Fault in module

      <unknown>022F:D7C8@|MSACCESS will close.

Additional reference words: 1.00 1.10 WinIss


INF: How Microsoft Access Deletes Objects from a Database

 Article Number: Q90129

 CREATED: 11-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The following is a description of what happens internally when an

object (table, form, query, and so on) is deleted from a database in

Microsoft Access.

MORE INFORMATION

When you delete an object from the Database window, it is not physically

deleted from the database at that moment. Instead, it is renamed to a

temporary name (for example, ~TMPCLP1) and hidden, so that it disappears

from the Database window. The renaming operation occurs very quickly,

regardless of the object's size. The hidden object is physically deleted

from the database once you take any action other than the Undo Deletion

action.

Objects are deleted this way so that you can undo an accidental deletion,

unless some other action has been taken that then makes "undoing" an object

deletion impossible. Microsoft Access can undo commands only one level

back; it cannot queue up multiple commands to undo actions.

Since the physical object deletion occurs on the next action taken, instead

of when Delete is chosen, your computer may appear to be hung while it is

performing the delete. If the object is large enough, the deletion can take

some time.

NOTE: If you reboot your computer before the deletion is completed, the

hidden temporary object remains in the database, wasting space. To remove

hidden objects like this, compact the database.

Speed of Deletion

-----------------

The time it takes to delete an object depends on how large it is and

how fast the computer is that you are using. Smaller objects are

deleted faster than larger ones. If the database that contains the

object to be deleted is on a network file server, the deletion will

take longer.

How long an object deletion will take cannot be accurately predicted,

since the speed of deleting the object is also affected by the nature

of the data contained in it. (For example, with tables, number columns

are deleted more quickly than memo and OLE columns.)

Internally, Microsoft Access does not provide a status callback for

object deletion, so a progress indicator in the status bar is not

possible. Since there is no progress indicator, Microsoft Access does

not yield to the system until the object deletion procedure is

complete. Therefore, you cannot abort the operation or switch to

another application during object deletion.

Additional reference words: 1.00 1.10 2.00 Tables Deleting Erasing


PRA: Transaction Limit Can Cause 'Out of Memory' Error

 Article Number: Q90130

 CREATED: 11-OCT-1992

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you attempt to make a change to a database, an "Insufficient

Disk Space or Memory" error message occurs, even if you have ample

system resources and disk space.

CAUSE

Microsoft Access has a 4 MB transaction limit. All table design

changes are embedded within a transaction to ensure database

integrity. As a result, you will get the "Out of memory" error if you

attempt to update the contents of a table this large or larger.

RESOLUTION

If, for example, a table contains a field of type "double" that

you want to change to "integer," there are two ways to do this:

Method 1

--------

1. Select and copy the desired table to the Clipboard.

2. From the Edit menu, choose Paste (paste only the table structure

   to a new table name).

3. Change the data type of the desired column in this new table.

4. From the Edit menu, choose Paste (paste append the data to this

   new table).

Method 2

--------

1. Add a new column to the table with the data type you wanted.

2. Execute an update query, where the new column is assigned the

   value of the column you wanted to change.

3. Delete the old column from the table.

NOTE: You may get similar "out of memory" alerts when using both of

these methods, but the message boxes should give you the option of

continuing or canceling.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10 errmsg


PRB: Grid Disappears When Measurement Changed to Metric

 Article Number: Q90131

 CREATED: 11-OCT-1992

 MODIFIED: 19-JUL-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

- Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The grid disappears, after changing the measurement option under

Control Panel/International from "English" to "Metric".

CAUSE

The grid is only invisible; it is still active and functioning

correctly. (This behavior only occurs if the Grid option of the

View menu is activated.)

The grid is not visible because it becomes too dense to display when

the GridX/GridY properties are set to over 6 divisions per centimeter.

Since the default value for GridX is 10, and 12 for GridY, the values

make the grid too dense when measurement is switched to metric. The

largest number of divisions per centimeter the grid can be set to

and still be visible, is 6, (using the form's GridX/GridY properties)

regardless of the video card or monitor resolution.

RESOLUTION

Either set the number of divisions in the form properties to less

than 7, or switch the measurement value (in

Control Panel/International) to "English". However, be aware that

even when using the "English" measurement option, setting the

GridX/GridY values to anything over 16 divisions per inch will also

make the grid disappear.

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10


PRB: Combo Boxes Open When Window Sized to Vertical Minimum

 Article Number: Q90132

 CREATED: 11-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Combo box drop-down list boxes still open even when the window is

sized to a vertical minimum. Therefore, they appear as list boxes

in the middle of the screen, apparently unattached to any object.

CAUSE

Even though the combo box itself is not visible, it still has the

focus and still responds to key combinations that affect it, such

as ALT+DOWN ARROW.

RESOLUTION

To work around this behavior, make sure the Query window or Microsoft

Access window is not smaller than the query grid, or change the focus to

another control prior to shrinking the window size.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce:

------------------

1. Create a new query based on some table, such as the Categories

   table in the sample database NWIND.MDB.

2. Place the cursor in the first cell of the query grid ("Field:").

   Note that when you press ALT+DOWN ARROW, the combo box list drops

   down.

3. Using its window size handle, shrink either the Query window or the

   Microsoft Access window by pulling the bottom of the window up to its

   title bar.

4. Press ALT+DOWN ARROW.

   Note that the combo box list still drops down, yet appears not to

   be attached to any combo box.

Additional reference words: 1.00 1.10 2.00


PRB: Databases Truncated with LAN Manager 2.1a and Earlier

 Article Number: Q90133

 CREATED: 11-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - Microsoft LAN Manager versions 2.1a and earlier

---------------------------------------------------------------------

SYMPTOMS

There is a problem in Microsoft LAN Manager versions 2.1a and earlier that

causes file truncation when the workstation (client) computer is faster

than the server. This problem is not specific to Microsoft Access, but can

cause damage to a networked database if Microsoft Access is used in

conjunction with Microsoft LAN Manager versions 2.1a and earlier.

CAUSE

When a client workstation sends information to the server through LAN

Manager version 2.1a or earlier, LAN Manager performs a "lazy" write (the

data is buffered in memory and then written to disk at a later time). If

the client workstation sends information to the server too quickly, the

server sends a message to the client telling it to send information slower

or to wait. With LAN Manager versions 2.1a and earlier, this "slow down"

message is misinterpreted by the client redirector and the client writes 0

bytes to the file, effectively truncating it where the write operation was

occurring.

This problem is specific to the lazy writing process. When the client

writes to the server, it sends the data in a burst. This burst

overloads the server and elicits the slow down message.

RESOLUTION

To work around this problem, disable the lazy write function of the

LAN Manager client. This can be done by adding the following line to

the [Workstation] section in the LANMAN.INI file:

   ;.............012345678901234567890123456789012

   wrkheuristics=X0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

NOTE: The top line with the numbers is only a comment line for

spacing. The total number of x's and 0's (zeros) is 33 decimal.

STATUS

This workaround should be used with Microsoft LAN Manager versions

2.1a and earlier. This problem was corrected in Microsoft Windows for

Workgroups.

Additional reference words: 1.00 1.10 2.00 lanman corruption 2.10a 2.10


PRA: Cannot Cascade or Tile with 50 Windows in Access

 Article Number: Q90134

 CREATED: 11-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If you have 50 Microsoft Access objects open and you choose Cascade

or Tile from the Window menu, the screen does not change. No error

message is displayed.

CAUSE

There is not enough available memory for Windows to perform the

operation.

RESOLUTION

Close some of the open windows and then try the operation again.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

versions 1.0 and 1.1. This problem no longer occurs in Microsoft Access

version 2.0.

MORE INFORMATION

To duplicate this scenario, create 49 query windows. The Database

window counts as one window. Choose Cascade or Tile from the Window

menu. Nothing will change.

Additional reference words: 1.00 1.10 container buglist1.00


PRB: Form Displays Data from Deleted Field in Query

 Article Number: Q90135

 CREATED: 11-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you have a form based on a query and you remove a field from the

query grid, you may still see the data from the deleted field in Form

view.

You will not see the data from the deleted field if you save and then

reopen the form. The text box will contain the "#Name?" error message.

CAUSE

The form is based on a compiled query. The query must be recompiled

before the form recognizes the absence of the field.

RESOLUTION

When the form is closed and reopened, the query is recompiled. The

following procedure describes another way to have the form recompile

the query:

1. With the form in Design view, place your cursor in the text box of

   the newly deleted field.

2. Press ENTER.

3. From the View menu, choose Form. Note the error message in the

   Title text box.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. Create a new query based on the Employees table.

3. Drag the LastName and Title fields to the query grid.

4. Save the query as Query1.

5. Create a new form based on Query1.

6. Drag all the columns from the field list to the form.

7. From the View menu, choose Form.

8. Select the query. Delete the Title column from the grid. Save

   the query.

9. View the form in Form view.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, page 100

Additional reference words: 1.00 1.10 2.00 checkpage


PRB: Limited to 65535 Pages in Print Dialog Box

 Article Number: Q90136

 CREATED: 11-OCT-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

In the Print dialog box the largest value allowed in the Pages To:

box is 65535. If a number greater than 65535 is entered, the

following message is displayed:

   The 'To' field contains non-numeric characters or a number greater

   than 65535

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 31-32, 209, and 410

Additional reference words: 1.00 1.10 PtrIss


PRB: Form or Report Cannot be Opened or Previewed

 Article Number: Q90137

 CREATED: 11-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you open a form or report in Design view and then preview it, the form

or report is not previewed. In addition, if you select the form or report

from the Database window and choose Open or Preview, nothing happens.

CAUSE

The form or report's OnOpen event may have a macro attached to it whose

first action is StopAllMacros. This macro action acts like the CancelEvent

action, which prevents the form or report from opening.

The StopAllMacros action stops all macros that are currently running. In

this case, the form or report's OnOpen event calls a macro that is

immediately terminated, which aborts the preview of the report.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new macro and add StopAllMacros as the first action.

2. Save the macro as Macro1.

3. Open a report in Design view.

4. Set the report's OnOpen property to Macro1.

5. Preview the report. Note that nothing happens.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 522 and 566

Additional reference words: 1.00 1.10 2.00 container checkpage


PRB: Pressing CTRL+ALT+SPACEBAR Enters Control's Default Value

 Article Number: Q90138

 CREATED: 11-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you create a form based on a table that has one or more fields defined

with the field property DefaultValue, pressing CTRL+ALT+SPACEBAR inserts

the control's default value defined in the form, not the table's default

value. If no value has been specified for the control's DefaultValue

property, then CTRL+ALT+SPACEBAR has no effect.

When you are entering data in the table's datasheet mode, pressing

CTRL+ALT+SPACEBAR enters the field's default value, as defined in

the table.

CAUSE

When you create a form based on a table with one or more fields defined

with the field property DefaultValue, new controls bound to such a field

will have the control's DefaultValue property filled in with the same

default value. You may keep this value, change it, or delete it.

When you enter new records in Form view, any control that has a

DefaultValue property will be displayed with the control's default value.

If you decide that you want to have the default value that was defined in

the table entered, you will have to type it in. In Form view, when you

press CTRL+ALT+SPACEBAR, the default value defined for the control is

entered.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a table with a text field called City and a text field

   called State.

2. For the State field, enter "NC" (without quotation marks) for the

   DefaultValue property.

3. Create a form based on this table.

4. Add text boxes for the City and State fields.

5. Change the DefaultValue property for the control bound to the

   State field to "WA" (without quotation marks).

6. Browse the form.

   The first record has "WA" displayed in the State field.

7. Delete "WA" and enter "CA" (without quotation marks). Commit the record.

8. Delete "CA" and press CTRL+ALT+SPACEBAR. Note that "WA" is

   inserted.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 229-230

Additional reference words: 1.00 1.10 2.00 checkpage


PRB: #Error Appears Using TRIM() in Forms or Reports

 Article Number: Q90139

 CREATED: 11-OCT-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you have a form or report with the RecordSource property defined

as a table that contains no records, "#Error" will be displayed

when you preview the report or view the form if a bound control is defined

using the TRIM() function.

CAUSE

When an expression is used to define the ControlSource property for

a form or report, Microsoft Access evaluates the expression and

presents the result for the control. If a blank field is evaluated,

"#Error" appears.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a table with two text fields named Field 1 and Field 2.

2. Create a report bound to this table.

3. Place the fields in the detail section of the report.

4. Modify the ControlSource property for Field 1. Enter the following:

     =Trim([Field One])

5. Preview the report.

   You will see "#Error" where data would appear for Field 1. Field 2

   will be blank.

6. Create a form bound to the table.

7. Place the fields in the detail section of the form.

8. Repeat step 4.

9. View the form in Form view.

REFERENCES

==========

For more information on the Trim() function, search for "trim" using the

Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 pounderror


INF: Error Msg "Operation Not Supported on Paradox Table..."

 Article Number: Q90140

 CREATED: 11-OCT-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you create a Microsoft Access report based on a nonkeyed Paradox

table, or when you attempt to run a Microsoft Access query with the

table added twice, you will receive the following error message:

   Operation not supported on Paradox table with no primary key.

MORE INFORMATION

In Microsoft Access, if you attach a Paradox version 3.0 or 3.5 table, it

is best to have a key field defined in the table. Paradox creates an index

(.PX) file that should always be in the same directory as the table (.DB)

file. Important information is stored in the .PX file. Attaching nonkeyed

Paradox tables limits the report and query capabilities of Microsoft

Access.

Query Limitation

----------------

You can create a nonupdatable query based on a nonkeyed Paradox table.

However, you can add the table to the query only one time. If you add

the table twice, you will receive the error stated above when you run

the query.

Report Limitation

-----------------

You cannot use or design a Microsoft Access report based on a query

to which a nonkeyed Paradox table has been added twice.

When you create a new report and select the query to base the report

on, the error above will appear. Choose the OK button to close the

error dialog box and view the report in Design mode. If you look at

the Field List for the report, you will not see any fields listed.

The above limitations occur because attached nonkeyed Paradox tables

can only be opened once in Microsoft Access. Use of the table in both of

these scenarios requires the table to be opened more than one time in

order to perform the specific Microsoft Access task.

Paradox is manufactured by Borland International, Inc., a vendor

independent of Microsoft; we make no warranty, implied or otherwise,

regarding this product's performance or reliability.

REFERENCES

==========

For more information on using Paradox files, search for "Paradox files"

using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


PRB: Toggle Button with CancelEvent on BeforeUpdate Property

 Article Number: Q90142

 CREATED: 11-OCT-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A form containing a toggle button with the BeforeUpdate property set to a

macro that performs the CancelEvent action will behave differently than a

text box with the same BeforeUpdate property setting.

CAUSE

Text boxes have a state in which they hold a dirty value that cannot be

saved or validated. This is why you can click a text box and, without

making a change, move to another control.

Toggle buttons do not have a static state holding a dirty value that cannot

be validated. When the CancelEvent occurs, the button is left in its

original, raised state. The button code does not consider the button to be

dirty after the save failed. It has the original clean value.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

The method outlined below uses the sample database NWIND.MDB.

1. Create a form called ToggleTest based on the Products Table.

2. Place a toggle button with the following properties on the form:

      Object: Toggle Button

      ------------------------------

      ControlName: Discontinued

      ControlSource: Discontinued

      After Update: CancelEvent Test

3. Create a text box called Product Name with the following properties:

      Object: Text Box

      ------------------------------

      ControlName: Product Name

      ControlSource: Product Name

      After Update: CancelEvent Test

4. Create a new macro called CancelEvent Test with the following action:

      Macro: CancelEvent Test

      -----------------------

      CancelEvent

5. View the ToggleTest form in Form view. Click the toggle button, then

   tab to the next control. Note that the record is dirtied and the toggle

   button is not sunken.

6. Move to another record. Select a text box, then tab to another control.

   Note that the record is not dirtied.

Additional reference words: 1.00 1.10 2.00 depressed


PRB: Memory Block Not Freed If Cue Cards Incorrectly Installed

 Article Number: Q90143

 CREATED: 11-OCT-1992

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

If you did not install Cue Cards during a custom

installation of

Microsoft Access, and later you copy the CUECARDS.DLL file

to the

directory in which you installed the MSACCESS.EXE file, an

error

occurs. When you choose one of the Cue Card buttons and then

choose OK

to exit Cue Cards, the following error message is displayed:

   1 Global memory block is not freed.

CAUSE

The Cue Cards have been installed incorrectly.

RESOLUTION

When you quit the current session of Microsoft Access, this

block of memory is released.  To correctly install Cue

Cards, rerun the Setup program and choose Custom

Installation. Select only the Cue Card installation.

STATUS

This behavior is by design.

Additional reference words: 1.00 CueCards Setup Install

they check

appears:

setup."

Tutor group.

freeing it.


INF: Form OnOpen Event May Not Set Values of Unbound Controls

 Article Number: Q90146

 CREATED: 11-OCT-1992

 MODIFIED: 27-AUG-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

If you have a form or report with unbound controls that you want to set

by a macro called from the OnOpen event, that macro should include a

GoToControl or GoToRecord action before the SetValue action(s). The OnOpen

event occurs as the object(form or report) is opened but before the first

record is displayed.  At this time there is no current record or control.

You must have a current record or control before Microsoft Access can

refer to any controls on the form or report.

MORE INFORMATION

The OnOpen event for forms and reports occurs when the object is opened

but before there is a current record. To force the focus to a specific

control in order to set its value before the first record is displayed,

insert a GoToControl or GoToRecord action before the SetValue action in

the macro called from the OnOpen event.

If the controls' values should come from a specific record, use the

GoToRecord action in your macro before the SetValue action. If you wish to

set the value of individual controls, use the GoToControl action.

Actions such as GoToControl or GoToRecord, by default, refer to the object

the macro was called from. Therefore, the action argument "Item" for each

GoToControl and SetValue action should contain only the Control Name of

the control you wish to set the value of.

References:

For more information, search for "OnOpen" then "OnOpen, OnClose Properties>" using the Microsoft Access Help menu.

"Microsoft User's Guide," version 1.0, chapter 22, "Using Macros with

Forms," pages 528, 538-542

Additional reference words: 1.00 1.10 setvalue checkpage


PRB: No Prompt for Second Parameter in Query

 Article Number: Q90148

 CREATED: 11-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Microsoft Access does not prompt you for the second parameter in a query,

even though it does prompt you for the first parameter.

CAUSE

The parameter text in the criteria fields is identical for both parameters.

Each prompt for a user-entered parameter must contain a unique text string.

RESOLUTION

Modify the text in the criteria field for one of your parameters.

Then Microsoft Access will be able to distinguish between the two

parameters.

MORE INFORMATION

The following sample query will cause the problem stated above:

   Field:    Product ID        Product Name

   Sort:

   Show:         X                  X

   Criteria: [Enter Value:]

   or:                         [Enter Value:]

Microsoft Access considers the two parameter prompts, [Enter Value:],

to be one prompt. Once the first is filled with the user's search

criteria, Microsoft Access thinks the second is filled as well.

The following is an example of a multiple-parameter query that prompts

for both values:

   Field:    Product ID            Product Name

   Sort:

   Show:         X                       X

   Criteria: [Enter Product ID:]

   or:                             [Enter Name:]

Additional reference words: 1.00 1.10 2.00


PRB: Exporting to SQL Server Does Not Create Indexes

 Article Number: Q90149

 CREATED: 11-OCT-1992

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Microsoft Access allows you to export data to SQL Server backends.

However, Microsoft Access does not build the index on export, thus

creating potential problems and confusion. For example, if you then

attach the table, updates are not allowed and the data is displayed as

read only in datasheet or form view.

CAUSE

Microsoft Access can update an attached SQL Server table only if the

table has a unique index. However, Microsoft Access does not build

indexes on the SQL Server table when exporting information.

RESOLUTION

You can create indexes on exported SQL Server tables manually. After the

indexes are created, attach (or re-attach) the tables.

REFERENCES

==========

For more information on creating indexes on SQL Server database

tables, see the SQL Server "System Administrator's Guide," or pages

67-72 in the SQL Server "Language Reference."

Additional reference words: 1.00 1.10 2.00 export odbc


INF: Custom Menus Cannot Be Implemented with Pop-up Forms

 Article Number: Q90150

 CREATED: 11-OCT-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

A form will not process the macro associated with the OnMenu or Menubar

properties if the form is designed with the PopUp property set to True. A

form that is designed as a pop-up window does not have any menus associated

with it. If you want a custom menu when the pop-up window is created, you

must have a separate non pop-up window create and maintain the custom menu.

NOTE: According to "The Windows Interface - An Application Design Guide,"

dialog boxes (pop-up) generally do not have menu bars.

REFERENCES

==========

"The Windows Interface - An Application Design Guide," page 57, Microsoft

Press, 1992.

Additional reference words: 1.00 1.10 2.00 modal


PRA: Cannot Connect to SQL Server w/ NetWare, Workgroups

 Article Number: Q90151

 CREATED: 11-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - Microsoft Windows for Workgroups version 3.11

---------------------------------------------------------------------

SYMPTOMS

You are unable to communicate with SQL Server in Microsoft Access when you

are running Microsoft Access under Microsoft Windows for Workgroups on a

Novell NetWare network.

CAUSE

The Windows for Workgroups IPX/SPX driver (MSIPX.COM) does not work

correctly with Novell's named pipe requester (DOSNP.EXE) to connect to or

communicate with SQL through named pipes.

RESOLUTION

Use the NetWare Integration Kit (NIK), which provides native SPX/IPX

connectivity to SQL Server. This connectivity eliminates the need for

DOSNP.EXE. The NIK enables Microsoft Access and Windows for Workgroups to

communicate correctly with SQL Server on a Novell network.

You can order the NIK from the Microsoft Sales Information Center at (800)

426-9400. The Microsoft Sales Information Center is open Monday through

Friday, 6:30 A.M. to 5:30 P.M., Pacific time.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Windows for

Workgroups version 3.11. We are researching this problem and will post new

information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Novell's implementation of IPX is a file called IPX.COM. Microsoft's

equivalent NDIS-compliant implementation of IPX is a file called MSIPX.COM,

which is used by Microsoft Windows for Workgroups. MSIPX.COM is

functionally equivalent to Novell's IPX.COM, but has the additional

capability of using NDIS-compliant network adapter drivers.

When you install the NetWare Named Pipe Requester, a terminate-and-stay-

resident program (TSR) called DOSNP.EXE installs into memory. This TSR

works with IPX.COM to provide named-pipe functionality (which is the

communication protocol used by SQL Server) to applications. However,

DOSNP.EXE does not work correctly with MSIPX.COM at this time. Since

Windows for Workgroups uses MSIPX.COM, the NetWare Named Pipe Requester

does not work with Windows for Workgroups. Therefore, Microsoft Access is

not able to properly communicate with SQL Server.

Additional reference words: 1.00 1.10 2.00 Importing Exporting Attaching


INF: Paradox Tables, Indexes, and Multiple Connections

 Article Number: Q90152

 CREATED: 11-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

If a Paradox table does not have a primary key, then it cannot be

opened twice, even exclusively. This means it cannot be used in more

than one place in a query or in code.

MORE INFORMATION

If you try to attach a Paradox table that has no primary key, you

will get an error stating that the operation is not supported on

Paradox tables without a primary key. This can be confusing, because

you can create the query that accesses the table twice, but if you try

to use it, you will get this error. In addition, if anyone tries to

get the output column list of the query, this error will occur.

Additional reference words: 1.00 1.10 2.00 index


INF: Bitmaps Hide the Caption of a Push or Option Button

 Article Number: Q90153

 CREATED: 11-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article discusses the limitations of using Microsoft Access command

button or option button controls with bitmaps.

MORE INFORMATION

Microsoft Access has a Picture property on command buttons that can be

used to import a bitmap that will be displayed on the button. This setting

will place the caption "behind" the picture and the caption will no longer

be visible.

REFERENCES

==========

Additional reference words: 1.00 1.10 2.00 checkpage


INF: Form Must Close for Modal/Popup Settings to Take Effect

 Article Number: Q90154

 CREATED: 11-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

When you change a form's Modal or PopUp property while designing the

form, the changes will not take effect until after the form is closed

and reopened. Simply switching to Form view will not reflect the

changes.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, chapter 9, pages 213-268

Additional reference words: 1.00 1.10 2.00 checkpage


INF: Horizontal Sizing Controls Availability on Controls

 Article Number: Q90155

 CREATED: 11-OCT-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

After placing a control on a form or report, the horizontal sizing

controls will be enabled only if the Height property of the control is

greater than or equal to .26 inches. The default size for many controls

is less than .26 inches, so horizontal sizing points will not appear.

This means it could be very difficult to alter the horizontal size of

a control if the Snap To Grip option is enabled, because the slightest

movement causes a snap to grid to occur.

One workaround is to temporarily set the size of a control to .26

inches, alter the horizontal size, then reset the Height property to

its original value. Alternatively, the Height property can be set as

the default for the control. To do this, select a control on the tool

bar, display the Properties list, and change the default Height

property.

REFERENCES


INF: Border Widths Not Supported with Raised or Sunken Effects

 Article Number: Q90156

 CREATED: 11-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Border width properties are not applicable to controls with raised or

sunken properties set. You can effectively mimic these features of

Microsoft Access by using the line control.

MORE INFORMATION

When you are in form Design view, setting the BorderWidth property in

the palette screen will not have any affect on a control if the raised

or sunken effects are enabled.

To work around this behavior, you can enable these properties for the

control(s) in question and then, using the line control, create your

own sunken or raised effect. You can set the width of the line to

whatever you want. The sunken and or raised effect is accomplished

by placing lines around a standard control.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, chapter 9

Additional reference words: 1.00 1.10 2.00 checkpage


PRA: Find Toolbar Button Not Grayed After Pressing

 Article Number: Q90158

 CREATED: 11-OCT-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

After pressing the F7 key, the Find button on the Toolbar is not dimmed.

RESOLUTION

If you choose the Find command on the Edit menu, or choose the Find button,

the Find button will be dimmed.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

REFERENCES

==========

Microsoft Access "Getting Started," version 1.0, page 117

Additional reference words: 1.00 1.10


INF: Minimized Popup Forms Cannot be Easily Restored

 Article Number: Q90160

 CREATED: 11-OCT-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

If you use the Minimize action in a macro to minimize a Popup form in

Microsoft Access, it may be difficult to restore the Popup form.

MORE INFORMATION

If the mouse double-click is on the icon's caption, it will restore the

Popup form.

Windows does not allow the restore of a window unless it has the Minimize

box on the window. Popup forms in Microsoft Access do not have a Minimize

box and therefore they work differently.

REFERENCES


PRB: Opening Screen Size Is Different from Earlier Session

 Article Number: Q90161

 CREATED: 11-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When starting Microsoft Access, the window position and size may not be

the same as it was when Microsoft Access was last closed. This behavior

is by design. Microsoft Access does not currently have any support to

maintain the window state between sessions.

MORE INFORMATION

Microsoft Windows determines where an application appears. Some

applications remember if they were maximized, and some keep window state

information relative to the screen and size of a window. Microsoft Access

remembers if it was closed while maximized, and will restart that way

if it was.

Additional reference words: 1.00 1.10 2.00 user interface


PRB: SCROLL LOCK Has No Effect in Form or Datasheet View

 Article Number: Q90162

 CREATED: 11-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Pressing the SCROLL LOCK key in Microsoft Access has no effect in

Form view or Datasheet view.

STATUS

This behavior is by design.

MORE INFORMATION

Microsoft Access does not use the SCROLL LOCK key in the same way as

Microsoft Excel. Pressing SCROLL LOCK in Microsoft Excel locks the current

position of the cursor and moves the data around within this area.

This behavior was designed into Microsoft Excel, but not into Microsoft

Access.

Additional reference words: 1.00 1.10 2.00


INF: Temporarily Disabling a Macro Action

 Article Number: Q90167

 CREATED: 11-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Programming languages (such as Access Basic), typically provide a way

to temporarily disable any syntax on a line of code. For example, in

Access Basic, you can place a REM command at the beginning of a line

of code so that it is not executed. This feature is useful when you

are debugging several lines of code because it allows you to determine

which line is causing an error by disabling one line at a time until

the error no longer occurs.

This method can also be useful for debugging macros. This article

describes how you can temporarily disable a macro line.

MORE INFORMATION

To disable a macro action line without deleting it:

1. Open the macro sheet containing the line you want to disable.

2. If there is no Conditions column, choose Conditions from the

   View menu to open the Conditions column.

3. In the Conditions column, on the line you want to disable, type

   "False" (without quotation marks) if there is nothing in the column

   for that line, or "False And" (without quotation marks) if a

   condition is already entered in the column.

Now, when you run the macro, the Condition for the macro action will

be evaluated as false and the line will be ignored.

Additional reference words: 1.00 1.10 2.00 remark


INF: How to Make Welcome to MS Access Opening Screen Display

 Article Number: Q90170

 CREATED: 11-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

To have the initial Welcome To Microsoft Access opening screen appear when

you start Microsoft Access, edit the MSACCESS.INI file in version 1.x, or

the MSACC20.INI file in version 2.0. Open either file in Windows Notepad

(or any other text editor), and change the "Tutorial=" line in the

[Microsoft Access] section from

   Tutorial=0

to

   Tutorial=1

For example:

   [Microsoft Access]

   Tutorial=1

Save and then close the file, and then start Microsoft Access.

Additional reference words: 1.00 1.10 2.00 startup


PRB: Val() Function Returns "Invalid Use of Null" Message

 Article Number: Q90722

 CREATED: 21-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you create a function that uses the Access Basic function Val() and

evaluates a null field on a form, the following error message is

generated:

      Invalid Use of Null

RESOLUTION

The Val() function is giving an expression evaluation error when NULL

fields are encountered.

The Val() function returns the numeric value of a string of

characters.

STATUS

This behavior is by design.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, page 489

Additional reference words: 1.00 1.10 2.00 null error checkpage


PRB: Load From Query Dialog Title Does Not Match Menu

 Article Number: Q90723

 CREATED: 21-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The title of the Load From Query dialog box does not match the

menu name that opened the dialog box. Instead, Applicable Filter

is displayed as the title of the dialog box.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open a form.

2. Select the Edit Filter/Sort command from the Records menu.

3. Select the Load From Query command from the File menu.

Additional reference words: 1.00 1.10 2.00


PRB: Focus Does Not Shift When Find Accelerators Are Used

 Article Number: Q90724

 CREATED: 21-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Using the accelerator key (ALT+S) on the Find dialog box to choose the Find

First button does not change the focus from the Find Next button to the

Find First button. However, clicking on the Find First button does change

the focus.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Open the Order Details table.

3. Click the Fast Find button (binoculars) on the toolbar.

4. Select the Search Fields As Formatted check box.

5. Type "10002" (without quotation marks) in the Find What box.

6. The focus is on the Find Next button, so press ALT+S (which is the

   accelerator key for Find First).

Additional reference words: 1.00 1.10 2.00


PRB: Giving Controls Duplicate Name Does not Generate Error

 Article Number: Q90725

 CREATED: 21-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If you give a control the same name as another control, and you

press TAB or ENTER, the following error message appears:

   You already have a Control name <control name>

However, if you click outside the property sheet instead of

pressing TAB or ENTER, the error message does not appear and the

control returns to its original name.

Also, when giving a control a duplicate name in a form and then

closing and exiting that form, you will not receive an error

message. The control name will return to its original  name.

CAUSE

Because Microsoft Access cannot prevent you from clicking outside

the property sheet, it was decided that clicking outside the

property sheet would silently commit any changes and if the changes

violated integrity, the changes would be canceled. If Microsoft

Access had not been designed in this manner, the error message would

appear when you were in the wrong window, which might be confusing.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Place two text boxes on a form.

2. Set the control name of one text box to Field0.

3. Set the control name of the second text box to Field0, but instead

   of pressing ENTER, click outside the property sheet.

   The error message does not occur, and the control reverts to its

   original name as if you had canceled the event.

Additional reference words: 1.00 1.10 alert errmsg


INF: Control Names >40 Chars in Access Basic Require Brackets

 Article Number: Q90801

 CREATED: 22-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

If controls greater than 40 characters are referenced in Access Basic, the

following error message appears:

   Identifier too long

MORE INFORMATION

There is a limit of 40 characters in a "standard" Access Basic identifier.

If you want to use an identifier longer than 40 characters, use the

"nonconforming" identifier syntax by surrounding it with square brackets

([]).

Steps to Reproduce Behavior

---------------------------

1. Create a form (Form1) with a text box (Field0).

2. Create a new module.

3. Open the Immediate window.

4. In the Immediate window, type:

      Forms!form1.field0.controlname = _

         "aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeee"

   The control is set correctly.

5. Try to reference this control by typing:

      ?Forms!form1.aaaaaaaaaabbbbbbbbbbcccccccccc_

                             ddddddddddeeeeeeeeee.TextColor

   The "Identifier too long" message appears.

REFERENCES

==========

For more information about naming conventions, search for "standard naming

coventions" then "Standard Naming Conventions" using the Microsoft Access

Help menu.

Additional reference words: 1.00 1.10 2.00 alert err msg errmsg


PRB: Invalid Use of Null Alert Assigning Null Control

 Article Number: Q90802

 CREATED: 22-OCT-1992

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Default field values are set to Null. If you use the Eval()

function on a field without a value you will get the following

error message:

   Invalid Use of Null Alert

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a form (Form1) with a text box (Field0).

2. Switch to Form view.

3. Open a module.

4. Type the following line in the Immediate window:

      stForm$ = Eval("Forms!Form1!Field0").

   Results: Invalid Use of Null Alert.

Additional reference words: 1.00 1.10 2.00


PRB: Object Buttons in Database Window Do Not Change Colors

 Article Number: Q90803

 CREATED: 22-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Changing the default button colors in Windows Control Panel does

not affect the colors of the buttons in the Database window.

CAUSE

These buttons are actually hard-coded bitmaps, and there is no way

to dynamically change their face, shadow, and highlight colors.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Change one of the button color properties by choosing the Color

   icon in Control Panel.

2. Return to Microsoft Access and go to the Database window. All the

   object buttons (Table, Form, Query, and so on) still use the

   default colors.

Additional reference words: 1.00 1.10 2.00 container


INF: Cannot Change Borders of Raised or Sunken Controls

 Article Number: Q90804

 CREATED: 22-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

Setting the border color or border width of a raised or sunken control has

no effect. The border color and size is determined by Microsoft Access and

cannot be altered by the developer. If you want to control the border width

or the border color, the control's SpecialEffect property must be set to

Normal.

Additional reference words: 1.00 1.10 2.00 sunken raised depressed


PRB: GoToControl to Control with Focus in AfterUpdate Ignored

 Article Number: Q90806

 CREATED: 22-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When a control has the focus, and the GoToControl action is

executed with the same control name that has the focus, the focus

will move to the next control in the tab order. The focus will not

stay on the control that currently has the focus, as expected.

RESOLUTION

To prevent the focus from leaving the field, you can use an OnExit

macro that performs the CancelEvent action. Or, if you want to

prevent the field from being saved (and also prevent the focus from

leaving the control), you can use a validation rule or a

BeforeUpdate macro.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. In NWIND.MDB, create the following macro:

      Condition                 Action           Control Name

      --------------------------------------------------------

      ([Category ID]="aaaa")    GoToControl      [Category ID]

2. Save the macro as Macro1.

3. Open the Categories form in Design view. Call the macro in the

   AfterUpdate property of the Category ID control.

4. View the Categories form in Browse mode.

5. Type "aaaa" into the Category ID field and press TAB.

   The focus moves to the next field in the tab order. However, if you

   had moved to another control before pressing TAB, the focus would

   not have changed.

Additional reference words: 1.00 1.10 2.00


PRB: HelpContextID Property Accepts Valid Negative Values

 Article Number: Q90808

 CREATED: 22-OCT-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you are creating a Help file using the Microsoft Windows Help

Compiler, the HelpContextID must be entered in the [Map] section of the

.HPJ file. Values in this section must be positive values in the range 0 to

4,294,967,295.

When you enter a HelpContextId property value in Microsoft Access, you can

enter values in the range -2,147,483,648 to 2,147,483,647.

STATUS

This behavior is by design.

MORE INFORMATION

The acceptable value range for the HelpContextID property in Microsoft

Access is -2,147,483,648 to 2,147,483,647. Values outside of this range

generate the following error message:

   The value you entered isn't appropriate for this field.

The HelpContextID value is a number that Microsoft Access passes to the

Microsoft Windows application programming interface (API) WinHelp()

function, which takes an unsigned long value. Microsoft Access property

sheets do not recognize unsigned long values, so large numbers show up as

negative numbers instead.

The range of values 2,147,483,648 to 4,294,967,295 for unsigned long values

corresponds to the range -2,147,483,648 to -1 for signed long values. In

some cases, it may be more convenient to enter values in hexadecimal

notation, rather than converting the large unsigned values to their

negative signed equivalent. Microsoft Access will automatically convert

hexadecimal values to their signed long equivalent values.

The hexadecimal notation for the positive number range is &h0 to

&h7FFFFFFF, and the negative number range is &h80000000 to &hFFFFFFFF.

Steps to Reproduce Behavior

---------------------------

1. Create a new item on a form.

2. Open the property sheet.

3. Enter -2147483648 for the HelpContextID property. Microsoft Access will

   not generate an error message.

4. Change the HelpContextID to -2147483649. Microsoft Access will generate

   the following error message:

      The value you entered isn't appropriate for this field.

Additional reference words: 1.00 1.10 2.00 help


INF: How to Use a Query to Filter Unique Data

 Article Number: Q90809

 CREATED: 22-OCT-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you want to filter a table to eliminate duplicate data, you need

to use a query that uses one of the aggregate functions--First(),

Last(), Min(), or Max()--in the fields that do not contain the

duplicate data. The fields that contain the duplicate data should

contain the GroupBy() function.

MORE INFORMATION

For example, suppose you import an inventory table from an application

and discover that the data has duplicates in it. Your goal is to get

the data back down to a baseline, such as one record per product, so

you can then reinventory and have a correct and complete set of data.

You can use a query to filter the data.

Your table might look like this:

   ProdID   Description   Cost   MarkUp    Quantity

   ------------------------------------------------

   1        A Product     $1.50  0.5      10

   2        B Product     $2.50  0.7      100

   3        C Product     $1.59  0.9      25

   2        D Product     $4.59  0.8      30

   5        E Product     $1.99  0.7      40

   6        F Product     $2.69  0.4      60

   9        G Product     $4.95  0.8      20

   8        H Product     $6.79  0.9      32

   9        I Product     $6.89  0.7      0

   1        J Product     $2.99  0.5      11

If you want to filter the table down to the point where it has a

unique ProdID code and take the first entry from each of the other

fields, you can create a query to do this, as follows:

1. Create a new query based on the original table by selecting it from

   the table list and clicking the New Query button on the toolbar.

2. Drag all the fields from the Field list to the query grid.

3. From the View menu, choose Totals.

4. Set the Total line of the query grid to First() for every field

   except ProdID, which is set to Group By().

5. From the View menu, choose Datasheet.

The data you see should be a list of unique ProdID data with the first

value that is encountered for that product in each of the other

fields. If you use this procedure on the above data your result should

be:

   ProdID   Description   Cost   MarkUp   Quantity

   -----------------------------------------------

   1        A Product     $1.50  0.5      10

   2        B Product     $2.50  0.7      100

   3        C Product     $1.59  0.9      25

   5        E Product     $1.99  0.7      40

   6        F Product     $2.69  0.4      60

   8        H Product     $6.79  0.9      32

   9        G Product     $4.95  0.8      20

To obtain different results, you can use Max(), Min(), or Last()

instead of First().

To generate a unique table from this query, you could change the query

to a make-table query during the query design.

NOTE: This query will return the unique data. To find duplicate records,

use the Find Duplicates Query Wizard in Microsoft Access version 2.0. For

more information on finding duplicates using Microsoft Access version 1.x,

query on the following words here in the Microsoft Knowledge Base:

   find and duplicates

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 139-144

Additional reference words: 1.00 1.10 2.00


INF: How to Force a New Line in a MsgBox Statement

 Article Number: Q90810

 CREATED: 22-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

To force a new line in a message box, enter the message as a string

formula and concatenate a carriage return/line feed, Chr$(13) +

Chr$(10), in the message anywhere you want to start a new line.

MORE INFORMATION

For example, if you had the message:

   Notice: This is an Important Message!

And instead of having it all display on one line, or letting Microsoft

Access determine where to break the message onto a new line, you want to

force it to display as:

   Notice:

   This is an Important Message!

To force the message to display like this you need to enter the message

as a string formula. If you call the message box from a macro the syntax

would be:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   Action

   --------------------------------------------------------------------

   MsgBox

      Message: ="Notice:" & Chr(13) & Chr(10) & "This is an Important _

               Message!"

If you call the message box from a macro the syntax would be:

   MsgBox "Notice:" & Chr(13) & Chr(10) & "This is an Important_

          Message!"

This formula places "Notice:" on the first line and insert 1 carriage

return/line feed to force a hard carriage return between the 2 lines

of text.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 19, 66, and 316-

320

Additional reference words: 1.00 1.10 2.00 checkpage


INF: How to Check a Menu Item Using Access Basic

 Article Number: Q90811

 CREATED: 22-OCT-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access does not have any built-in macro or Access Basic commands

that you can use to place a check mark beside or remove a check mark from a

menu command. To do this in Microsoft Access, you must use Access Basic

code to call Microsoft Windows application programming interface (API)

functions.

MORE INFORMATION

The following Windows API function is used to check and uncheck a menu

item:

CheckMenuItem% (hMenu%, wIDCheckItem%, wCheck%)

----------------------------------------------------------------------

This function places check marks next to or removes check marks from

menu items in the pop-up menu specified by the hMenu% parameter.

   hMenu%         Identifies the menu.

   wIDCheckItem%  Specifies the menu item to be checked.

   wCheck%        Specifies how to check the menu item. The

                  wCheck% parameter can be a combination of the

                  MF_CHECKED or MF_UNCHECKED with MF_BYPOSITION or

                  MF_BYCOMMAND flags. These flags can be combined

                  by using the bitwise OR operator. The values are

                  described as follows:

                  Value          Meaning

                  ----------------------------------------------------

                  MF_BYCOMMAND   Specifies that the idCheckItem

                                 parameter gives the menu-item

                                 identifier (MF_BYCOMMAND is the

                                 default).

                  MF_BYPOSITION  Specifies that the idCheckItem

                                 parameter gives the position of the

                                 menu item (the first item is at

                                 position zero).

                  MF_CHECKED     Selects the item (adds check mark).

                  MF_UNCHECKED   Clears the item (removes check mark).

   Return Value   The return value specifies the previous state of

                  the item. It is either MF_CHECKED or

                  MF_UNCHECKED. The return value is -1 if the menu

                  item does not exist.

NOTE: Top-level menu items (items on the Microsoft Access menu bar) cannot

have a check mark.

When determining the position of a menu command, separator bars count as

commands. For example, to get to the Import menu command on the File menu

in the Database window, use the arguments 0 (for the File menu) and 7 (for

the Import command). Positions 3 and 6 correspond to the separator bars on

the File menu.

Example

-------

The example below creates a menu, associated with a form, that can be

used to check and uncheck a menu command.

1. Create a new macro. After adding the following actions and their

   associated properties, save the macro and name it "Menu Checking

   Macro." To display the "Macro Name" column, choose Macro Name from

   the View menu.

      Macro Name             Action        Function Name

      -----------------------------------------------------------

      &Check                 RunCode       Check_Menu_Item(0,0)

      &UnCheck               RunCode       UnCheck_Menu_Item(0,0)

   NOTE: The first parameter in the function indicates which menu on

   the menu bar to use. All menus are zero based. For example, if your

   menu bar contains the File, Edit, Window, and Help menus, and you

   specify 2 as the first parameter for one of these functions, the

   function will work on the Window menu. A 2 indicates the Window

   menu instead of the Edit menu because the parameter uses base 0

   instead of base 1; therefore, 0 indicates the File menu, 1

   indicates the Edit menu, and so on.

   The second parameter in the function indicates which menu command

   (on the menu indicated in the first parameter) to place the check

   mark beside. This parameter also uses base 0. To refer to the first

   command on the menu, use 0; to refer to the second, use 1; and so

   on.

2. Create a new macro. After adding the action below and its

   associated property, save the macro as "Custom Menu."

      Action

      ------------------------------------------

      AddMenu

         Menu Name:          &Check

         Menu Macro Name:    Menu Checking Macro

3. Create a new blank form and display the Properties window of the

   form by choosing Properties from the View menu.

4. In Microsoft Access 1.X, set the OnMenu property to "Custom Menu." In

   Microsoft Access 2.0, set the MenuBar property to "Custom Menu."

5. Close the form by choosing Close from the File menu. Save the form

   as "Menu Checking Form."

6. Create a new module from the Database window. In the new module,

   enter the sample Access Basic code listed at the end of this document.

   Save the module as "Menu Checking Code."

7. From the Database window, select the "Menu Checking Form" form and

   then choose the Open button to display the form in Form view. The

   normal Microsoft Access menu will disappear and be replaced by the

   custom menu that was designed above.

8. There are two options on the Check menu. If you choose the Check

   command, the command will be checked. If you choose the UnCheck

   command, the Check command will be unchecked.

Sample Access Basic Code

------------------------

   NOTE: In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

   '*****************************************************************

   'Declarations section of the module.

   '*****************************************************************

   Option Explicit

   Declare Function GetMenu% Lib "user" (ByVal hWnd%)

   Declare Function GetSubMenu% Lib "user" (ByVal hSubMenu%, ByVal nPos%)

   Declare Function CheckMenuItem% Lib "user" (ByVal hSubMenu%,_

                     ByVal nPos%, ByVal Flag%)

   Declare Function FindWindow% Lib "user" (ByVal lpClassName As Any,_

                     ByVal lpCaption As Any)

   Declare Function IsZoomed% Lib "user" (ByVal hWnd%)

   Const MF_BYPOSITION = &H400

   Const MF_BYCOMMAND = &H0

   Const MF_CHECK = &H8

   Const MF_UNCHECKED = &H0

   Const MyNull = 0&

   Const ClassName = "OMain"

   Dim ChWnd%       ' Handle to the Microsoft Access window.

   Dim hMenuTop%    ' Handle to the Microsoft Access menu.

   Dim hSubMenu%    ' Handle to the pop-up menu associated with hMenuTop%.

   Dim ItemID%      ' Command ID associated with a specified menu item.

   Dim ReturnVal%   ' Function return value may be used depending on

                    ' the function.

   '==================================================================

   ' This function displays a check mark next to the menu item.

   '==================================================================

   Function Check_Menu_Item% (TopLevel%, SubLevel%)

      'If the form is maximized, the system menu is added to the forms

      'menu bar, so increment the actual TopLevel%

      If (IsZoomed(Screen.ActiveForm.hWnd)) Then

         TopLevel% = TopLevel% + 1

      End If

      Call Get_Menu_Handles(TopLevel%)

      ' The following statement must appear on one line.

      Check_Menu_Item = CheckMenuItem(hSubMenu%, SubLevel%,_

                         MF_BYPOSITION Or MF_CHECK)

   End Function

   '==================================================================

   ' This function initializes:

   '   - The window handles associated with the Microsoft Access form.

   '   - The handle to the menu of the specified window.

   '   - The menu handle of the specified pop-up menu of the Window menu.

   ' The variables here are global to the database.

   '==================================================================

   Sub Get_Menu_Handles (TopLevel%)

      ChWnd% = FindWindow(ClassName, MyNull)

      hMenuTop% = GetMenu(ChWnd%)

      hSubMenu% = GetSubMenu(hMenuTop%, TopLevel%)

   End Sub

   '==================================================================

   ' This function will uncheck a menu item.

   '==================================================================

   Function UnCheck_Menu_Item% (TopLevel%, SubLevel%)

      Call Get_Menu_Handles(TopLevel%)

      ' The following statement must appear on one line.

      UnCheck_Menu_Item% = CheckMenuItem(hSubMenu%, SubLevel,_

                                 MF_BYPOSITION Or MF_UNCHECKED)

   End Function

REFERENCES

==========

For more information on custom menus, search for "customizing menus" using

the Microsoft Access Help menu.

For more information on similar programming features, query on the

following words here in the Microsoft Knowledge Base:

   GetSubMenu

Additional reference words: 1.00 1.10 2.00 menus checkmark


PRB: Can't Refer to Record in Function Called by OnClose Event

 Article Number: Q90812

 CREATED: 22-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If you attempt to refer to the last record that was displayed by a

form in a function or macro that was triggered by the OnClose event

of the form, instead of receiving information about the last record

that was displayed, you will receive information about the first

record of the bound table or query.

CAUSE

This behavior occurs because the OnClose event is the last action

that occurs before the form is closed. By the time the OnClose

event occurs, the form has released its pointer to the record in

the bound query or table and can no longer refer to it. If you were

stepping through the macro or code that was called by the OnClose

event, you would still see the information in the form, but because

the pointer to that data no longer exists, you would not be able to

access that data.

RESOLUTION

If you need to refer to the last record that was displayed by a

form prior to closing, you will need to use a method that uses

another form or Microsoft Access Basic code to maintain a duplicate

copy of the current record that is displayed in the form. The macro

or function that does this should be called by the form's OnCurrent

event so that every time you change the record information, the

macro makes a copy on the separate form or in Microsoft Access

Basic variables. Then, when the OnClose event is triggered, your

macro or function can use the data on the separate form or in the

Microsoft Access Basic variables because they will still be available.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10


INF: MoveSize Arguments in Wrong Order in Language Reference

 Article Number: Q90813

 CREATED: 22-OCT-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

The documentation on the syntax for the MoveSize macro action incorrectly

states the order of arguments as:

   [right][,down][,height][,width]

The correct order of the arguments, as stated in the Microsoft Access Help

topic for the MoveSize action, is:

   [right][,down][,width][,height]

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 315-316

For more information, search for "MoveSize" then "Access Basic" using the

Microsoft Access Help menu.

Additional reference words: 1.00 1.10 docbug


INF: How to Create Do While/Do Until Loops in a Macro

 Article Number: Q90814

 CREATED: 22-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

To perform a Do While or Do Until loop in a Microsoft Access macro,

you need to use a combination of correct macro structure and the

RunMacro action with appropriate information supplied in the Repeat

Expression parameter. These requirements are described in more detail

below.

MORE INFORMATION

There are several types of Do loops. Each type handles the looping

procedure and conditions differently. The different types of Do loops

are:

1. Do While <condition>... Loop

   This loop will execute while the condition is true. If the loop is

   encountered and the condition is already false, the loop will not

   be performed.

2. Do Until <condition>... Loop

   This loop will execute until the condition is true. If the loop is

   encountered and the condition is already true, the loop will not be

   performed.

3. Do... Loop While <condition>

   This loop will execute the first time unconditionally, then loop

   while the condition is true. If the loop is encountered and the

   condition is already false, the loop will be performed once.

4. Do... Loop Until <condition>

   This loop will execute the first time unconditionally, then loop

   until the condition is true. If the loop is encountered and the

   condition is already true, the loop will be performed once.

To perform a Do While or Do Until loop in a macro, you would use a

macro similar to the following examples. To create the following

examples, open a new macro and choose Macro Names from the View menu.

Add the following macro names and actions and save this macro group as

Do_Loops.

Do While <Condition>... Loop and Do Until <Condition>... Loop

-------------------------------------------------------------

   Macro Name       Action

   -------------------------

   Do_Loop1         RunMacro

   Loop1            MsgBox

   Do_Loop1 Actions

   ----------------

   RunMacro

      MacroName: Do_Loops.Loop1

      Repeat Expression: <your_condition>

   Loop1 Actions

   -------------

   MsgBox

      Message: ="Loop"

In this example, the Do_Loop1 macro calls the Loop1 macro while the

Repeat Expression parameter of the RunMacro action is true.

Do... Loop While <Condition> and Do... Loop Until <Condition>

-------------------------------------------------------------

   Macro Name       Action

   -------------------------

   Do_Loop1         RunMacro

                    RunMacro

   Loop1            MsgBox

   Do_Loop1 Actions

   ----------------

   RunMacro

      MacroName: Do_Loops.Loop1

   RunMacro

      MacroName: Do_Loops.Loop1

      Repeat Expression: <your_condition>

   Loop1 Actions

   -------------

   MsgBox

      Message: ="Loop"

In this example, the Do_Loop1 macro calls the Loop1 macro once

unconditionally, then continues to call the Loop1 macro while the

Repeat Expression parameter of the RunMacro action is True.

Conditions

----------

The condition used in the loop, which is supplied in the Repeat

Expression parameter of the RunMacro action, can be based on a value

in a field on a form, a property of a control on a form, or the value

returned from a Microsoft Access Basic function. If the condition is

based on a field in a form or a property of a control on a form, it

will have syntax similar to:

   Forms![CounterForm]![Counter]<=10

   -or-

   Forms![EntryForm]![InvoiceNo].Visible=True

If the condition is based on the value returned from a Access Basic

function, it will have syntax similar to:

   Time()>=TimeEntry()

Do While Loops vs. Do Until Loops

---------------------------------

Whether a loop is a Do While loop or a Do Until loop depends on the

condition. The RunMacro action runs the macro until the condition in

the Repeat Expression parameter is false. This behavior is exactly

what is needed for a Do While loop. It is, however, the opposite of

what is needed for a Do Until loop. Therefore, to make a condition for

a Do Until loop work correctly, precede the condition in the RunMacro

action with the Not operator.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 316-317 and

412-414

Additional reference words: 1.00 1.10 2.00 checkpage


INF: How to Create For Next Loops in a Macro

 Article Number: Q90815

 CREATED: 22-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

To perform a For Next loop in a Microsoft Access macro, you need to

use a combination of correct macro structure and the RunMacro action

with appropriate information supplied in either the Repeat Count or

Repeat Expression parameters.

To enhance your macro, you can use a different macro structure and

include a call to an Access Basic function that maintains a

counter, or use the SetValue macro action to maintain and update a

counter value in a text box on a hidden form. The benefit of

maintaining a counter is that you can use the value of the counter in

your macro processing just as in a Access Basic For Next loop.

MORE INFORMATION

To perform a For Next loop in a macro, you would use a macro similar

to the following examples. To create the following sample macros, open

a new macro and choose Macro Names from the View menu. Add the

following macro names and actions, then save this macro group as

"For_Next_Loops".

For Next Loop Using Repeat Count

--------------------------------

   Macro Name       Action

   -------------------------

   For_Next_Loop1   RunMacro

   Loop1            MsgBox

   For_Next_Loop1 Actions

   ----------------------------------

   RunMacro

      MacroName: For_Next_Loops.Loop1

      Repeat Count: 10

   Loop1 Actions

   -------------------

   MsgBox

      Message: ="Loop"

In this example, the For_Next_Loop1 macro calls the Loop1 macro 10

times. The number of times the macro is called is specified in the

Repeat Count parameter of the RunMacro action.

The limitation of this example is that a counter value is not

available to indicate which instance of the loop is being executed. As

a result, there is no way to tell if this is the first, fifth, or

tenth time the loop is being executed.

For Next Loop That Maintains a Counter in a Text Box on a Form

--------------------------------------------------------------

   Macro Name       Action

   -------------------------

   For_Next_Loop2   SetValue

                    RunMacro

   Loop3            MsgBox

                    SetValue

   For_Next_Loop2 Actions

   ----------------------

   SetValue

      Item: Forms![CounterForm]![Counter]

      Expression: 1

   RunMacro

      MacroName: For_Next_Loops.Loop2

      Repeat Expression: Forms![CounterForm]![Counter]<=10

   Loop2 Actions

   -------------------

   MsgBox

      Message: ="Loop Count: " & Forms![CounterForm]![Counter]

   SetValue

      Item: Forms![CounterForm]![Counter]

      Expression: Forms![CounterForm]![Counter]+1

In this example, the For_Next_Loop2 macro uses the SetValue macro

action to initialize (set to a value of 1) a counter in a text box

called Counter on a form called CounterForm. It then runs the Loop2

macro until the Repeat Expression parameter evaluates to false. In

this example, the loop executes 10 times. The Loop2 macro displays a

message box that indicates which instance of the loop is being

executed by referring to the counter value in the Counter text box.

The Loop2 macro then increments the counter (adds 1 to the current

counter value) by using the SetValue macro action.

The benefit of this example is that a counter value is available to

indicate which instance of the loop is being executed. The drawback to

this example is that it depends on a form that must be created and

opened prior to the execution of the loop. The form can be hidden or

visible, but it must be open for this example to work.

For Next Loop Using Access Basic Function to Maintain a Counter

---------------------------------------------------------------

   Macro Name       Action

   -------------------------

   For_Next_Loop3   RunCode

                    RunMacro

   Loop3            MsgBox

                    RunCode

   For_Next_Loop3 Actions

   ----------------------

   RunCode

      Function Name: =LoopCount(1)

   RunMacro

      MacroName: For_Next_Loops.Loop3

      Repeat Expression: LoopCount(3)<=10

   Loop3 Actions

   -------------------

   MsgBox

      Message: ="Loop Count: " & LoopCount(3)

   RunCode

      Function Name: =LoopCount(2)

In this example, the For_Next_Loop3 macro runs the LoopCount(1)

function by using the RunCode macro action. This causes the function

to initialize the counter to a value of 1. It then runs the Loop2

macro using the RunMacro action until the Repeat Expression parameter

is false. LoopCount(3), which is used in the conditional expression,

returns the current value of the counter. Therefore, when the counter

reaches 11, the loop has executed 10 times, and when the RunMacro

action checks the condition, it evaluates to false and will not call

the Loop3 macro again. The Loop3 macro displays a message box that

indicates which instance of the loop is being executed by referring to

the counter value returned by the LoopCount(3) function call. The

Loop3 macro then increments the counter using the RunCode macro

action, which calls the function LoopCount(2).

The benefits of this example are that a counter is available that

indicates which instance of the loop is being executed and you do not

need to create and open a form with a control on it to contain the

counter value. The drawback to this example is that you need to create

the LoopCount() Access Basic function prior to using this

example; however, after you create the function it is available

anywhere in Microsoft Access.

The Access Basic function procedure LoopCount() returns the

current value of a counter that the function declares and maintains.

Depending on which parameter is passed (1, 2, or any other number),

LoopCount() will initialize, increment, or return the counter's

current value. Below is the Access Basic code for the LoopCount()

function procedure.

   Function LoopCount (Action)

      Static LoopCounter             ' Static variable to hold counter

      If Action = 1 Then             ' Initialize counter

         LoopCounter = 0

      ElseIf Action = 2 Then         ' Increment counter

         LoopCounter = LoopCounter + 1

      End If

      LoopCount = LoopCounter        ' Return value

   End Function

REFERENCES

==========

Microsoft Access "Introduction to Programming," version 1.0, chapter 3,

pages 6-7 and 10-11

Microsoft Access "Language Reference," version 1.0, pages 246-248,

316-317, 412-414, and 437-438

Additional reference words: 1.00 1.10 2.00 checkpage


INF: Freestanding Labels Do Not Appear in Datasheet View

 Article Number: Q90816

 CREATED: 22-OCT-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

- Microsoft Access version 1.0

---------------------------------------------------------------------

The final sentence on page 221 of the Microsoft Access "User's Guide,"

version 1.0, is misleading. It should read as follows:

   Freestanding labels do not appear in Datasheet view. Freestanding

   (unbound) text boxes will appear in Datasheet view with their

   control names as column headings.


INF: Attached Table Must Be Opened as Dynaset from Modules

 Article Number: Q90817

 CREATED: 22-OCT-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

In Access Basic modules, a table can be opened as the Table data type

in the following manner:

   Dim MyDB as Database

   Dim MyTable as Table

   Set MyDB = OpenDatabase("NWIND.MDB")

   Set MyTable = MyDB.OpenTable("Categories")

However, if you have an attached table that is in the database, it

cannot be opened as the Table data type. An attached table must be

opened as the Dynaset data type in the following manner:

   DIM MyDB as Database

   DIM MyDyn as Dynaset

   Set MyDB = OpenDatabase("NWIND.MDB")

   Set MyDyn = MyDB.CreateDynaset("AttachedTable")

MORE INFORMATION

If you try to execute the OpenTable action on an attached table, you

will receive the following error message in Microsoft Access version 1.x

(error # 3219):

   Can't perform operation; it is illegal

In Microsoft Access version 2.0, you will receive error # 3219:

   Invalid Operation

When you refer to a Table data type, the table must reside in the .MDB

file. This is why an attached database must be opened as a dynaset. An

attached table only has a pointer to where the table resides.

REFERENCES

==========

For more information on table objects, search for "OpenTable" using the

Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 datatype errmsg


INF: Setting Form's Dynaset Property Puts Bookmark at EOF

 Article Number: Q90850

 CREATED: 22-OCT-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

In Access Basic, you can make a copy of the dynaset that a

form may currently be using for data manipulation.

The syntax to accomplish this is:

   Dim MyDB as Database

   Dim MyDyn as Dynaset

   Set MyDB = OpenDatabase("NWIND.MDB")

   Set MyDyn = Forms!Categories.Dynaset

In this case, you may assume that the bookmark is at the beginning of

the Categories dynaset. However, the bookmark is at the end-of-file

(EOF) marker. In fact, after a variable is set to the dynaset of a

form, there is no current record because the bookmark is actually at

the EOF marker.

MORE INFORMATION

Before doing any further actions, the two dynasets should either be

synchronized or the bookmark should be set to the first record. This

is done with the following statement:

   MyDyn.Bookmark = Forms!Categories.Bookmark  ' Synch dynasets.

   -or-

   MyDyn.MoveFirst   ' Move to first record.

After one of these statements has been issued, there will be a current

record and the bookmark will be pointing at this current record.

REFERENCES


INF: Network Users Can Open Their Own SYSTEM.MDA Exclusively

 Article Number: Q90851

 CREATED: 22-OCT-1992

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Two users on the same network can open the same SYSTEM.MDA file

exclusively. Microsoft Access ignores the exclusive lock on a

SYSTEM.MDA file in a multiuser installation.

MORE INFORMATION

Microsoft Access opens the system database nonexclusively on the

network. Subsequent requests to open the database ignore the read-only

and exclusive flags.

Since the SYSTEM.MDA file is opened whenever a user logs into the

database, opening the SYSTEM.MDA file exclusively would lock out all

other users on the network.

Additional reference words: 1.00 1.10 2.00 WinIss jet


INF: ComboBox On Toolbar Do Not Use Window Background Color

 Article Number: Q90852

 CREATED: 22-OCT-1992

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

The Microsoft Access combo box on the toolbar does not use

the window

background color, so changing the background color from the

Color utility

in the Control Panel does not have any effect.

MORE INFORMATION

Microsoft Access toolbars are predefined forms. There is no

way to specify

the windows background as a color on a form. If you want to

change colors

in Microsoft Access, you can open and edit the forms in

UTILITY.MDA. If you

modify UTILITY.MDA, make sure to backup the UTILITY.MDA file

before you

make any modifications.

Steps to Reproduce Behavior

---------------------------

1. Change the Window Background color in the Control Panel.

2. Start Microsoft Access and open the sample database

NWIND.MDB.

3. Select the Table command from the View menu.

4. Select the Customer table by double-clicking it.

At this point the "Field:" drop-down combo box still has a

white

background.

Additional reference words: 1.00 1.10 combobox


INF: Double-click Also Executes OnPush Twice

 Article Number: Q90853

 CREATED: 22-OCT-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

On a form using the OnPush and OnDblClick events, the double-click

runs the OnPush event before and after the OnDblClick event.

MORE INFORMATION

If you want the OnDblClick event to execute without the OnPush event,

you must put an explicit CancelEvent action at the end of the OnDblClick

macro. Otherwise, both clicks will execute the macro assigned to the

OnPush event.

Steps to Reproduce Behavior

---------------------------

1. Create a macro with a beep action. Save it as Macro1.

2. Create a second macro with a MsgBox action. Save it as Macro2.

3. Create a blank form and add a command button.

4. Set the OnPush property for the command button to Macro1 and the

   OnDblClick property to Macro2.

6. From the View menu, choose Form.

7. Double-click the command button.

   Note that the OnPush event is activated before and after the

   OnDblClick event.


INF: Shrinking Empty or Null OLE Object on Report

 Article Number: Q90855

 CREATED: 22-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

If a report has object linking and embedding (OLE) objects that are

empty or null, you can set up the report so that empty or null OLE

objects will not appear.

MORE INFORMATION

To illustrate how this is done, we will use the sample database NWIND.MDB:

 1. Start Microsoft Access and open NWIND.MDB. You may want to make a copy

    of NWIND.MDB before proceeding.

 2. From the View menu, choose Table. Open the Employees table and add

    a few records without pictures to the end of the table. Close the

    table.

 3. From the View menu, choose Macros. Create a new macro and enter

    the lines below. Save the macro as Macro99.

       Condition                                 Action

       --------------------------------------------------

       Reports![Report1]![photo] Is Null         SetValue

       Reports![Report1]![photo] Is Not Null     SetValue

       Macro99 Actions

       ------------------------

       SetValue

          Item: [photo].visible

          Expression:  False

       SetValue

          Item: [photo].visible

          Expression:  True

    Line 1 of this macro checks to see if the OLE object is null or

    empty. If it is, the Visible property is set to 0 (False), making

    the object invisible. For Line 2, if the OLE object is not null or

    empty, the Visible property will be set back to -1 (True) and the

    picture will be visible.

 4. From the View menu, choose Report.

 5. In the Database window, choose the New button.

 6. When prompted, base the report on the Employees table and select

    Blank Report instead of the Report Wizard.

 7. Drag Employee ID, Last Name, First Name, and Photo from the list

    of fields and place them in the detail section of the report.

 8. If the property sheet is not showing, choose Properties from the

    View menu, or click the Properties button on the toolbar.

 9. Click the detail section bar (the bar labeled "Detail"). On the

    property sheet, change the following properties:

       OnFormat: Macro99

       CanShrink: Yes

10. In the toolbox, click the text box button. Add an unbound text box

    to your report that completely overlaps the OLE object. The text

    box is necessary to cause the items below it to be pulled up.

11. For this unbound text box, change the following properties:

       Visible: NO

       CanShrink: YES

12. From the Layout menu, choose Send To Back. The OLE object should

    now be on top of the unbound text box.

13. Save the report as Report1.

14. Scroll through the pages of the report in print preview. Scroll

    to the last page and note how the CanShrink property works with

    null or empty OLE objects.

    When an OLE object is visible, the CanShrink property will prevent

    the empty text box from shrinking. When the OLE object is

    invisible, the text box will shrink to nothing.

Additional reference words: 1.00 1.10 2.00 container remove delete erase


PRB: CancelEvent Action in OnClose Macro Prevents Exit

 Article Number: Q90856

 CREATED: 22-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

After a form is opened, Microsoft Access and Microsoft Windows

cannot be closed (quit).

CAUSE

If there is a CancelEvent action in an OnClose macro, you will be

unable to close Microsoft Access and Windows.

RESOLUTION

If a form's OnClose property specifies a macro that executes a

CancelEvent action, you will not be able to close the form. You must

either correct the condition that caused the CancelEvent action or

open the macro and delete the CancelEvent action. If the form is a

modal form, you will not be able to open the macro.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 549-552

Additional reference words: 1.00 1.10 exit checkpage


INF: Cut and Paste Removes Blank Lines in Macro's Design View

 Article Number: Q90857

 CREATED: 22-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

If you cut and paste or copy and paste multiple rows, and several of

the rows are blank, the blank rows will be removed in the macro's

Design view.

Although Microsoft Access removes the blank lines, the resulting code

is functionally equivalent.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 21

Additional reference words: 1.00 1.10 2.00 checkpage


PRB: Mail Label Wizard Cuts Off First Field at Top of Page

 Article Number: Q90858

 CREATED: 22-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The first line on each page in a mailing label created with the

ReportWizard may not print or show in Print Preview. Forms and

reports may also exhibit this behavior.

CAUSE

All printers have non-printable areas. Microsoft Access reads the

default Windows printer driver to determine what to print or show

in Print Preview. If the label layout exceeds the printable area,

the labels will be truncated and the first line will not print.

RESOLUTION

If you experience this problem, you should increase the height of

your page header to align your labels. In some cases the first row

of labels will be unusable.

STATUS

This behavior is by design.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.00, page 401

Additional reference words: 1.00 1.10 2.00 wizards checkpage


PRB: Fonts May Change Zooming Out in Print Preview

 Article Number: Q90859

 CREATED: 22-OCT-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Zooming out when previewing a report may cause the font to change

to a generic font.

CAUSE

Microsoft Access chooses fonts so that the font displayed will

always be readable. The normal font will print as expected.

RESOLUTION

This behavior is by design.

REFERENCES

==========

For more information on previewing a report, search for "preview" using the

Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


PRB: #Error When Control Name Used in ControlSource Expression

 Article Number: Q90860

 CREATED: 22-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A field resulting in "#Error" will be created when the ControlSource

property (bound field) contains the ControlName property in version 1.x, or

the Name property in version 2.0, in an expression. However, in an unbound

text box, the same expression generates the expected value rather than

"#Error."

CAUSE

There is a circular dependency in either a form or a report. Control names

take precedence over field names when binding. Microsoft Access currently

does not provide a more descriptive error for circular references.

RESOLUTION

If you need to reference the ControlName (in version 1.x) or the Name (in

version 2.0) property in an expression, use an unbound text box. Otherwise,

reconstruct the ControlSource property expression so that it does not

reference the ControlName or Name property. Another alternative is to

change

the ControlName on the form.

STATUS

This behavior is by design.

MORE INFORMATION

If you create a bound form and drag a numeric field onto the form, by

default the ControlSource property and the ControlName or Name property

will be given the name of the actual field in the underlying table or

query. If you change the ControlSource property to an expression that

includes the ControlName or Name property, you will see "#Error" in this

field when you switch to Form or Datasheet view. The following example

demonstrates an expression within the ControlSource property:

   ControlName: Person_ID (version 1.x)

   Name:        Person_ID (version 2.0)

   ControlSource: =[Person_ID] + 1

Additional reference words: 1.00 1.10 2.00 pounderror


INF: Connecting to the First Available Network Drive

 Article Number: Q90861

 CREATED: 22-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

To make a network connection with the Windows API, you can use an

unused logical drive letter or a UNC name (\\SERVER\SHARE). You can

call the Windows API function GetDriveType() from an Access Basic module

to find the first available drive letter and then make a network

connection to this available drive.

MORE INFORMATION

Use the following steps to find the first free drive and make a

network connection:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

1. Declare the API functions:

      '------------------------------------------------------------------

      Option Explicit

      Declare Function GetDriveType% Lib "kernel" (ByVal nDrive%)

      Declare Function WNetAddConnection% Lib "User"(ByVal lpszNetPath$,_

                                                    ByVal lpszPassword$,_

                                                    ByVal lpszLocalName$)

      '------------------------------------------------------------------

2. Write a function to return the first free drive and make the new

   connection:

      Function FreeDrive ()

         Dim DriveNum, FirstFreeDrive

         Dim FirstDrive%, Results%

         DriveNum = -1

         Do

            DriveNum = DriveNum + 1

            FirstDrive% = GetDriveType(DriveNum)

         Loop Until FirstDrive% = 0

         FirstFreeDrive = Chr$(DriveNum + 65) + ":"

         'Substitute the appropriate server share and password.

         Results% = WNetAddConnection("\\server\share", "password", _

                                       FirstFreeDrive)

      End Function

REFERENCES

==========

Microsoft Access "Introduction to Programming," version 1.0, page 8

Additional reference words: 1.00 1.10 2.00 checkpage


INF: Using the Windows 3.1 API to Connect to Network Resources

 Article Number: Q90862

 CREATED: 22-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The Microsoft Windows version 3.1 application programming interface

(API) can be used to connect to and disconnect from network drives and

printers in an Access Basic module.

MORE INFORMATION

To use the API functions, follow the steps below. You will probably

want to use variables for the parameters.

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

1. Declare the functions required to add and remove network

   connections. Type the lines in a module in the Global Declarations

   section:

   '------------------------------------------------------------------

   Option Explicit

   Declare Function WNetAddConnection% Lib "User" (ByVal lpszNetPath$,_

                                                ByVal lpszPassword$,_

                                                ByVal lpszLocalName$)

   Declare Function WNetCancelConnection% Lib "User" (ByVal lpszName$,_

                                                ByVal fForce%)

   Const WN_SUCCESS=0           ' The function was successful.

   Const WN_NET_ERROR=2         ' An error occurred on the network.

   Const WN_BAD_PASSWORD=6      ' The password was invalid.

   Dim Results%, Force%

   '------------------------------------------------------------------

2. Create a function that makes the connection:

      Function AddConnection ()

         ' lpszLocalName$ can be in the form D: or E: and LPT1 or LPT2.

         Results% = WNetAddConnection("\\server\share", "password", "y:")

      End Function

   Some of the possible return values for Results% are WN_SUCCESS,

   WN_NET_ERROR, and WN_BAD_PASSWORD.

   For more information on how to obtain an unused drive resource

   programmatically, search the Knowledge Base for the following

   keywords:

      network and getdrivetype

3. Create a function that cancels the connection. The parameter

   fForce% specifies whether any open files or open print jobs on the

   device should be closed before the connection is canceled. If this

   parameter is FALSE and there are open files or jobs, the connection

   will not canceled.

      Function CancelConnection ()

         Force%=1

         ' NOTE: If Force%=0 and files were open,

         '       the connection will not be 'canceled.

         Results% = WNetCancelConnection("y:", 1)

      End Function

   Two of the most common return values for Results% are WN_SUCCESS

   and WN_NET_ERROR.

REFERENCES

==========

Microsoft Access "Introduction to Programming," version 1.0, Chapter 2,

"Writing a New Function," pages 8-14

Additional reference words: 1.00 1.10 2.00 checkpage


INF: Older Versions of Shared DLLs Cause Problems with Access

 Article Number: Q90863

 CREATED: 22-OCT-1992

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Shared dynamic-link libraries (DLLs) in your system older than those

supplied with Microsoft Access version 1.0 or Microsoft Windows

version 3.1 can cause unexpected errors with Microsoft Access.

To avoid problems, make sure that all shared DLLs are at least as

current as those supplied with Microsoft Windows version 3.1 or

Microsoft Access version 1.0, and that they are all located in the

MORE INFORMATION

The shared DLLs used by Microsoft Access are:

   COMMDLG.DLL   89248 bytes   3/10/92   Windows 3.1

   COMMDLG.DLL   89248 bytes   10/25/92  Access 1.0

   COMMDLG.DLL   89248 bytes   5/21/93   Access 1.1

   COMMDLG.DLL   97984 bytes   10/1/92   Windows for Workgroups

   OLECLI.DLL    83456 bytes             Same for all

   OLESVR.DLL    24064 bytes             Same for all

   DDEML.DLL     36864 bytes   3/10/92   Windows 3.1

   DDEML.DLL     36964 bytes   10/25/92  Access 1.0

   DDEML.DLL     36964 bytes   5/21/93   Access 1.1

   DDEML.DLL     38400 bytes   10/1/92   Windows for Workgroups

   SHELL.DLL     41600 bytes   3/10/92   Windows 3.1

   SHELL.DLL     41600 bytes   10/25/92  Access 1.0

   SHELL.DLL     41600 bytes   5/21/93   Access 1.1

   SHELL.DLL     41520 bytes   10/1/92   Windows for Workgroups

   VER.DLL        9008 bytes             Same for all

(These DLLs are used by Windows applications other than Microsoft

Access, as shown above. The DLLs for which no date is provided are the

same for all applications.)

Microsoft Access supplies the same DLL versions as Windows 3.1, and it

requires these (or newer) versions for correct operation; older

versions can cause errors.

Microsoft Access and Windows copy shared DLLs into the WINDOWS\SYSTEM

subdirectory, and that is where Microsoft Access first looks for them.

If it does not find one or more of the shared DLLs, it looks in the

directory where Microsoft Access is installed, and then in the current

directory.

Often, Microsoft Access finds outdated or incorrect DLLs because

third-party software with old or foreign DLLs has been installed or

reinstalled, overwriting the correct DLLs. Some third-party software

packages copy DLLs into directories other than WINDOWS\SYSTEM,

creating multiple copies and making the problem harder to track and

resolve.

Microsoft Access will not reload DLLs previously loaded by another

software package; it will only load shared DLLs not already loaded. If

the previously loaded DLLs are incorrect, they can cause problems with

Microsoft Access.

If the Microsoft Access Setup program fails to locate a shared DLL, or

detects an older version of one, it issues an error message such as:

   Outdated XXXX.DLL found. Please reinstall MSAccess.

   -or-

   Can't find XXXX.DLL.

Additional reference words: 1.00 1.10 WinIss


INF: MS Access Saves Printer Information with Each Form/Report

 Article Number: Q90864

 CREATED: 22-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access saves printer driver information with each form or report

that it generates. This means you do not have to set up the printer with

the correct driver in order to print out a form or report--the form or

report "remembers" the correct driver and uses it. For example, you can

save one form using a PostScript printer driver and another form using the

generic text driver.

NOTE: If the Default Printer option button is selected, the form will

print to the Windows default printer.

MORE INFORMATION

If the printer that the printer driver requires is not currently

connected, Microsoft Access displays a dialog box stating that the

printer is not available and allows you to select another printer.

Bear in mind that some text formatting depends on the current printer

driver. For example, if you format a document with a PostScript

printer font instead of a software font (such as a TrueType font) and

send the document to a PostScript printer, everything should print out

correctly. However, if you send the document to a LaserJet, you will

get output errors because some PostScript printer fonts are not

available on a LaserJet.

A driver-related problem could be something such as the sudden

appearance of the Zapf Dingbats font in a form or report set up to use

the Windows System font and sent to a PostScript printer. This problem

occurs because the Windows System font is not available on PostScript

printers. When a font is unavailable, Windows attempts to find an

equivalent among those on the printer, searching through them

alphabetically. In this case, it arrives at the Zapf Dingbats font

last and uses it because there are no other options.

The best way to avoid these problems is to create all your forms and

reports with TrueType fonts, which appear correctly in print preview

and are processed the same way by all printers.

Additional reference words: 1.00 1.10 2.00 printing post script true


INF: Commonly Asked Questions About Access Version 1.0

 Article Number: Q90866

 CREATED: 22-OCT-1992

 MODIFIED: 22-AUG-1993

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SUMMARY

Commonly asked questions about Microsoft Access version 1.0 are listed

below.

MORE INFORMATION

1.Q. Is it possible to customize the Help file in Microsoft Access?

  A. Customized Help files can be used only in Microsoft Access forms.

     Use the HelpContextId and HelpFile properties of the form to

     reference a Help file previously constructed with the Microsoft

     Windows Help Compiler. For more information on this, search for

     "HelpContextId" in the Microsoft Access online Help.

2.Q. Is it possible to set up a many-to-many relationship?

  A. No. The only kinds of relationships you can define are

     one-to-many and one-to-one. It is generally not a good database

     design to have many-to-many relationships. An alternative is to

     build a linking table between two tables that have a many-to-many

     relationship. For example, if you had an "Employees" table and a

     "Job Skills" table, each employee may have many skills, and each

     skill could belong to more than one employee--a many-to-many

     relationship. To work around this, you would build a linking

     table "EmpSkill" that had two columns, EmpID and SkillID, to

     relate the two tables.

3.Q. Where are OLE objects (such as the pictures in the Employees table

     in NWIND.MDB) stored?

  A. OLE objects can be either linked or embedded. Embedded objects

     are stored inside the .MDB file. Linked objects point to a file

     located external to the database, and are therefore not stored in

     the .MDB file. Since the Employees' pictures within NWIND.MDB are

     embedded OLE objects, the pictures are stored in NWIND.MDB.

4.Q. How can I tell if an OLE object is embedded or linked?

  A. To tell if an object is linked or embedded, first select the

     object, then choose the last command on the Edit menu. The

     command name varies depending on the object type. (For example,

     "Paintbrush Picture Object," "Microsoft Excel Worksheet Object,"

     and so on.) When the option is highlighted or selected, a submenu

     appears to the right of the menu. If the object in question is an

     embedded object, the Change Link option will be unavailable

     (dimmed). If it is a linked object, the Change Link option will

     not be dimmed.

5.Q. Is all the information (tables, queries, reports, and so on) that

     appears as part of a database actually stored in the database?

  A. All database information is stored in the database, with the

     exception of database "preferences" (choose Options from the View

     menu) and certain security information (users, their passwords,

     and group information), which are stored in the SYSTEM.MDA file.

6.Q. Is it possible to break out the information that is contained in a

     database (that is, tables) into individual files?

  A. You can use the Export option to export tables and other data to

     separate files (ASCII, dBASE, and so on). You can also export

     Microsoft Access objects to other Microsoft Access databases.

7.Q. Is some type of tool available that helps document applications?

     (For example, variables used, macros used, properties of different

     interface elements, and so on.)

  A. A tool called "Database Analyzer" is included with Microsoft

     Access that aids in this task. For information on using this

     tool, look in the PSSKB.TXT file, question number 23, or

     choose the Microsoft Access Q&A icon in the Access group in the

     Microsoft Windows Program Manager.

8.Q. Are memo fields part of a table, or are they stored in a

     separately linked file as is done in FoxPro, which has .DBF and

     .FPT files?

  A. They are part of a table and thus stored in the .MDB file.

9.Q. Can Microsoft Access create stand-alone applications?

  A. Currently, Microsoft Access does not create stand-alone

     applications. Since there is not yet a run-time version of

     Microsoft Access, a developer and his or her customers both

     require full working copies of Microsoft Access to run Microsoft

     Access applications. The developer distributes only the .MDB

     file(s) for the application to the customers.

     A run-time version of Microsoft Access is planned for the near

     future that a developer can distribute with his or her .MDB

     file(s) so that customers will not require a full working copy of

     Microsoft Access to run applications.

Additional reference words: 1.00 Misc Setup


PRB: Select All Not Grayed Even When No Items Are Available

 Article Number: Q90867

 CREATED: 22-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

In a form or report's Design view, the Select All command on the Edit menu

is never unavailable (dimmed), even when there are no controls to select.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1, and 2.0. We are researching this problem and will post new

information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. From the Database window, choose the Form button.

2. Choose the New button and then the Blank Form button to create

   a new form with no controls.

3. From the Edit menu, choose Select All. Select All is available,

   even though there are no controls on the form to select.

Additional reference words: 1.00 1.10 2.00 grey gray


PRB: Sizing Rows and Columns to Zero Works Differently

 Article Number: Q90868

 CREATED: 22-OCT-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you are viewing a table in Datasheet view, you can size a column's

width to zero. However, if you try to size a row's height to zero, you

receive the error message:

   The setting you entered isn't valid for this property

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open any table in Datasheet view.

2. Select any row.

3. From the Layout menu, choose Row Height.

4. Set the row height to zero, and then choose OK.


PRB: ReportWizard Select No Fields for Form Still Shows All

 Article Number: Q90869

 CREATED: 22-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Using the ReportWizard and not choosing anything for the fields you

want on your report will give you a report that includes all the

fields.

CAUSE

Based on feedback from users, this is the desired result of

choosing the Go To Last Page button, which bypasses the entire

design questioning of AccessWizards.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Choose the Report button and the New button in the Database window.

2. Select a table or query, then choose the ReportWizards button.

3. Select one of the three types of reports, then choose the OK

   button.

3. Choose the Next button without selecting any fields.

4. Select one of the three available looks for your report, then

   choose the Next button.

5. Choose the Print Preview button.

   Note that your report includes all the available fields even though

   you did not choose any fields for your report.

Additional reference words: 1.00 1.10 2.00 wizards


INF: Page Header Will Span Full Width Of Multi-Column Report

 Article Number: Q90870

 CREATED: 22-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

You can design a report in Microsoft Access that has a page header

that spans the entire width of the page, a group section header that

is the width of a column, plus has a multiple-column detail section.

To do this, the columns are defined in the Print Setup box as either

Vertical (also called snaking columns,) or Horizontal. This article

describes the steps to create a report with 3 across, 2 inch wide

snaking columns.

MORE INFORMATION

To create a grouped, multiple-column report where the page header

spans the width of the page, follow these steps:

 1. In report Design view, drag the right edge of any report section to

    the desired width of the report. For this example, drag the edge over

    to the 7 inch mark on the ruler.

 2. Choose Sorting and Grouping from the View menu and enter a field

    or expression in the Field/Expression box to group your data by.

 3. In the Group Properties section of the Sorting and Grouping dialog

    box, enter 'Yes' for Group Header.

 4. Using the Toolbox, create a Label and place it in the Page Header

    section. Enter the text for the label in the Caption property. Size

    the text box so it is the same width as the Page Header section.

 5. Using the Toolbox, create a text box bound to the group field. Place

    the text box in the Group Header. Size this control 2 inches wide

    or less, and place the left edge of the box along the left edge of

    the group section.

 6. In the detail section place your bound control(s) within the first

    2 inches.

 7. From the File menu, choose Print Setup.

 8. In the Print Setup dialog box, choose the More button.

 9. In the Items Across box, type the number of columns you want in the

    detail section. For this example, enter 3. Leave row and column

    spacing as they are.

10. In the Item Size section, clear the Same as Detail check box.

11. In the Width box, type the number of inches you want to allow for

    each column of data. For this example, enter 2.

12. Under Item Layout, select Vertical. This creates a snaking column

    report.

13. Choose OK.

14. Click on the group Header Section and display the property sheet.

    For the "New Row Or Col" property, choose Before Section. This

    causes the group header to print at the top of the column one time

    for each new group.

15. Print or Preview the report.

REFERENCES

==========

For other articles describing how to print the group header at the

top of continued columns, search in this Knowledge Base for:

   print and group's and name and subsequent and column and page

Microsoft Access "User's Guide," version 1.0, chapter 18, "Designing

Reports," and chapter 19, "Sorting and Grouping Data"

For additional information on columnar reports, search for "Multiple-

column reports" and "NewRowOrCol" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 columns snake checkpage


INF: ESC Key Turns Off Extend (Selection) Mode

 Article Number: Q90873

 CREATED: 25-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

When you enter extend (EXT) mode by pressing F8 within any object except

for modules, the only way to turn off extend mode is by pressing the ESC

key (this is reflected in the status bar).

REFERENCES

==========

For more information on extend mode, search for "Extend mode", then

"Selection Keys" using the Microsoft Access Help menu.

-or-

Search for the following keyword here in the Microsoft Knowledge Base:

   extend

Additional reference words: 1.00 1.10 2.00 ext extend checkpage


INF: Correct Procedure for Inserting New Field Above Existing

 Article Number: Q90874

 CREATED: 25-OCT-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

- Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

On page 51 of Microsoft Access "Getting Started," the procedure for

inserting a new field above an existing field is not correct. The

procedure outlined in the manual inserts the field under the existing

field instead of above it.

Step 1 for "Inserting a new field above an existing field" should be

changed from

   Click the row above which you want the new row to appear...

to:

   Click the row below which you want the new row to appear...


INF: Headers On Non-Continuous Forms Disable Scroll Bar

 Article Number: Q90875

 CREATED: 25-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

If you add a large form header to a non-continuous form, the

vertical scroll bar disappears and you will not have access to the

detail below the header.

MORE INFORMATION

It is better to size the header so that it fits within the limits of

the scrollbar range so that the form behaves in Form view just as it

does in Design view. The user must scroll the form down to see the

rest of the form. For example, this problem occurs if you want a

summary chart in the header, then detail charts below the header. The

scroll bars consider the header and the form to be all one object.

Additional reference words: 1.00 1.10 2.00


INF: Displaying List or Combo Boxes with More Than One Field

 Article Number: Q90876

 CREATED: 25-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article discusses information needed to display more than one

field in a list box or combo box.

MORE INFORMATION

If you enter an SQL command in the RowSource property for the control,

Microsoft Access can display more than one field in a list box or

combo list box. For example, if you want to combine two fields into

one list box, the syntax for the SQL command could be as follows:

   Select [FieldName1] & [FieldName2] from [TableName];

If you are using a bound column in the list, the bound column would

now apply to the placeholder in the SQL statement. In the above

example, a bound column setting of 2 would equate to FieldName2.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 9

Additional reference words: 1.00 1.10 2.00 listbox combobox row source


INF: Copy and Paste Operations from Forms to Queries

 Article Number: Q90877

 CREATED: 25-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

If you want to copy and paste SQL statements from the RowSource or

ControlSource property of a control or the RecordSource property of a form

or report to a query, you must use the CTRL+C method to copy to the

Clipboard. In Microsoft Access version 2.0, you should choose the Query

Builder button. For more information about the Query Builder, search for

"Query Builder" using the Help menu.

MORE INFORMATION

You cannot use the Copy and Paste commands from the Edit menu to copy and

paste in the situations described above. You must use CTRL+C to copy the

information to the Clipboard, and CTRL+V to paste the information into the

SQL statement.

Initially, after pasting the information into the RowSource, ControlSource,

or RecordSource property, the statement may appear truncated or incorrect.

Moving the focus off of the RowSource, ControlSource, or RecordSource

property should correct this.

Note that in Microsoft Access version 2.0, the View SQL window is a view

and not a modal dialog, therefore the menu commands are available. However,

if you are using the Query Builder, you do not need to copy the SQL

statement.

Additional reference words: 1.00 1.10 2.00


PRB: Primary Keys Not Used to Order Data in Combo/List Boxes

 Article Number: Q90878

 CREATED: 25-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If a table has a primary key and you use the table in a RowSource

property in a list box or combo box, you will see the data in

insertion order, not primary key order.

RESOLUTION

For historical reasons of the database, the order of insertion may

have importance. To view the table's contents in primary key order,

design a query that sorts on the primary key. Use the query as the

RowSource property for the list box or combo box.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 21-33 and 87-114

source

Additional reference words: 1.00 1.10 listbox combobox row checkpage


INF: Empty Table Created by SELECT INTO with No Matching Rows

 Article Number: Q90879

 CREATED: 25-OCT-1992

 MODIFIED: 06-AUG-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Using a SELECT INTO or APPEND query with criteria that has no matching

records causes an empty table to be created.

This behavior is by design.

References:

"Microsoft Access User's Guide," version 1.0, Chapter 6

Additional reference words: 1.00 1.10 SQL checkpage


PRB: Long WHERE Clause Is Truncated After View SQL Command

 Article Number: Q90880

 CREATED: 25-OCT-1992

 MODIFIED: 22-SEP-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

In Microsoft Access' Query By Example (QBE) grid, having a WHERE clause

greater than 255 characters causes that clause to be truncated if OK is

selected after the SQL command on View menu is used to see the SQL

statement, or the next time the query is opened in Design view. The

following error message appears:

   Expression is too long for the QBE grid and has been

   truncated...

The beginning of the expression is listed after the error message.

CAUSE

This problem most often occurs when a long WHERE clause using the

OR operator is entered into the QBE grid on the Criteria and Or

lines. To optimize performance, Microsoft Access may combine criteria

that are entered on separate lines. The limit for each QBE grid cell is

255 characters.

RESOLUTION

When two or more query lines are combined and the total number of

characters is greater than 255, do not view the SQL statement.

STATUS

This behavior is by design.

References:

"Microsoft Access User's Guide," version 1.0, Chapter 6

Additional reference words: 1.00 1.10 cut off shorten disappear


INF: DDE Link Cannot Find Data; Opens 2nd Copy of Server App

 Article Number: Q90881

 CREATED: 25-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Using Microsoft Access and Dynamic Data Exchange (DDE) to access

information from an open DDE server application, such as Microsoft

Excel, where the data does not exist causes the following error

message to be displayed:

   Remote data not accessible. Start application Excel?

If you choose the Yes button in the message dialog box, a second copy

of Microsoft Excel is started with the name of the non-existent

spreadsheet in its title bar.

MORE INFORMATION

This behavior is correct unless you already have a spreadsheet with

the name given in the DDE link open in Microsoft Excel. If the DDE

link cannot find the spreadsheet, a second copy of Microsoft Excel

will be launched using the filename given in the DDE statement.

However, the DDE standard is not to have running applications open

documents.

REFERENCES

==========

Microsoft Access "Introduction to Programming," version 1.0, Chapter 9,

"Dynamic Data Exchange"

Additional reference words: 1.00 1.10 2.00 errmsg checkpage


PRB: Two Users Can Open the Same dBASE Database Exclusive

 Article Number: Q90882

 CREATED: 25-OCT-1992

 MODIFIED: 12-NOV-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Two users using Microsoft Access can attach to the same dBASE file

over a network, even though one or both open the database using

the exclusive option in the Open Database dialog box.

CAUSE

If more than one user attempts to attach to a dBASE database file

using the exclusive option in the Open Database dialog box, the

attach action completes successfully, even though another user may

already have attached that database exclusively.

However, even though both users are able to attach to the table, only

one of the attached users is able to open the table. If the second user

attempts to open the table, he receives the error message:

   Couldn't Open File <filename>

If you start two sessions of Microsoft Access on the same machine and

attempt the procedure above, you get the same response, except that

you receive the error message:

   Database Exclusively Locked

In dBASE there is no exclusive database lock. In dBASE, records in

files are locked, not the entire file. In other words, one user can

open the first database exclusively, and a second user can open it

shared or exclusively. Therefore, the exclusive database lock can only

be recognized by Microsoft Access when it controls both attempts to

open the same file from the same machine.

STATUS

This behavior is by design.

REFERENCES

==========

"Microsoft Access User's Guide," version 1.0, Chapter 4

Additional reference words: 1.00 1.10 Checkpage Locking


PRB: Alert With Wrong Filename Given When Opening File Copied

 Article Number: Q90985

 CREATED: 26-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

On a computer with a shared drive, if a large database file is copied

to a new name or location, when another computer attempts to open

that database during the copy procedure, an error message occurs

stating the incorrect database name is corrupt or is not a Microsoft

Access database file.

Depending upon how the file was opened, the error message below

is given where "Modules" is not the correct name of the file being

opened:

NOTE: RO in the examples below means "Read Only."

   Opening Options             Error Message

   -------------------------------------------------------------

   RO:  No Exclusive:  No  --> "Database 'Modules' is corrupted"

   RO:  No Exclusive: Yes  --> "Couldn't access file 'filename'"

   RO: Yes Exclusive:  No  --> "Database 'Modules' is corrupted"

   RO: Yes Exclusive: Yes  --> "Couldn't access file 'filename'"

CAUSE

Due to the way file locking is placed upon a file by MS-DOS during the

copy procedure, Microsoft Access has no way of knowing what is happening

to the file being opened.

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10 2.00


PRB: Change Option Affects Only One Instance of MS Access

 Article Number: Q90986

 CREATED: 26-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When two instances of Microsoft Access are run on the same computer,

they both access the same SYSTEM.MDA, but the options for both do

not always appear to be the same after being changed in one

instance. However, the View option shows them both as being changed.

CAUSE

When there are two instances of Microsoft Access running on the

same computer, only the routines in the instance where the preferences

are changed are called. The other instance does not have its memory

copies updated.

STATUS

This behavior is by design.

MORE INFORMATION

Many options are stored in memory so that they do not have to be read

from the preferences table every time they are accessed. The mechanism

by which the memory and disk copies are kept in synchronization is the

array of routines that is called whenever a preference is changed.

When there are two instances of Microsoft Access running, only the

routines in the instance changing preferences are called. The other

instance does not have its memory copies updated, but the View options

shows them as being changed.

In order to make the preference take effect in another instance on the

same system, the user either needs to shutdown and reopen this

instance, or change the preference and resave it.

This is not an issue for users on separate systems, since their

preferences are stored per user.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, chapter 25, "Administering a

Database System"

Microsoft Access "User's Guide," version 1.0, Appendix D, "Setting Up

Microsoft Access on a Network"

Additional reference words: 1.00 1.10 2.00 checkpage


INF: Common Dialog Boxes Allow Only Lowercase Typing

 Article Number: Q90987

 CREATED: 26-OCT-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

You can type only lowercase letters in the File Name box in the New

Database, Open Database, Compact Database, Encrypt/Decrypt Database, and

Repair Database dialog boxes.

This behavior occurs because the File Name box in the common dialog box

template has the lowercase flag set so as to allow more characters to be

displayed in a given width. The behavior has no affect on the outcome of

any task or process, because Microsoft Access is not case sensitive in

filenames.


INF: How to Use Get, WritePrivateProfileString

 Article Number: Q90988

 CREATED: 26-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access does not have a function to store or access settings in

user-created applications (that is, a log of users, window position

settings, and so on). However, you can use the Microsoft Windows 3.1

Application Program Interface (API) through Access Basic to create user-

defined functions to store and access settings in a file outside the

database.

MORE INFORMATION

Definition Of Variables Used

----------------------------

Variables Required By GetPrivateProfileString and

WritePrivateProfileString:

   lpfilename$        - Filename looked for in Windows directory by

                        default

   lpapplicationname$ - Section title in square brackets in the .INI

                        file

   lpkeyname$         - The section in the .INI file where the

                        information is located

   lpDefault$         - What information to give if there is no value

   lpreturnedstring$  - Information asked for from the .INI file

   nSize%             - Maximum number of characters the buffer holds of

                        information returned

   lpString$          - The information saved in the .INI file

User-Defined Variables

----------------------

   GotInfo  - Information retrieved from the level requested

   GetInfo$ - Used to pass the lpkeyname$ to function GetInfo

   Where$   - Used to pass the lpkeyname$ to function WriteIni

   Info$    - Used to pass the lpString$ to function WriteIni

How to Create the Functions

---------------------------

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

1. Create a new module.

2. Type the following declarations in the Global Declarations section:

      Option Explicit

      Declare Function GetPrivateProfileString% Lib "Kernel"_

                              (ByVal lpapplicationname$,_

                               ByVal lpkeyname$,_

                               ByVal lpDefault$,_

                               ByVal lpreturnedstring$,_

                               ByVal nSize%, ByVal lpfilename$)

      Declare Function WritePrivateProfileString% Lib "Kernel"_

                              (ByVal lpapplicationname$,_

                               ByVal lpkeyname$,_

                               ByVal lpString$,_

                               ByVal lpfilename$)

      Dim GotInfo As String

3. Type the following functions in the module:

      Function GetIni (GetInfo$)

      Dim lpfilename$, lpapplicationname$, lpkeyname$, lpDefault$, _

                                       lpreturnedstring$

      Dim nSize%

         lpfilename$ = "<YOUR.INI>"

         lpapplicationname$ = "<Your Section>"

         lpkeyname$ = GetInfo$

         lpDefault$ = "No Value"

         lpreturnedstring$ = Space$(255)

         nSize% = Len(lpreturnedstring$)

         GetIni = GetPrivateProfileString(lpapplicationname$,_

                                       lpkeyname$, lpDefault$,_

                                       lpreturnedstring$, nSize%,_

                                       lpfilename$)

         GotInfo = lpreturnedstring$

      End Function

      Function WriteIni (Where$, Info$)

      Dim lpapplicationname$, lpkeyname$, lpString$, lpfilename$

         lpapplicationname$ = "<Your Section>"

         lpkeyname$ = Where$

         lpString$ = Info$

         lpfilename$ = "<YOUR.INI>"

         WriteIni = WritePrivateProfileString(lpapplicationname$,_

                                       Where$, Info$, lpfilename$)

      End Function

How to Use the Functions

------------------------

1. When used in a macro, the function WriteIni() creates the entry

   First=<TIME> in the file <YOUR.INI> in the [<Your Section>] section.

   The following line calls the function:

      =WriteIni("First","<TIME>")

   In the file <YOUR.INI> the entry looks like the following:

      [<Your Section>]

      First=<TIME>

2. Use the function GetIni() in a macro to return <TIME> in the variable

   GotInfo as follows:

      =GetIni("First")

   The variable GotInfo now holds the value <TIME> and can be used anywhere

   needed in the application.

NOTE: This example does not have error trapping. Unexpected results

may occur if the declarations and the variable types are not correct

or your file is not in the location specified or does not exist.

REFERENCES

==========

Microsoft Access "Introduction to Programming," version 1.0, chapters 1-5

Microsoft Access "Language Reference," version 1.0, Part 1

"Microsoft Windows Software Development Kit," Microsoft Press, 1992

"Programming Windows: the Microsoft Guide to Writing Applications for

Windows 3," Charles Petzold, Microsoft Press, 1990

"Programmer's Reference Library: Microsoft Windows 3.1 Guide to

Programming Reference," Volumes 1-6, Microsoft Press, 1992

Additional reference words: 1.00 1.10 2.00 checkpage


INF: How to Find if an Object Exists in the Database

 Article Number: Q90989

 CREATED: 26-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

It may be necessary to check for the existence of an object before the

creation of a new table, form, report, and so on, using Access Basic.

This article explains how functions can check for the existence of a

given object.

MORE INFORMATION

Definition of Variables Used

----------------------------

ObjectFound% - a test variable. If -1 then the object exists, otherwise

it does not.

WhatObjectType$ - the object type of the item in question.

ObjectName - the name of the item in question.

Follow these four steps to create a user-defined function to check for

the existence of a given object:

1. Choose Module from the database window.

2. Choose New to create a new module.

3. Type the following function that checks for the existence of a given

   object:

      Function ObjectExists% (WhatObjectType$, ObjectName$)

         Dim ObjectFound%

         On Error Resume Next

         If WhatObjectType = "Form" Then

            DoCmd SelectObject A_FORM, ObjectName, True

         ElseIf WhatObjectType = "Table" Then

            DoCmd SelectObject A_TABLE, ObjectName, True

         ElseIf WhatObjectType = "Macro" Then

            DoCmd SelectObject A_MACRO, ObjectName, True

         ElseIf WhatObjectType = "Module" Then

            DoCmd SelectObject A_MODULE, ObjectName, True

         ElseIf WhatObjectType = "Report" Then

            DoCmd SelectObject A_REPORT, ObjectName, True

         ElseIf WhatObjectType = "Query" Then

            DoCmd SelectObject A_QUERY, ObjectName, True

         Else

            MsgBox WhatObjectType & " type does not exist!"

            WhatObjectType = "False"

         End If

         If Err <> 2544 And WhatObjectType <> "False" Then

         'Object was found in the Database Container (DBC)

            Err = 0     'Reset the error level

            ObjectFound% = -1

         Else           'Object was not found in the DBC

            ObjectFound% = 0

            MsgBox "Error #" & Err & ": " & Error

            'Give error number and message

         End If

         ObjectExists% = ObjectFound%

      End Function

This function returns a value of True (-1) if the object exists. If

the object does not exist, or an error is encountered, the function

will return a value of False (0).

To use the function ObjectExists, do the following:

Choose Immediate Window from the View Menu while in a module, then

type:

   ?ObjectExists("object type","Object name")

NOTE: Where "object type" is "Form", "Table", "Macro", "Module",

"Query", or "Report" and "object name" is the name of the object in

question. An sample call would be:

   ?ObjectExists("Table","Employees")

If the object exists, the Database window becomes active and the

object is selected. If the object does not exist a message box pops up

stating the error that occurred and that the object does not exist. If

the object type is incorrect, a message box pops up stating that the

object type does not exist.

NOTE: One side effect of the above function is that it will make your

Database window visible and have the focus if the table exists. This

can be corrected with a test function to find the Visible state of the

Database window and change it and the focus as desired.

REFERENCES

==========

"Microsoft Windows Software Development Kit", Microsoft Press, 1992

"Programming Windows: the Microsoft Guide to Writing Applications for

Windows 3", Charles Petzold. Microsoft Press, 1990

"Programmer's Reference Library: Microsoft Windows 3.1 Guide to

Programming Reference" Volumes 1 - 6, Microsoft Press, 1992

Additional reference words: 1.00 1.10 2.00


PRB: Cannot Scroll Left in Form's Design View with Rulers

 Article Number: Q90990

 CREATED: 26-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

In a form's Design view, with both Microsoft Access and the form

maximized, turning the rulers off and then selecting and dragging a

control on a form to the left does not give expected results.

The control will not scroll left until the ruler is turned back on.

You can, however, move and scroll by using the "thumb" (scroll bar

box) manually. Turning the rulers off and selecting and dragging a

control right widens the form.

CAUSE

Microsoft Access will scroll left if the edge of the form is

encountered while dragging a control. With everything maximized,

the control being dragged does not run into the edge of a form or

window; it runs into the edge of the screen. The other edges have

Microsoft Access objects (scroll bars or menu bars) so Microsoft

Access is aware that the control is being dragged and will scroll

accordingly.

STATUS

This behavior is by design.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 8, "Form Basics," and

Chapter 9, "Designing Forms"

Additional reference words: 1.00 1.10 2.00 size move checkpage


INF: Transparent Text Boxes Not Supported

 Article Number: Q91045

 CREATED: 27-OCT-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

The default label control associated with a text box control has a

BackStyle property that can be changed to Clear on the color palette,

but the text box itself has no such property and cannot be changed to

Clear on the color palette.

To work around this limitation, change the BackColor property of the

text box to the same color as the background it overlays.

Additional reference words: 1.00 1.10 2.00 back color style


INF: SQL Server Triggers and Key Values to and from MS Access

 Article Number: Q91179

 CREATED: 29-OCT-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

If a Microsoft Access procedure sends a record to a SQL Server to insert

into a SQL Server table, and the unique key for the record is created by

a trigger on that table, the Microsoft Access procedure will lose reference

to the record.

MORE INFORMATION

When information is sent to a SQL Server table, Microsoft Access looks at

the record and determines a unique key value using the information in that

record. When the data is passed to a SQL Server backend to be inserted

into a table and a trigger creates a unique key value for the record,

Microsoft Access will lose reference to that record because the unique key

stored by Microsoft Access is different than the unique key created by the

trigger on SQL Server. Until it is queried on using the new unique key

value, Microsoft Access views the record just sent to SQL Server as having

been deleted.

REFERENCES

==========

For more information on SQL Server, search for "SQL Server" using the

Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 XPROD


PRB: Expression in Query Grid Does Not Show All Text

 Article Number: Q91705

 CREATED: 03-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you are entering an expression in the QBE grid, Microsoft Access does

not fill a cell all the way to its right. On long expressions, it may look

like your expression or column name is cut off before the end of the cell.

CAUSE

Microsoft Access reserves a portion of the cell to display the drop-down

arrow. Your expression remains unchanged.  This is also true in property

sheets.

RESOLUTION

Click the cell and press SHIFT+F2 to view the entire expression in the Zoom

window.  You can also change the size of the cell by dragging the cell

border at the top of the grid.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open any database.

2. Create a new unbound query.

3. Enter the following expression in the first field cell:

      [Unit Price]*[Quantity]

4. Press TAB or ENTER to move to the next column. Note that the expression

   appears to be truncated.

REFERENCES

==========

For more information on the Zoom window, search for "Zoom" then "Zoom

Command (Shortcut Menu)" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


INF: Use CTRL+M to Open Objects in Design View

 Article Number: Q91707

 CREATED: 03-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

You can use the CTRL+M key combination to force any object in the

Database window to open in Design view.

MORE INFORMATION

Steps to Reproduce Behavior:

----------------------------

1. Select any object in the Database window.

2. Press CTRL+M.

The object that you selected will open in Design view.

Additional reference words: 1.00 1.10 2.00


PRB: Query Design Status Bar Does Not Have Help Message

 Article Number: Q91708

 CREATED: 03-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

In a query's Design view, the status bar does not display

"F6=Switch Panes F1=Help" as it does in table and macro Design views.

STATUS

This behavior is by design.

MORE INFORMATION

A query's Design view offers the use of F1 to display Help, and F6 to

switch panes, in the Design window.

Additional reference words: 1.00 1.10 2.00


PRB: Changing Caption on Title Label Leaves Shadow Unmodified

 Article Number: Q91709

 CREATED: 03-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Changing the Caption on the title label leaves the shadow of the

original title bar present. This occurs when creating a form with any

FormWizard (other than Graph) using Embossed View.

STATUS

This behavior is by design. There are two labels associated with this

caption.  The shadow is really another separate label that gives the

impression of a shadow.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new form using any FormWizard, except Graph.

2. Select Embossed as the View for the form.

3. Open the form in Design view.

4. Select the title and change the Caption to something shorter than

   the current title.

5. Change to a smaller point size to make the shadow more visible.

6. Switch to Form view.

In order to use the Embossed View and the new title correctly, you

must also select the shadow and change it.

Additional reference words: 1.00 1.10 2.00 embossed


PRB: No Implicit Parameters on CrossTab Queries

 Article Number: Q91710

 CREATED: 03-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you create a crosstab (XTAB) query using an implicit parameter

[XXX] in a WHERE clause (criteria), Microsoft Access returns the

following error when you attempt to run the query:

   Can't bind name '[XXX]'

If you use an explicit parameter, the query works as expected.

CAUSE

A crosstab query dynamically generates column names. Therefore,

Microsoft Access cannot tell whether [XXX] is referring to a parameter

or a column name until after the query is bound.

When you build a graph, Microsoft Access uses a crosstab to build the

data to graph. If the query is a parameter query, you have to define

the parameters explicitly as you would for a normal crosstab query.

RESOLUTION

To avoid this error, define [XXX] as an explicit parameter by adding

it to the Query Parameters dialog box.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create a new crosstab query on the Order Details table.

3. Drag the fields Unit Price, Discount, and Order ID to the QBE grid,

   and set the values in the grid as follows:

      Crosstab Query: Query1

      ---------------------------------

      Field: Unit Price

         Total: Group By

         Crosstab: Row Heading

         Criteria: > [Enter an Amount:]

      Field: Discount

         Total: Group By

         Crosstab: Column Heading

      Field: Order ID

         Total: Count

         Crosstab: Value

4. Run the query. The following error message is displayed:

      Can't bind name '[Enter an Amount:]'.

5. Choose OK to return to query design, and then select Parameters

   from the Query menu.

6. Enter the following under Parameters:

      [Enter an Amount:]

7. Select Currency as the Data Type, and choose OK.

8. Run the query and type any amount (for example, type "2").

   The query executes.

REFERENCES

==========

For more information on parameter queries, search for "parameter query"

then "Creating a Parameter Query" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 can't checkpage


PRB: "Couldn't Open File" Error Message Using Paradox Table

 Article Number: Q91711

 CREATED: 03-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

----------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

----------------------------------------------------------------------

SYMPTOMS

You cannot open an attached Paradox table from within Microsoft Access, or

you experience an "Unexpected Condition" error message in Paradox when you

attempt to view a table.

Paradox and Microsoft Access should be able to simultaneously access the

same Paradox tables if there is only one PARADOX.NET file in use by both

programs.

CAUSE

Microsoft Access

----------------

If you receive the error message "Couldn't open file 'filename'" when you

try to open an attached Paradox table while you are in Microsoft Access,

you may have two PARADOX.NET files. In this case, Microsoft Access may be

using one PARADOX.NET file while Paradox is using the other.

There are other conditions that can cause this error message as well. For

more information, search for "Error Messages Reference" using the Microsoft

Access Help menu.

Paradox

-------

If you receive an error message similar to

   Unexpected condition: File open (I104) - c:\pdoxdata\yourfile.db

   (Code 5) -- Leaving Paradox

when you attempt to open a table while you are in Paradox, the cause is the

same as above: there are two PARADOX.NET files, with Microsoft Access using

one and Paradox using the other.

RESOLUTION

When you attach a Paradox version 3.0 or 3.5 table (<filename>.DB)

in Microsoft Access, file locking information is maintained by

PARADOX.NET, the Paradox network control file. Paradox requires this

file in network environments, but it is also used in stand-alone

configurations.

Microsoft Access places a PARADOX.NET file in the Microsoft Access

program directory during the Setup process. An entry is made in the

MSACCESS.INI file in the [Paradox ISAM] section pointing to the

location of the file. The MSACCESS.INI file should be in your Windows

directory. The entry will be similar to:

   [Paradox ISAM]

   ParadoxNetPath=C:\ACCESS\

Paradox also installs a PARADOX.NET file during normal installation.

By default it will be located in the Paradox program directory. The

location of this file is determined by the network administrator

during a network installation.

To redirect Microsoft Access to the location of the PARADOX.NET file

that Paradox installed, edit the MSACCESS.INI file in any text editor,

such as Notepad, and change the path. Do not include the name of the

file.

To change the Paradox configuration to point to the Microsoft Access

PARADOX.NET file, run the NUPDATE.EXE utility. Refer to the Paradox

"Network Administrator's Guide" for more information on this topic.

Additional reference words: 1.00 1.10 2.00 ISAM PDOX


INF: Height, Width Settings Do Not Affect Size of Objects

 Article Number: Q91712

 CREATED: 03-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Setting the Height and Width properties for an object within an option

group does not affect the size of the option button or check box. Instead,

it only increases or decreases the area you can click to select the option

button or check box.

MORE INFORMATION

Adjusting the Height and Width properties for an object within an option

group increases or decreases the area you can click to select the specific

option button or check box. Setting these properties does not affect the

visible size of the object.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, chapter 9, "Designing Forms,"

pages 247-252

Additional reference words: 1.00 1.10 2.00 checkpage


PRB: Grid Lines Not Visible in Access When Using Wizards

 Article Number: Q91713

 CREATED: 03-NOV-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The grid is not visible in Design view when you are using FormWizards or

ReportWizards.

CAUSE

FormWizards and ReportWizards both use default GridX and GridY property

values of 64. The grid is not visible when GridX and GridY settings of

greater than 16 are used. The default GridX and GridY settings are in the

visible range when you are not using the wizards.

RESOLUTION

You can make the grid visible by setting the form or report's GridX and

GridY properties to 16 or less.

MORE INFORMATION

Grids are composed of dots that appear in a report or form's Design view.

These dots help you position controls more precisely by letting you

increase or decrease the fineness of the grid. The GridX and GridY

property settings reflect the number of dots per unit of measurement. The

unit of measurement is usually inches, but will vary with the settings in

the Windows Control Panel. Allowable values for GridX and GridY

properties are from 1 to 64.


PRB: Toolbars Do Not Use Control Panel Button Face Color

 Article Number: Q91714

 CREATED: 03-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Changing the Button Face color in the Colors utility in Control Panel does

not change the toolbar's background color.

MORE INFORMATION

Altering the Button Face color in Control Panel will change the color

of buttons and the status bar in Microsoft Access. In other applications

the color of the toolbar will change as well. However, toolbars in

Microsoft Access are predefined forms that derive their color from the

form's BackColor property. This property cannot be set through Control

Panel.

If you want to change the colors in Microsoft Access, you can open and edit

the forms contained in the UTILITY.MDA file.

CAUTION: You should backup the UTILITY.MDA file before making modifications

to it.

NOTE: Be aware that changes to the UTILITY.MDA file are not supported by

Microsoft Product Support Services.

Additional reference words: 1.00 1.10 2.00


PRB: Text May be Hard to Read on an EGA Screen

 Article Number: Q91715

 CREATED: 03-NOV-1992

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Text may be hard to read or appear slightly off-center when using an

EGA video driver. This condition may worsen if you use a gray

background. This is particularly true of option buttons.

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10 2.00 WinIss


PRB: Two Labels on Top of Each Other Both Print

 Article Number: Q91716

 CREATED: 03-NOV-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you have two labels on top of each other, both labels may print using

the following Windows printer drivers and the hardware printer fonts:

   Windows 3.0:

      CANONIII

      DESKJET

      IBM4019

   Windows 3.0 SDL:

      BROHL24

      CANONIII

   Windows 3.1:

      HPPCL5A

      IBM4019

      LBPIII(Canon)

CAUSE

This is a limitation of the printer driver.

RESOLUTION

Do not place labels on top of each other.

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10 2.00 PtrIss


INF: Form Sizing Grid Accepts Non-Integer Values

 Article Number: Q91720

 CREATED: 03-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you use the Grid option in Design view for either a form or a

report, non-integer values are accepted, but are rounded to the nearest

integer.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open a report or form in Design view.

2. Change a Grid property to any non-integer value.

3. Upon exiting the field, the value you entered is rounded to

   the nearest integer.

Additional reference words: 1.00 1.10 2.00 grid


PRB: FormWizard Labels Placed on Left Margin Grow Down

 Article Number: Q91721

 CREATED: 03-NOV-1992

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

New labels added at the left margin of a form created by FormWizards using

a single-column format appear to grow down instead of out towards the right

margin.

CAUSE

The single-column format of the FormWizards sets the default text alignment

for a label to right justified. This means that as characters are added to

the label, it stretches to the left rather than the right. If the label

runs into the left edge of section, it word-wraps down to the next line.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a bound form using a FormWizard and choose Single Column.

2. Open the form in Design view.

3. Create a label on the left side of the form in any section.

4. Enter text in the label.

Additional reference words: 1.00 1.10 2.00


PRB: Cannot Install Cue Cards Without Installing Help in Versi

 Article Number: Q92639

 CREATED: 12-NOV-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

During a custom Microsoft Access version 1.x installation, you can select

and clear options in the Microsoft Access Setup Options dialog box. If you

clear the Help option, the size of the Cue Card files increases from 1688K

to 5112K. However, the total disk space required does not increase and the

size of Help does not decrease from 3424K to 0K.

CAUSE

In Microsoft Access 1.x, you must have the Help files loaded in order to

use Cue Cards. Therefore, when you clear the Help option, the size of the

Cue Cards files increases to include the size of the Help files.

STATUS

This behavior is by design. However, in Microsoft Access version 2.0, you

do not have to install the Help files to use Cue Cards. Therefore, when you

clear the Help option, the size of the Cue Cards files is not affected.

Additional reference words: 1.00 1.10


INF: How to Take a Control Out of the Tab Order

 Article Number: Q92640

 CREATED: 12-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access version 2.0 has a TabStop property that you can use to

remove a control from the tab order. Microsoft Access version 1.x does not

have this property, but you can use one of the methods described below to

remove a control from the tab order.

MORE INFORMATION

Method 1

--------

Place the control in the form header or footer. Each section on a form has

its own tab order, so the form user would have to explicitly move from the

detail section to the header or footer to use the control.

Method 2

--------

Place an unbound, hidden text box in the tab order before the control. Set

the text box's OnEnter property to a macro that selects the first control

on the form.

This solution is one that FormWizards also use. Put all of your regular

controls in the detail section of the form first in the tab order, then

place an unbound, hidden text box on the form, and finally place any

buttons on the form. In the OnEnter property of the hidden text box, use a

macro to set focus to the first of your regular controls.

REFERENCES

==========

For more information, search for "tab order" then "Tab Order Command (Edit

Menu)" or "Setting Tab Order" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 checkpage


INF: Differences Between Native and Attached Tables

 Article Number: Q92644

 CREATED: 12-NOV-1992

 MODIFIED: 29-DEC-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Attached tables created in other applications (such as Paradox,

dBase IV, and so forth) are different from native Microsoft Access

tables in the following four ways:

a. In the table list, icons for attached tables contain black arrows.

b. When you try to open an attached table in Design view, the

   following error message appears:

   Table 'xxxxx' is an attached table. Some properties can't be

   modified. Open it anyway?

c. When you delete an attached table, its contents are not deleted;

   only the table entry is deleted from the list. However, the error

   message is the same as for a deleted Microsoft Access table, in

   which the contents actually are deleted.

d. You cannot define relationships between attached tables, nor

   between native Microsoft Access tables and attached tables.

Paradox is manufactured by Ansa Software, a Borland company, and dBASE

IV is manufactured by Borland International, Inc., vendors independent

of Microsoft; we make no warranty, implied or otherwise, regarding

these products' performance or reliability.

Additional reference words: 1.00 1.10


INF: How to Remove Relationships

 Article Number: Q92649

 CREATED: 12-NOV-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article explains how to delete a relationship in Microsoft Access

once it has been created.

MORE INFORMATION

The sample database NWIND.MDB contains a relationship between the

Employees and the Orders tables. The following steps demonstrate how to

delete this relationship:

1. Open the NWIND database.

2. From the Edit menu, choose Relationships.

3. In the Primary Table box, select Employees.

4. In the Related Table box, select Orders. Since these tables already

   have a relationship, Microsoft Access displays Employee ID in the

   Select Matching Fields box, and makes the Add button unavailable.

5. Choose the Delete button to remove the existing relationship.

6. Chose Close to exit the Relationships dialog box.

Note that you can also view existing relationships by creating a query.

Include all the tables in your database in the query, and Microsoft

Access will display join lines to indicate existing relationships.

REFERENCES


PRB: OLE Excel Format Changes when Updated in Microsoft Access

 Article Number: Q92650

 CREATED: 12-NOV-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

New OLE objects created in Microsoft Excel version 4.0 are displayed

without row or column headings in Microsoft Access version 1.x. Once the

object has been updated, the display changes and row and column headings

are displayed.

STATUS

This problem no longer occurs in applications using OLE 2.0, such as

Microsoft Access version 2.0 and Microsoft Excel version 5.0.

MORE INFORMATION

Steps To Reproduce Behavior

---------------------------

1. Start Microsoft Excel.

2. Enter "Test" in cell A1.

3. Select cell A1 and choose Copy from the Edit menu.

4. Start Microsoft Access and open a database.

5. Create a new form and choose Paste from the Edit menu.

   This creates an OLE Object which displays cell A1.

6. Double-click on the OLE Object to activate Excel.

7. Modify the contents of cell A1.

8. From the File menu choose Update.

9. Activate Microsoft Access.

The OLE Object now displays row and column headings. You may need to resize

the OLE Object to see the updated contents of cell A1.

Additional reference words: 1.00 1.10


PRB: Microsoft Excel Custom Date Format Not Detected by Import

 Article Number: Q92651

 CREATED: 12-NOV-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you import a Microsoft Excel version 4.0 spreadsheet containing custom

date formats into a new Microsoft Access version 1.x table, Microsoft

Access gives the fields Double data types, instead of Date/Time data types.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new Microsoft Excel version 4.0 spreadsheet.

2. Enter a date in cell A1.

3. Assign a date format, such as mmmmmm/dd/yyyy, to the cell.

4. Import the spreadsheet to Microsoft Access. Note that the date is

   formatted as a Number data type instead of a Date/Time data type.

REFERENCES

==========

For more information about importing Microsoft Excel data, search for

"Excel" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10


PRB: Cannot Attach Paradox Table on Read-Only Drive

 Article Number: Q92653

 CREATED: 12-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You cannot attach a Paradox table (*.DB) located on a read-only drive. If

you try to attach a Paradox table on a read-only drive, you receive the

following error message:

   Couldn't open file '<FILENAME#DB>' (in Microsoft Access version 1.x)

   -or-

   Couldn't lock table '<tablename.db>', currently in use by user

   '<username>' on machine '<machinename>' (in Microsoft Access version

   2.0)

CAUSE

Neither Paradox nor the Paradox indexed sequential access method (ISAM)

shipped with Microsoft Access supports databases located on read-only

drives.

STATUS

This behavior is by design.

MORE INFORMATION

Paradox is manufactured by Borland International, Inc., a vendor

independent of Microsoft; we make no warranty, implied or otherwise,

regarding this product's performance or reliability.

Additional reference words: 1.00 1.10 2.00


INF: How to Create a Graph Without a Title

 Article Number: Q92655

 CREATED: 12-NOV-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

In Microsoft Access version 1.x, when you create a graph in a form's

Design view using the Graph Wizard, Microsoft Access fills in the default

value "Graph" if no title is specified for the chart.

MORE INFORMATION

To work around the default "Graph" title created by the Graph Wizard in

Microsoft Access 1.x, you can change the font color of the graph's title by

following these steps:

1. Launch the Microsoft Graph Server from the form's Design view by

   choosing Insert Object from the Edit menu.

2. Double-click the graph title.

3. Choose Font from the Format menu.

4. Change the font color to the same color as your form background color.

5. Close Microsoft Graph and answer Yes when you are prompted to update.

6. Save the form.

The title now blends in with the form background.

Additional reference words: 1.00 1.10


PRB: CTRL+HOME Navigation Problem in Macro Design View

 Article Number: Q92665

 CREATED: 12-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you press the key combination CTRL+HOME when you are in Design

view of a new macro, the cursor might not move to the beginning of

the macro, as you might expect.

CAUSE

If you click in the Action column you are in Edit mode for the current

macro line; pressing CTRL+HOME moves the cursor to the beginning of

the drop-down list. If you click in any Comments column that is

empty, you are already at the beginning of the field.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new macro.

2. Click in the Comments column of any row but the first.

3. Press CTRL+HOME.

Nothing happens. If you navigate with the arrow keys after clicking in

the Comment section, pressing CTRL+HOME positions you on the first

line of the macro.

Additional reference words: 1.00 1.10 2.00


INF: No Permission to Modify Data in a Table

 Article Number: Q92667

 CREATED: 12-NOV-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you try to modify data in a table in Datasheet view, you receive

the error message

    No permissions for '<table name>'

even though you were able to open the table without receiving any

error messages.

MORE INFORMATION

This error message indicates that you have only Read Definitions (in

Microsoft Access version 1.x) or Read Design (in Microsoft Access version

2.0) permissions on the table. Because you have permission to view the

data, no error message is displayed when you first open the table in

Datasheet view, which is the default.

When you try to open the table in Design view, the following error

message is displayed:

    You don't have permission to modify '<table name>'.

    Open as read-only?

This message appears because you have no security permissions to open

the table in Design view.

REFERENCES

==========

For more information on permissions, search for "permissions

command" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 errmsg


PRB: Cannot Exit Extend Mode in Parameters Dialog Box

 Article Number: Q92669

 CREATED: 12-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you press ESC to cancel Extend mode in the Query Parameters dialog box,

you cancel the dialog box. Your work is not saved.

CAUSE

Pressing F8 turns Extend mode on (EXT appears in the status bar). Once

Extend mode is on, pressing F8 repeatedly extends the selection to the

word, the field, the record (in Datasheet and Form view), and all records

(in Datasheet and Form view). Pressing SHIFT+F8 reverses the selection, but

will not take you out of Extend mode. To turn off Extend mode, press ESC.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new, unbound query.

2. From the Query menu, choose Parameters.

3. Enter a couple parameters with more than one word in each.

4. Click in the center of a word and press F8 to enable Extend mode.

5. Press ESC to cancel Extend mode. The Query Parameters dialog box is

   canceled.

Additional reference words: 1.00 1.10 2.00


PRB: Default Width in Report Design Does Not Reflect Margins

 Article Number: Q92670

 CREATED: 12-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The default grid area is independent of how a report or form is printed.

The controls you place in the document determine the size.

In the United States, the default width of the grid area is set to 5

inches, regardless of the print settings (paper size, orientation, and

margins). There is no relationship between the default grid area size and

the default paper size or print area.

STATUS

This behavior is by design.

REFERENCES

==========

For more information on how to change the default layout for forms or

reports, search for "template" then "Creating a New Template for Forms and

Reports" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 defaults


INF: Error When Opening Table in Table Design View

 Article Number: Q92671

 CREATED: 12-NOV-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

You may receive the following error message in Microsoft Access version 1.x

when you are attempting to open a table in Design view:

   Unable to recover from attempt to switch view. Window

   will be closed.

In Microsoft Access version 2.0, the message is:

   Can't switch to Datasheet view and can't return to Design view.

Microsoft Access then returns focus to the Database window.

MORE INFORMATION

This error message occurs only in rare situations. It is an informational

message only, not a program error.

Steps to Reproduce Behavior

---------------------------

1. Two users (User A and User B) both open the sample database NWIND.MDB

   non-exclusively.

2. Both users open the Categories table in Datasheet view.

3. Both users simultaneously switch to Design view. User A succeeds, but

   User B receives the following error message in Microsoft Access 1.x:

      Table is in use, cannot lock by user '<user B's logon name>'

      on machine <user B's machine name>'.

   In Microsoft Access 2.0, the message is:

      Can't open table 'Categories' for modification. Open it read only?

4. User B tries to reopen the table in Datasheet view, and receives

   the following error message:

      Couldn't lock table. Table 'Categories' is exclusively

      locked by user '<user A's logon name>' on machine '<user

      A's machine name>'.

5. User B is returned to the Database window with the following Microsoft

   1.x error message:

      Unable to recover from attempt to switch view. Window

      will be closed.

   The error message from Microsoft Access 2.0 is:

      Can't switch to Datasheet view and can't return to Design view.

6. Microsoft Access returns User B's focus to the Database window.

When in Datasheet view (step 3), both users have the table open non-

exclusively. When they try to switch to Design view, they are actually

closing the table and attempting to re-open it exclusively.

In the example above, User A succeeds and User B fails. When User B then

tries to reopen the table (non-exclusively) in Datasheet view, User A

already has the table open exclusively.

The error message in step 5 in an informational message designed to let

User B know that Microsoft Access is unable to open the table in either

Datasheet or Design view.

Additional reference words: 1.00 1.10 2.00 errmsg


PRB: TransferDatabase Macro Accepts Invalid File Names

 Article Number: Q92674

 CREATED: 12-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When using the TransferDatabase macro action to export a database,

Microsoft Access allows you to enter file names that include spaces in

the Destination argument. Once the database is exported with a file name

that includes a space, Microsoft Access will not be able to import that

file. If you try to import the file, the following error message appears:

   The filename is not valid

RESOLUTION

If you export a file with a blank embedded in the filename, renaming

the file without the space, using File Manager or MS-DOS, enables

Microsoft Access to import the file.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a table and call it Table1.

2. Create the following new macro:

      Macro Name   Condition   Action

      -----------------------------------------

      Macro1                   TransferDatabase

      Macro1 Action

      -------------------------------------

      TransferDatabase

      Arguments          Attribute

         Transfer Type:    Export

         Database Type:    Dbase or Paradox

         Database Name:    c:\access

         Object Type:      Table

         Source:           Table1

         Destination:      Test Table

         Structure Only:   No

3. Run the macro. This macro creates a file called Test Tab.xxx where xxx

   is the appropriate extension for the export type.

4. Try to import this file. Microsoft Access displays the message:

      Test Tab.xxx This filename is not valid

Additional reference words: 1.00 1.10 space


PRB: Insert Object Dirties Record

 Article Number: Q92675

 CREATED: 12-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Placing the insertion point in a field with the data type OLE Object,

choosing Insert Object from the Edit menu, and then clicking the cancel

button in the Insert Object dialog box will "dirty" a record. A dirty

record is one that has been edited.

If the field is part of an existing record, the previous contents of

the field are not deleted or modified, but the record is rewritten

when you leave it.

STATUS

This behavior is by design.

MORE INFORMATION

Steps To Reproduce Behavior

---------------------------

1. Open a table that includes an OLE object field.

2. Place the insertion point in the OLE object field.

3. Select Insert Object from the Edit menu, then choose Cancel.

4. The record selector now indicates that the record is dirty by

   displaying the pencil indicator.

Additional reference words: 1.00 1.10 2.00


PRB: Subform Not Updated

 Article Number: Q92676

 CREATED: 12-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

As you scroll through records in the main form, your subform is not

updated. The records on the main form and the subform are not

synchronized.

CAUSE

Your subform is not linked to the main form.

RESOLUTION

You should use the LinkMasterFields and LinkChildFields form

properties to link your main form and subform automatically. You may

manually update the subform by pressing the F9 (recalculate) key.

STATUS

This behavior is by design.

MORE INFORMATION

Recalculation occurs automatically for controls that reference other

fields on the same form, or fields in subforms. Recalculation does not

occur automatically for subform controls that only reference fields on

the main (master) form, or in other subforms.

This is because subforms notify the master form of any changes, but

the master form does not notify the subforms of changes. Nor do

subforms on the same main form notify one another of any changes.

REFERENCES

==========

For more information, search for "Link: main form and subform" then

"function keys" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


PRB: Scrolling to Bottom of Module Window Goes Past Typed Info

 Article Number: Q92677

 CREATED: 11-NOV-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

In a Module window, moving the vertical scrollbar thumb control all

the way to the bottom takes you past the end of your program. You must

manually scroll back up to locate the end of your code.

CAUSE

The scrollbar indicates your position relative to the module's data

boundaries, rather than your position relative to the current

information in the module. Therefore, it is likely that at some point

you entered information some distance below the end of your current

code. Even though that information has been deleted, the module's

boundaries still reflect the furthest position of entered information.

RESOLUTION

Once a sheet's boundaries have been extended, there is no way to

shrink them. A possible workaround would be to copy and paste your

code into a new Module window.

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10 2.00 thumb script display page


PRB: Microsoft Access Trims Spaces Off Database Names

 Article Number: Q92678

 CREATED: 12-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When naming a database that has one or more spaces at the front of the

database name, Microsoft Access strips off the leading spaces.

CAUSE

By default, the Windows Common Dialog strips leading spaces off

names.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new database.

2. Give the database a name that begins with a space.

3. Save the database.

4. Reopen the database. The space has been stripped off the name.

Additional reference words: 1.00 1.10 2.00


PRB: Out Of Memory When Pasting Text Into Module

 Article Number: Q92679

 CREATED: 12-NOV-1992

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

An "Out of Memory" message appears when you are pasting more than

64K of ASCII text from the Clipboard.

CAUSE

The implementation of the Clipboard paste in Microsoft Access cannot

paste more than 64K of ASCII text. This message appears even if the

code translates into less than 64K of pseudocode.

RESOLUTION

Paste the text into the module in more than one step. Each paste

must contain less than 64K of text.

Additional reference words: 1.00 1.10 2.00 WinIss copy errmsg


INF: Currency is Significant to Four Digits

 Article Number: Q92680

 CREATED: 12-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When using the currency data type within Access Basic, be aware that

numbers are significant to four digits to the right of the decimal

point.

MORE INFORMATION

The reason for this is that most financial information, such as

mortgage rates and stocks, require four digit precision.

Currency variables are stored as 64-bit numbers (8 bytes) in a

two's complement integer format and scaled by 10,000 to give a

fixed-point number with 15 digits to the left of the decimal point

and 4 digits to the right. This representation provides a range of

-922,337,203,685,477.5808 to 922,337,203,685,477.5807. The Currency

data type is extremely useful for calculations involving money and for

fixed-point calculations in which accuracy is particularly important.

Additional reference words: 1.00 1.10 2.00


INF: Defragment and Compact Database to Improve Performance

 Article Number: Q92681

 CREATED: 12-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Compacting your database and defragmenting your hard drive will

improve the performance of Microsoft Access.

MORE INFORMATION

Since the data on your hard disk becomes fragmented over time, you

should run a disk defragmentation utility (or "defragmenter")

periodically. Within the file, portions of the database may also

become fragmented due to Microsoft Access. Because of this, you should

also run Compact from within Microsoft Access.

A disk defragmenter will place the database file in contiguous

clusters on your hard disk, making file access quicker in general. If

you do not defragment your hard disk, the time it takes for MS-DOS to

retrieve your file may increase since it must go to several physical

locations on the disk to retrieve the entire file.

The Compact option under the File menu will also aid in increasing the

performance of Microsoft Access. Compact makes a copy of the database,

rearranging how the database file is stored on disk if it is

fragmented.

File storage can become fragmented when you make many changes to a

database. The compacted database file is usually smaller. You can use

the same name as the original for the compacted database file, or you

can use a different name to create a separate file. If you use the

same name and the database is compacted successfully, Microsoft Access

automatically replaces the original file with the compacted version.

Limitations of Compact

----------------------

 - The compact operation succeeds only if you have enough storage space

   on your disk for both the original and compacted versions of the

   database.

 - You cannot compact a database when it is open. In a multiuser

   environment, the compact operation fails if another user has the

   database open.

Fragment or Compact First?

--------------------------

If you compact after running a defragmenter, you would theoretically

leave open disk space immediately after the .MDB file on the disk,

thereby allowing MS-DOS to place any additional information in the

next physical clusters (this would be very fast). However, if you

defragment after running Compact, your .MDB might be placed on the

first part of the disk followed by the rest of your files, with no

open disk space until the end (the inside tracks) of the disk. This

would result in somewhat slower disk access.

Additional reference words: 1.00 1.10 2.00 compaction


INF: Parameter Queries, Wildcards, and SQL Server

 Article Number: Q92682

 CREATED: 12-NOV-1992

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

The asterisk (*) and the question mark (?) wildcard

characters are not

valid in SQL Server parameter queries and thus are

interpreted

by SQL Server as text. Unless these characters are present

in the

field restricted by the parameter, the query will return an

empty

set.

Instead of using the asterisk (*) and the question mark (?)

wildcard

characters in parameter queries, use the percent sign (%)

and the

underscore (_), the SQL Server wildcard characters.

MORE INFORMATION

SQL Server uses the percent sign (%) and the underscore (_),

the ANSI

standard wildcard characters, whereas Microsoft Access uses

the

asterisk (*) and the question mark (?) wildcard characters.

When

executing a parameter query, Microsoft Access does not

translate the

wildcard equivalents; the string you type in the Query

Parameters

dialog box is passed verbatim to SQL Server. Microsoft

Access

translates only strings that are part of the QBE grid.

REFERENCES

==========

For more information, search for "parameter query" using the

Help

menu.

Additional reference words: 1.00 1.10


INF: "#Name?" or Control is Blank on Form Based on a Query

 Article Number: Q92683

 CREATED: 12-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

----------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

----------------------------------------------------------------------

SUMMARY

If you have a form based on a query, and the query contains multiple

fields with the same name (such as FieldA from Table1 and FieldA from

Table2), the control(s) on the form that are bound to that field name

will be blank or may display the error "#Name?".

MORE INFORMATION

Because the same field name appears multiple times in the query that

the form is based on, Microsoft Access does not know which field to

link to the control(s). Therefore, instead of making an assumption

about which field to bind to, it leaves the control(s) linked to

duplicate field names blank or displays the error "#Name?" in the

control.

To correct this problem, rename the field in the query.

To change a field name in a query:

1. In a query's Design view, place the insertion point in front of the

   first letter of the field name in the QBE grid.

2. Type the new name followed by a colon. Delete any names assigned by

   Microsoft Access, but do not delete the field name or expression.

NOTE: Changing a field name in a query's Design view changes the

heading in the query's Datasheet view and the field name in a form or

report based on the query. However, the underlying field name in the

table does not change.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, page 103

Additional reference words: 1.00 1.10 2.00 Forms Queries Tshoot


INF: How to Change the Caption on the Microsoft Access Window

 Article Number: Q92684

 CREATED: 12-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to use a function called from a macro to change

the Microsoft Access window default title bar. If you name the macro

Autoexec, the title bar will be changed automatically every time the

database containing the macro is opened.

MORE INFORMATION

The following steps demonstrate how to change the title bar caption:

1. Open a new database and name it TEST.MDB.

2. Open a new blank form. Place at least one control on the form.

   Save the form as MainForm and then close it.

3. Create the following new macro, save it as Macro1, and then close it:

      Action    Argument

      -----------------------------------------------------------

      RunCode   ChangeAccessCaption("<Your Custom Caption Here>")

4. Open a new module, and enter the following declarations:

      Option Explicit

      Declare Function GetParent% Lib "USER" (ByVal hwnd%)

      Declare Sub SetWindowText Lib "USER" (ByVal h%, ByVal lpstr$)

5. Enter the following code for the ChangeAccessCaption() function in

   the module:

      Function ChangeAccessCaption (Caption$)

         Dim X%

         Dim hParent%

         ' Example of how to set the caption bar

         DoCmd OpenForm "MainForm"            'Open the main startup form

         X% = Forms!MainForm.hwnd             'Get its handle

         hParent% = GetParent(GetParent(X%))  'Get the form' parent

         Call SetWindowText(hParent%, Caption$)

      End Function

6. Save the module as Module1 and then close it.

7. Run Macro1. The title for the Microsoft Access window should change

   to the text you specified as the function parameter in step 3.

Additional reference words: 1.00 1.10 2.00 header caption


PRB:  GoToRecord Macro Does Not Work on Subform

 Article Number: Q92685

 CREATED: 12-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you create a GoToRecord macro that points to a subform and run that

macro from the main form, you get the following error message.

   Object '<Subform Name>' isn't open

STATUS

This behavior is by design.

RESOLUTION

Use a GoToControl macro and specify the subform, then use the

GoToRecord action to specify the specific record within the subform.

The GoToRecord action would look like this:

   GoToRecord

      Object Type:

      Object Name:

      Record     : Next

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB and then create the following

   new macro:

      Macro Name     Condition     Action

      ---------------------------------------

      Macro1                       GoToRecord

      Macro1 Actions

      ----------------------------------

      GoToRecord

         Object Type: Form

         Object Name: Categories Subform

         Record: Next

2. Open the Categories form and from the File menu, choose Run Macro, then

   select Macro1. You will get the following error message:

      Object 'Categories Subform' isn't open

3. Now change Macro1 to the following:

      Macro Name     Condition     Action

      ----------------------------------------

      Macro1                       GoToControl

                                   GoToRecord

      Macro1 Actions

      -----------------------------------

      GoToControl

         Control Name: Categories Subform

      GoToRecord

         Record: Next

Run the macro in the same way as in step 2. The macro will go to

the second record in the Categories Subform.

Additional reference words: 1.00 1.10 2.00


PRB: Opening a Database Read-Only Forces Others to Read-Only

 Article Number: Q92686

 CREATED: 12-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you open a database as read-only, all other users attempting to

open the same database as Exclusive are forced to open it read-only

also. This applies to multiple copies of Microsoft Access running on

one workstation as well as the multiuser environment.

RESOLUTION

To avoid opening the database in read-only mode, do not select

Exclusive when opening the second instance of the database.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open Microsoft Access and open the NWIND database with Read Only

   selected and Exclusive cleared.

2. Minimize the first instance of Microsoft Access and start a second

   instance of Microsoft Access.

3. In the second instance of Microsoft Access, open the NWIND database

   with Exclusive selected and Read Only cleared.

Result: the database opens as Read Only, even though the Read Only

flag was not selected.

Additional reference words: 1.00 1.10 2.00


PRB: Report or Form Bound to a Table Locks the Table

 Article Number: Q92687

 CREATED: 12-NOV-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You may receive the following message when you try to open a table

in Design view:

   Can't open table '<table name>' for modifications. Open it read-only?

This occurs when you attempt to open a table in Design view and the table

is the record source for a form or report, and one of the following

conditions is also true:

1. A report is open in Print Preview or a form is open in Form

   view that has the same record source, or is based on a query

   with the same record source.

2. A form is opened in Form view first and then switched to Design

   view.

3. A report is opened in Design view, then switched to Print Preview

   and back to Design view. (You cannot switch to Design view if you opened

   the report in Print Preview first.) This message does not occur when

   opening the form or report in Design view first (without ever

   switching to Form view or Print Preview), and then opening the table

   in Design view.

STATUS

This behavior is by design.

MORE INFORMATION

You must close the Form or Report window to be able to open the table

in Design view to allow changes.

REFERENCES

==========

For more information, search for "error messages: reference" using the

Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 locking


INF: Queries Sort by Order of IN() Parameters

 Article Number: Q92689

 CREATED: 12-NOV-1992

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

If you use the IN() operator in an unsorted query, the

output will be

grouped on the associated field. In addition, Microsoft

Access will place

the groups in the same order as the parameters are listed in

the IN()

operator.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a table with Firstname and Lastname fields (data

type

   "text"). Enter the data listed below:

      JOE    SMITH

      JANE   DOE

      ABE    LINCOLN

      JOHN   DOE

2. Create a query on this table.  In the Criteria cell for

Lastname, type:

      IN("LINCOLN","DOE")

   The query will generate these records:

      ABE    LINCOLN

      JANE   DOE

      JOHN   DOE

You can have the records appear in a different sequence by

changing

the order of the parameters in the IN() operator, or you can

explicitly specify a SORT order.

Additional reference words: 1.00 1.10 sorting group grouping


INF: Limit on AND's in SQL Select Statement

 Article Number: Q92690

 CREATED: 12-NOV-1992

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

There is an undocumented limit on the number of ANDs you can use in a SQL

Select statement. The limit is 40 for the Where clause and 40 for the

Having clause. Microsoft Access version 1.x returns the following error

message when you exceed this limit:

   Out of Memory

Microsoft Access version 2.0 returns the following error message when you

exceed this limit:

   Query is too complex

Additional reference words: 1.00 1.10 2.00


INF: Unsupported SQL Keywords Not Listed in Microsoft Access

 Article Number: Q92691

 CREATED: 12-NOV-1992

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

In Appendix C of the Microsoft Access "User's Guide," version 1.x, there is

a list of all SQL keywords that are supported in Microsoft Access. However,

there is no list of SQL keywords that are not supported in Microsoft

Access.

MORE INFORMATION

There are over 200 ANSI SQL keywords that Microsoft Access does not

support. Rather than list them all, only the supported keywords are

listed in Appendix C.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Appendix C, "Expressions,"

pages 649-650 and 655-656

Microsoft Access "User's Guide," version 1.1, Appendix C, "Expressions,"

pages 659 and 665-666

For more information, search for "SQL: reserved words" using the Microsoft

Access 2.0 Help menu.

Additional reference words: 1.00 1.10 2.00


INF: Copying Columns In Microsoft Access

 Article Number: Q92692

 CREATED: 12-NOV-1992

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

When you are viewing or editing a table in Datasheet view,

you cannot

select a column of data, copy it to the Clipboard, and then

edit it, as

you can with Microsoft Excel. You can, however, change or

rearrange data

without copying it to the Clipboard.

MORE INFORMATION

This article describes procedures for the following three

methods of

manipulating data in a Microsoft Access table:

 - Rearranging the column order

 - Adding a column

 - Copying a column of data to another application

Rearranging the Column Order

----------------------------

Use the following steps to rearrange the order of the

columns in a

Microsoft Access table:

1. Use the column indicator to select the column.

2. Drag the column to the new position, and then release it.

For more information, search for "Column Width (datasheets)"

then

"Changing a Datasheet's Appearance" using the Microsoft

Access Help

menu.

Adding a Column

---------------

This section describes how to add a column of information

from one

Microsoft Access table to another.

The first procedure describes how to update information in

Table1

with information from Table2. The second procedure describes

how to

create two tables (MASTER and EXTRAINFO), and then add the

information

from EXTRAINFO to the MASTER table.

To add a column to a Microsoft Access table, you must run an

update

query. If you are also adding new records, you must run an

append

query (refer to step 3, in either procedure) before you run

the update

query.

Copying a Column from One Table to Another:

Use the following steps to update information in Table1 with

information

from Table2:

1. Set the same primary key for both Table1 and Table2.

2. Manually add the new column names from Table2 to Table1.

Make sure

   they are the same data type. They do not have to be the

same name

   as the corresponding fields in Table2, but it saves a lot

of typing

   if the names are the same.

3. Use Table2 to create an append query.

   NOTE: Skip this step if Table2 contains only records that

exist

   in Table1.

   a. Choose the Query button, then choose New. Add Table2

to

      the query, then close the Add Table dialog box.

   b. From the Query menu, choose Append.

   c. In the Query Properties box, specify Table1 as the

Append To

      Table Name. Make sure that the Unique Values check box

is

      selected, then choose the OK button.

   d. Add all the field names from Table2 to the QBE grid.

      If the field names are spelled correctly, Microsoft

Access

      automatically fills in the Append To field with the

name of

      the correct field from Table1. If not, you must

manually select

      the Table1 field name in the Append To field.

   e. Run the query. New records from Table2 are added to

Table1.

4. Create an update query that contains both Table1 and

Table2.

   a. Choose the Query button, then choose Update. Add both

Table1

      and Table2 to the query, then close the Add Table

dialog box.

   b. Join the two tables by dragging the key field from

Table1 to

      Table2.

   c. From the Query menu, choose Update.

   d. Drag the new fields from Table1 and drop them into the

QBE

      grid, then type the [Table2]![<fieldname>] into the

Update

      From field. (You must manually type this entry.)

   e. Run the query to update the new fields in existing

Table1

      records.

Creating Two Tables and Adding Information from One to

Another:

1. Create two tables called MASTER and EXTRAINFO. The MASTER

table has

   two fields: KEY and ITEM1. The EXTRAINFO table has two

fields: KEY

   and ITEM2. Add data as follows:

      MASTER:  KEY   ITEM1          EXTRAINFO:  KEY   ITEM2

                 1   AAAAA                        1   11111

                 2   BBBBB                        3   33333

2. Open MASTER in Design view and add the field ITEM2. It

should look

   like this:

      MASTER:  KEY   ITEM1   ITEM2

                 1   AAAAA

                 2   BBBBB

3. Create the append query as follows:

   a. Choose the Query button, then choose New. Add

EXTRAINFO to the

      query, then close the Add Table dialog box.

   b. From the Query menu, choose Append.

   c. In the Query Properties dialog box, select MASTER as

the Append

      To Table Name. Select the Unique Values check box,

then choose

      the OK button.

   d. Drag the KEY field and the new field, ITEM2, and drop

them into

      the QBE grid. Microsoft Access fills in the Append To

field names.

   e. From the Query menu, choose Run.

   f. When Microsoft Access displays the following message,

choose the

      OK button:

         2 rows will be appended.

   g. When Microsoft Access displays the following message,

choose the

      OK button:

         1 record(s) were lost due to key violations

      NOTE: This is expected; the record with KEY=1 could

not be

      appended. The update query (step 4) will copy this

record.

      MASTER should now look like this:

         MASTER:  KEY   ITEM1   ITEM2

                    1   AAAAA

                    2   BBBBB

                    3           33333

4. Create the update query as follows:

   a. Choose the Query button, then choose Update. Add both

EXTRAINFO

      and MASTER to the query, then close the Add Table

dialog box.

   b. Join the tables by dragging the KEY field from

EXTRAINFO to

      MASTER. A line will connect the two tables.

   c. From the Query menu, choose Update.

   d. Drag the new field, ITEM2, from MASTER and drop it

into the

      QBE grid. Then, type [EXTRAINFO]![ITEM2] in the Update

From

      field.

   e. From the Query menu, choose Run.

   f. When Microsoft Access displays the following message,

choose

      the OK button:

         2 rows will be updated.

      MASTER should now look like this:

         MASTER:  KEY   ITEM1   ITEM2

                    1   AAAAA   11111

                    2   BBBBB

                    3           33333

For more information on append and update queries, search on

the

following topics using the Microsoft Access Help menu:

   "Appending Records to a Table"

   "Update Queries, Updating Records as a Group"

   "Joins, Joining Tables in a Query"

Copying a Column of Data to Another Application

-----------------------------------------------

If you need to copy a column of data from Microsoft Access

to another

application, such as Microsoft Excel, try one of the

following methods:

 - Use Copy & Paste to transfer the records you want to

copy. Then

   delete any unwanted columns in the other application.

 - Use the Hide Columns command from the Layout menu to

suppress the

   columns that you do not want copied. Then use Copy &

Paste to

   transfer the records that you want to copy. You must

Unhide each

   column individually.

 - Create a query that contains only the columns that you

want. Then

   use Copy & Paste to transfer the records that you want to

copy.

   This method is useful if you plan to copy data on a

regular basis.

For more information, search for "Copy Command" using the

Microsoft Access

Help menu.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0 and 1.1,

Chapter 6, "Appending

Records," Chapter 7, "Updating Tables," and Chapter 14,

"Changing Column

Width and Order"

Additional reference words: 1.00 1.10


INF: Inconsistent Save and Save As Menus with Forms

 Article Number: Q92693

 CREATED: 12-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

With a Form open in Design view, the File menu has options for Save

and Save As. With a Form open in Form view or Datasheet view, the File

menu has options for Save Form and Save Form As.

MORE INFORMATION

These options are available so that the user will be less likely to

think that saving the form while in Form view or Datasheet view will

save the actual data displayed at that time. While in Design view, no

data is displayed, and it is clear that saving the form will not save

any data from the form's dynaset. In all the cases, only the

information which defines the form itself will be saved by choosing

either save option from the File menu.

Additional reference words: 1.00 1.10 2.00


PRB: Using TransferDatabase to Export to Btrieve Format

 Article Number: Q92694

 CREATED: 12-NOV-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

According to the online Help topic for the TransferDatabase action, it is

not necessary to have a Database Name entry in order to export to Btrieve

format. This is incorrect.

RESOLUTION

The third paragraph under "Database Name" should read:

   For Btrieve databases, enter the path and file name (FILE.DDF)

   of the Xtrieve dictionary file for the Btrieve database. If the

   path you specify does not contain an Xtrieve dictionary file,

   Microsoft Access will create a dictionary file. This is a

   required entry. If you do not know the location of an Xtrieve

   dictionary file, enter a space <using the spacebar> and

   Microsoft Access will create this file for you.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

You must enter either a space or an invalid path before Microsoft Access

will create a dictionary file for you. An Xtrieve dictionary file is

required when exporting a table to Btrieve format.

Additional reference words: 1.00 1.10 docbug


PRB: Fields on Popup Not Editable When MS Access Is Minimized

 Article Number: Q92695

 CREATED: 12-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you minimize the Microsoft Access program window and a Microsoft

Access popup form is displayed, you are unable to place a cursor in an

editable field on the popup form, and as a result, cannot edit its

contents.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

versions 1.0 and 1.1. This problem no longer occurs in Microsoft Access

version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a form with a text box and a command button on it, set the

   form's Popup property to Yes, and save the form as MinPop.

2. Create a macro with the following macro actions. Save the macro as

   MinPop:

      Actions

      --------------------

      SendKeys

         Keystrokes: "% n"

         Wait: Yes

      OpenForm

         Form: MinPop

3. Run the macro MinPop.

When you run the macro Minpop the Microsoft Access program window is

minimized and the MinPop form is displayed. When you click the text box or

tab to it, no insertion point is displayed and you are unable to edit or

enter data in the text box. If you restore the Microsoft Access program

window while the MinPop form is displayed, you then are able to click the

text box, see the insertion point, and edit the field.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 348-351 and

432-435

Additional reference words: 1.00 1.10


PRB: Disabled Buttons Not Visible with ATI 1280x1024

 Article Number: Q92701

 CREATED: 12-NOV-1992

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SYMPTOMS

When you are using an ATI Ultra Card with the ATI 1280x1024

video driver,

disabled buttons within Microsoft Access are not visible.

This does not

apply to push buttons that you create on a form, only to

buttons that are

part of Microsoft Access.

RESOLUTION

Use one of the video drivers supplied with Microsoft

Windows, or obtain new

video drivers from ATI. As of March 3, 1994, the latest

drivers available

from ATI are version 2.2, and can be obtained from the ATI

Bulletin Board

Service at (905) 764-9404. You need to download the

following files:

 - M32W22.ZIP (the video drivers)

 - LOADER.ZIP (the installation program for the drivers)

MORE INFORMATION

This behavior occurs only with Microsoft Access buttons and

not with user-

created buttons because the "text" of the two types of

buttons is

different. With Microsoft Access buttons, the text is

actually text, and

with user-defined buttons the text is actually a bitmap.

The ATI video card and drivers are manufactured by a vendor

independent of

Microsoft; we make no warranty, implied or otherwise,

regarding these

products' performance or reliability.

Additional reference words: 1.00 1.10


INF: Status Bar Text Too Long for Auto Repeat Property

 Article Number: Q92702

 CREATED: 12-NOV-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

When you select a command button's AutoRepeat property, the text that

appears in the status bar can be truncated if you are using a display

mode whose resolution is lower than the standard VGA mode's resolution

(such as EGA or CGA modes).

The text that appears in the status bar should read:

   Run macro specified in OnPush property repeatedly while button is

   pressed?


PRB: ALT+Any Key Combination Does Not Work With Active Popup

 Article Number: Q92703

 CREATED: 12-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When a Microsoft Access popup window is active in Form view, pressing

any ALT+key combination to access the menu bar does not work.

RESOLUTION

Use the mouse instead of the keyboard to access the menu bar.

MORE INFORMATION

Currently, when a popup window is active, pressing any of the ALT+key

combinations will not pass any function to the menu bar, only to the

current active window.

Steps to Reproduce Behavior

---------------------------

1. Run Microsoft Access and open the sample database NWIND.MDB.

2. Open the Add Products form in Design view.

3. Choose the Properties command from the View menu. The property sheet

   will be displayed.

4. Pressing ALT+F to access the menu File option does not work.

Additional reference words: 1.00 1.10 2.00


PRB: CueCards Started Outside MS Access Does Not Work

 Article Number: Q92706

 CREATED: 12-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you choose the Microsoft Access Help Icon without having

Microsoft Access started and then try to run any topic from the Cue

Cards menu, you are returned to the Program Group without any error

message.

CAUSE

This is a limitation of WinHelp's ability to call and respond to DLLs.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. From the Microsoft Access Program Group, open the Microsoft Access

   Help Icon

2. Choose Cue Cards.

3. Select any Cue Cards topic.

Result: You are returned to the Microsoft Access Program Group without

any error message.

Additional reference words: 1.00 1.10 Docerr


INF: Form View Allowed When ViewsAllowed Set to Datasheet

 Article Number: Q92709

 CREATED: 12-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

If you create a form and set the ViewsAllowed property to

Datasheet, you can still open the form in Form view.

MORE INFORMATION

The DefaultView property in Microsoft Access specifies how to open

the form, while the ViewsAllowed property determines what you can do

once the form is opened. ViewsAllowed determines whether users can

switch between Datasheet view and Form view by choosing either the

Form or Datasheet command from the View menu.

Additional reference words: 1.00 1.10 2.00


PRB: Out of Disk Space Error Makes Paradox Table Unusable

 Article Number: Q92739

 CREATED: 15-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you are editing a Paradox table in Microsoft Access and run out of

disk space, the following error message appears:

   Out of Disk Space

You continue to receive the same error message, even after you free up

additional disk space.

RESOLUTION

Use the following steps to correct this problem:

1. Delete the attachment to the remote Paradox table by selecting

   the table name in the table list and pressing the DEL key.

2. Rename both the table (xxx.DB) and its index (xxx.PX) to some

   other names.

3. Recreate the attachment, then try attaching to the remote Paradox

   table again.

Paradox is manufactured by Ansa Software, a Borland company, a vendor

independent of Microsoft; we make no warranty, implied or otherwise

regarding this product's performance or reliability.

Additional reference words: 1.00 1.10 2.00 errmsg


PRB: Help Gives Error Importing File From Floppy Disk

 Article Number: Q92740

 CREATED: 15-NOV-1992

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Pressing F1 for Help, after importing a file from a floppy disk

drive, results in the following system error:

   Cannot read from drive A:

CAUSE

This error is due to a problem in the Microsoft Windows Help engine

WINHELP.EXE.

RESOLUTION

To avoid this problem, change the selected drive in the Import dialog

box back to a hard disk drive before closing the dialog box.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Import a database from a file on a floppy disk.

2. Close the Import dialog box.

3. Remove the floppy disk from the disk drive.

4. Press F1 for Help. You will receive the error message:

       Cannot read from drive A:

Additional reference words: 1.00 1.10 WinIss errmsg


PRB: Choosing a New Printer Resets Some Printer Settings

 Article Number: Q92741

 CREATED: 15-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Microsoft Access retains certain printer settings with form and

report objects.

For instance, if you have a specific printer specified under the Print

Setup dialog and then select a new printer your Orientation, Paper, and

Option settings change to the default values for the new printer choosen.

CAUSE

This functionality is controlled by the Windows Common Dialog DLL

(Dynamically Linked Library.)  The same behavior appears within Microsoft

Write.

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10 2.00 defaults


INF: Planning Database Security

 Article Number: Q92742

 CREATED: 15-NOV-1992

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

There are two things to remember when dealing with security:

1. Plan your security scheme from the beginning. Planning a

good security

   scheme from the beginning will ensure you a minimum of

work later on.

2. Assign permissions to Groups, not to Users.

   This is very important. By creating appropriate, well

thought out

   groups, a user has the "best" permissions of the groups

that he or she

   is a member of. For example, if a user is member of Group

A, which does

   not have permissions to an object but also is a member of

Group B, which

   does have the permissions to an object, the user will

have Group B's

   permission to the object.

   You will find that maintenance work will decrease

significantly if

   you plan your groups carefully. A typical database setup

should have a

   maximum of 4 to 5 groups. This is not a maximum number of

groups

   limitation for Microsoft Access, merely a guideline for

easier

   security management.

There is no multiple-selection functionality in the security

dialog boxes.

You cannot give a group or user permissions to more than one

object at a

time; each object must be selected individually and then

permissions may be

assigned.

MORE INFORMATION

User Name Case Sensitivity

--------------------------

User and group names are not case sensitive when you enter

them to start

a Microsoft Access session. However, if you are recreating a

user

account or group you have to match the name exactly. This is

due to the

way the account information is stored by the system.

NOTE: Passwords are case sensitive.

REFERENCE

=========

Microsoft Access "User's Guide," version 1.0, chapter 25,

"Administering a

Database System"

Additional reference words: 1.00 1.10


PRB: No Error Given When Linked OLE Object Cannot be Found

 Article Number: Q92745

 CREATED: 15-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Microsoft Access does not warn you if you close an OLE server without

saving a linked embedded object.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Excel.

2. In SHEET1 enter data in several cells, select and then copy them to

   the Clipboard.

3. Start Microsoft Access.

4. Open a new form and choose Paste Link from the Edit menu to create a

   linked embedded object.

5. Switch back to Excel and close SHEET1. DO NOT save the changes.

6. Switch back to Microsoft Access and double-click the linked embedded

   object. Microsoft Excel comes to the foreground, the hourglass is

   displayed, and Microsoft Excel is then closed.  No error message

   is displayed.

Additional reference words: 1.00 1.10


PRA: Table Export to Excel Does Not Set Database Name

 Article Number: Q92746

 CREATED: 15-NOV-1992

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

When you export a table from Microsoft Access to Microsoft

Excel, the

defined name "Database" is not set in Microsoft Excel.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access version

1.0. This problem no longer occurs in Microsoft Access

version 1.1.

MORE INFORMATION

To use the exported data as a Microsoft Excel database, the

database

range must be set manually in Microsoft Excel. This can be

done by

highlighting the entire set of data, including the first row

of labels,

and choosing Set Database from the Data menu.

For more information on interactions between Microsoft

Access and

Microsoft Excel, query on the following words here in the

Microsoft

Knowledge Base:

   access and excel and database and biff

NOTE: BIFF is the Microsoft Excel Binary Information File

Format.

Office.


INF: Count() Ignores Null Values

 Article Number: Q92747

 CREATED: 15-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

----------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

----------------------------------------------------------------------

SUMMARY

NULL values are ignored when using a query to perform a count.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create Table1 with two text columns as follows:

      Column1    Column2

      -------    -------

       foos

       ball

       foosball   junk

       null

       notnull    junk

2. Open a new query based on Table1.

3. From the View menu, choose SQL. Enter the following SQL query:

      SELECT Column2, COUNT(Column2)

      FROM Table1

      GROUP BY Column2;

4. Run the query. The result of the query is:

      Column2    Count(Column2)

      -------    --------------

                       0

       junk            2

Workaround

----------

To count NULL values, count on a primary key column, a column that

contains unique values, a counter column, or a dummy column where all

records equal 1.

The new SQL statement would read:

   SELECT Column2

   COUNT(PrimaryKey)

   FROM Table1

   GROUP BY Column2;

REFERENCES

==========

Online Help, search on "Count" and select the topic "Calculating

Totals in a Query" and "Count Function" for more information.

Additional reference words: 1.00 1.10 2.00 queries count


INF: Hints for Printing Mailing Labels

 Article Number: Q92807

 CREATED: 16-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The Microsoft Access ReportWizard for mailing labels makes it quick

and easy to create a report design for many standard mailing labels.

However, sometimes you may have difficulty getting the labels to print

correctly on your printer. Here are some hints and suggestions for

getting labels to print.

MORE INFORMATION

The Microsoft Access ReportWizard for mailing labels creates report

specifications for standard mailing labels. However, in order to do

so, it makes some assumptions about your printer which may not be

true. In particular, it assumes that it can print within a certain

distance of each edge of the paper. Every Windows print driver can

have a different "printable region," which is the rectangle on the

printed page that the application can print into. This rectangle may

be smaller than the rectangle that the physical printer can print, due

to space and efficiency considerations in the print driver. Therefore

you may not be able to print labels as close to the edge of the paper

as you would like.

In general, the ReportWizard assumes that it can print within .25 inch

of the edge of the paper. If you find that some of the text in your

labels is getting cut off or is not getting printed at all, try going

into design mode for the report and moving text items until all of the

text prints. For example: Select all the controls and move the entire

group down a little within the Detail section to adjust for a top

label being missed. You may have to make the items smaller, choose a

smaller font, and move them closer together to get everything to fit

without having the label cut off at either the top or the bottom of

the printed page.

If your printer has such a large top margin that you cannot move your

text items down far enough (or if doing so results in a visually

crowded label), the next thing to do is change the Print Setup margins

so that the first label on each page is not used. To do this, choose

Print Setup and add the height of your labels to the top margin

provided by the ReportWizard. For example, if you are using 1 inch

labels, and the top margin is .03 inch, change it to 1.03 inches to

skip the first label on the page. If you are having trouble with the

last line of the last label getting cut off, you can use the same

technique on the bottom margin to cause the last label on the page to

be skipped.

Another common problem is that some labels come on sheets that are 12

inches tall, whereas the print driver only knows about 11 inch paper.

In this case, you must ignore the last label on the page and use the

labels that fall within the first 11 inches.

Additional reference words: 1.00 1.10 2.00 w_print wizards


INF: RunApp Action Command has 255 Character Argument Limit

 Article Number: Q92809

 CREATED: 16-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The RunApp action for macros allows 255 characters.

MORE INFORMATION

MS-DOS has a 127 character limit on command line arguments, but Microsoft

Access allows up to 255 characters for the RunApp macro action. This is

by design, because there is a 127 character limit for the program name

and path, but there is a 127 character limit for the list of arguments

to the program. The two argument lists add up to the allowed 255

characters.

Additional reference words: 1.00 1.10 2.00


PRB: BeforeUpdate Macro Running Twice

 Article Number: Q92810

 CREATED: 16-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The BeforeUpdate macro appears to be running twice, rather than

only once.

CAUSE

The BeforeUpdate macro will run whenever an edited record is

saved. And if you add records using the Paste Append command, it

will run when each of those records is added. If you find that

the BeforeUpdate macro is running more than once, check to see

exactly what actions you are taking.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

 1. Create a macro with a MsgBox action and then a CancelEvent action.

 2. Save this macro as Macro1.

 3. Create a bound form with text boxes.

 4. Set the form's BeforeUpdate property to Macro1.

 5. Switch the form from Form Design view to Form view.

 6. Enter data in a field, then select the data in that field.

 7. From the Edit menu, choose Copy.

 8. From the Edit menu, choose Paste Append.

 9. Choose the OK button when the Message box (that you created in

    Macro1) appears.

10. Close the form.

11. Choose the OK button when the Message box (that you created in

    Macro1) appears.

12. Choose the OK button when the following error message appears:

       The record being edited can't be saved. If you close the form,

       the changes you've made to the record will be lost. Close

       anyway?

Note that the message box you created in Macro1 reappeared in step 11.

The macro that you assigned to the BeforeUpdate property is running

twice: when the record that you added using the Paste Append command

is saved, and when when the edited record is saved.

REFERENCES

==========

For more information, search for "BeforeUpdate, AfterUpdate Properties"

using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 before update


PRB: Cannot db.OpenTable With Only Read Definition Permission

 Article Number: Q92811

 CREATED: 16-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you have only Read Definition permissions on a table,  you are

unable to open the table in order to examine the table definition from

Access Basic. The following error message appears:

   No permission for '<Tablename>'

CAUSE

The table cannot be opened from Access Basic when you have only

Read Definition permission. You should give users Read Data

permission for the table if they need to examine the table definition

with Access Basic.

A user with Read Definition permission can only look at the table

definition manually by opening the table in Design view as read-only.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce the Problem

------------------------------

1. Open a new database and create a table called Table1.

2. Add a new user named "Joe" and give this user Read Definition

   permission only on Table1.

3. Exit Microsoft Access, restart Microsoft Access and logon as Joe. (Be

   sure you have removed all permissions from the group Users since

   everyone who logs on to Microsoft Access is a member of the group

   Users.)

4. Enter the following code in a new Module:

      Option Explicit

      Sub Test ()

         Dim Mydb As Database

         Dim MyTable As Table

         Set Mydb = CurrentDB()

         Set MyTable = mydb.OpenTable("Table1")

         MyTable.MoveFirst

         MyTable.Close

         Mydb.Close

      End Sub

5. Run this sub by typing "test" (without quotation marks) in the Immediate

   window. The following error message is displayed:

      No permission for 'Table1'.

Additional reference words: 1.00 1.10 2.00 rights


PRB: Column Widths in Table Design Not Saved

 Article Number: Q92813

 CREATED: 16-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The Datasheet view column widths of the table are automatically

saved by Microsoft Access. When working on tables in Design

view, however, changes made to the Design view grid's column

widths are not saved when the form is closed.

CAUSE

Microsoft Access does not currently support saving the column

width of the Design view grid for a table.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open a table in Design view.

2. Adjust the column width of "field type" (or one of the

   other columns.

3. Exit the table.

4. Return to the table in Design view and notice that the

   width has returned to its original state.

Additional reference words: 1.00 1.10 2.00


PRB: No Error Msg When BoundColumn Greater Than ColumnCount

 Article Number: Q92814

 CREATED: 16-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The default value for the ColumnCount and BoundColumn properties of

List Boxes and Combo Boxes is 1. If you change the BoundColumn

property to a number that is greater than the number of columns

(ColumnCount), you do not get an error message.

CAUSE

Microsoft Access does not enforce any error checking at this point

of form or report design. Otherwise, you would always have to enter

the correct column count before entering the bound column number.

RESOLUTION

When using List or Combo Boxes, check to ensure that the BoundColumn

property setting is an integer between 0 and the number set by the

ColumnCount property.

STATUS

This behavior is by design.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 239-241

For more information, search for "ColumnCount" and "BoundColumn" using

the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 errmsg checkpage


INF: Using the Generic Print Driver with Forms/Reports

 Article Number: Q92815

 CREATED: 16-NOV-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

One way to get Microsoft Access output from forms or reports into a

text file is to use the Windows Generic print driver and print to a

file. However, using the Generic print driver (TTY.DRV) can be a

little tricky. Listed below are some hints on how to set up your forms

and reports for the Generic print driver.

MORE INFORMATION

The Windows Generic print driver simulates a line-oriented printer

with a fixed pitch font, like a TTY device or a line printer. Because

of this, it can only print text, and it can only position the text on

a grid that is 10 characters per inch in the horizontal direction and

6 lines per inch in the vertical direction. (By contrast, most Windows

print drivers can position text on any pixel position.)

This means that any form or report using the Generic print driver to

create a text file should be layed out so that everything lines up

with this character grid.

Here are some considerations for the form/report layout:

- Ensure that each section of your report has a height that is

  an integral multiple of 1/6".

- Lay out the text items in your report such that each falls on 1/6"

  boundaries.

- Since the default hardware font for most printers is a Courier

  10cpi font, you should set the font for all of your text items to be

  Courier 10.

- Do not use Bold fonts, as they will appear three times in your output.

  (The Generic driver simulates bold text by overstriking.)

Here are some problems that frequently occur when using the Generic

print driver to do text output:

- Blank lines appear in the output--text items or sections are slightly

  farther apart than 1/6".

- Overlapped lines appear in the output--text items or sections are

  slightly closer together than 1/6"

- Text appears three times in the output--text is formatted as

  Bold.

Additional reference words: 1.00 1.10 2.00 outputto


INF: Converting Julian Dates with Access Basic

 Article Number: Q92816

 CREATED: 16-NOV-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Most government agencies and contractors require the use of Julian

dates. (A Julian date starts with a two-digit year, then counts the

number of days from January 1, as printed on many desktop calendars.)

Microsoft Access does not have any built-in functions for using or

converting Julian dates to standard dates. However, you can write a

function in Access Basic to do this. Below is an Access Basic function

which converts a Julian date to a standard serial date in Microsoft

Access. Note that the following sample code assumes the year is in the

20th century. The code must be changed to process dates after the year

2000.

MORE INFORMATION

The following sample function, ConvertJulian(), can be used to convert

Julian dates to standard dates:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   Option Explicit

   Function ConvertJulian (JulianDate as Long)

      ConvertJulian = DateSerial(1900 + Int(JulianDate / 1000),_

                       1, JulianDate Mod 1000)

   End Function

Examples of How to Use the ConvertJulian() Function

---------------------------------------------------

Example 1:

1. Create a new unbound form and add two unbound text boxes (called

   field0 and field2) to the form.

2. In the ControlSource property of field2 type:

      =ConvertJulian([field0])

3. Switch to Form view. Enter "90001" (without quotation marks) in the

   first text box. The Julian date in the first text box will be converted

   and displayed as a standard date in the second text box.

Example 2:

1. Create a new table called Table1 with one field. Name the field

   Julian, with a data type of Number. Save the table.

2. View the table in Datasheet view. Add the following values to the

   table:

      90001

      90010

      92100

3. Create a new query based on Table1 and drag the Julian field onto

   the query grid.

4. In the Field row of another column on the query grid, enter the

   following:

      Normal: ConvertJulian([Julian])

5. Run the query. Note that the Julian dates are converted to standard

   dates.

Additional reference words: 1.00 1.10 2.00


INF: Initial Size of Every .MDB File is 64K

 Article Number: Q92817

 CREATED: 16-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The initial size of every .MDB file is 64K. Microsoft Access allocates

additional space in 16 page blocks (2K per page x 16 = 32K).

MORE INFORMATION

The initial size of every .MDB file is 64K, (32 pages). If more space

is needed, the additional space is allocated in 16 page blocks. The

reason for using 16 page blocks, as opposed to smaller blocks of disk

space, is to prevent excessive disk fragmentation.

Additional reference words: 1.00 1.10 2.00


PRB: 'No Default Printer' Error Message When Printing

 Article Number: Q92818

 CREATED: 16-NOV-1992

 MODIFIED: 19-JUL-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you create a new report and no default printer is set in

the Windows Control Panel, you get the error message:

   There is no default printer. Select or install one

   using the Windows Control Panel.

CAUSE

Reports have a "Layout for print" property that defaults to "Yes",

which enables the "Size to fit" option when designing reports or

labels. This option uses the printer font metrics defined in the

printer driver. When there is no default printer, Microsoft Access

cannot calculate the layout.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. In Windows Control Panel, highlight your default printer and choose

   Remove.

2. In Microsoft Access, choose Report, then New.

3. Choose either Report Wizard or Blank Report.

You receive the error message immediately when you use the Blank

Report option. When you use the Report Wizard, you receive the message

after answering all of the Report Wizard information. By choosing OK,

you can continue creating the report.

Additional reference words: 1.00 1.10 errmsg


PRB: Pressing HOME Key in Text Box Does Not Move to Beginning

 Article Number: Q92819

 CREATED: 16-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you type a great deal of text in a text box control, pressing

the HOME key does not move you to the beginning of the text but

does position the insertion point at the beginning of the current line.

CAUSE

Microsoft Access allows a maximum line length of 20 inches. If your

data exceeds this length, or if you have entered a carriage return

(CTRL+ENTER) in the text box, pressing HOME will not move you to

the beginning of the data.

RESOLUTION

In these cases, press CTRL+HOME instead of HOME.

MORE INFORMATION

Both text boxes bound to text fields and those bound to memo fields

act the same with regard to the HOME and END keys.

Additional reference words: 1.00 1.10 2.00 textbox


PRB: Unable to Specify Label Order in Graph FormWizard

 Article Number: Q92821

 CREATED: 16-NOV-1992

 MODIFIED: 29-DEC-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The labels on a chart created using the Graph FormWizard are not

in order. No matter how you organize the underlying data, the

labels always appear in alphabetical order.

CAUSE

Microsoft Access has no way of knowing whether a text field contains

date information or regular text information. The Graph FormWizard

uses the SQL "Group By" clause, which defaults to alphabetically

grouping text fields.

STATUS

This behavior is by design.

RESOLUTION

If you want to chart dates, store the underlying data for the form

in date fields (as Date/Time data types). Then, when you tell the Graph

FormWizard to GROUP, Microsoft Access will know to group date fields

chronologically.

If you want neither alphabetical nor chronological grouping of

labels, you will need to manually edit the ColumnHeads property for

your graph. This property is available when the form is in Design

view.

MORE INFORMATION

Steps to reproduce behavior

---------------------------

1. Create a table called Table1 with two fields: a text field called

   Text and a numeric field called Number.

2. Switch to Datasheet view and enter the following data in the order

   shown:

      Text      Number

      ----------------

      Jan       5

      Feb       1

      Mar       2

3. Use the Graph FormWizard to create a new form based on Table1.

Note that the labels on the chart are in alphabetical, not chronological,

order.

Additional reference words: 1.00 1.10


PRB: One Side of Join Line Not Attached to Table

 Article Number: Q92822

 CREATED: 16-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

It appears that the join line in the QBE (Query by Example) grid is

attached to only one table.

CAUSE

The table is joined to another table that is currently positioned

out of view on the Query window.

RESOLUTION

Try maximizing the Query window or using the scroll bars to find

the other table, and then move the second table closer to the first

table.

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10 2.00


INF: Access Table with Time Field Exports Strangely to Excel

 Article Number: Q92823

 CREATED: 16-NOV-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

A Microsoft Access table that has a Time-formatted field displays a

strange date format when exported to Microsoft Excel. The Time column

on the spreadsheet displays the time as the date 1/0/00. This behavior

occurs because of the way Microsoft Excel interprets serial numbers.

To display the time correctly, apply a Microsoft Excel time format to

the affected information.

MORE INFORMATION

Microsoft Access and Microsoft Excel both use serial numbers to

display dates and times. A Microsoft Access table that is exported to

Microsoft Excel automatically formats all serial numbers as dates. The

spreadsheet column of serial numbers simply needs the format changed

to time.

To correctly display a time format in the versions of Microsoft Excel prior

to version 5.0, select the column of dates on the spreadsheet. From the

Format menu, choose Number, and select one of the time formats (for

example, hh:mm:ss AM/PM).

In Microsoft Excel version 5.0, select the column of dates on the

spreadsheet. From the Format menu, choose Cells. From the Number tab,

select one of the time formats.

REFERENCES

==========

For more information, search for "Serial Numbers" and "Date and Time

Numbers" using the Microsoft Excel Help menu.

Additional reference words: 1.00 1.10 2.00 transferspreadsheet cell


INF: Custom Setup May Show Zero or Negative Disk Space Needed

 Article Number: Q92824

 CREATED: 16-NOV-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

The amount of disk space required for each option does not display a

consistent number when running a custom installation.

MORE INFORMATION

The Setup program calculates and displays the total space that you

will need, it does not just display a static number. If you already have

the same version installed the option will display a zero for required

disk space. If a previous version of one of the options was much

larger, the required disk space will display a negative number.

Steps to Reproduce Behavior

---------------------------

1. Run the Setup program for Microsoft Access from Disk 1.

2. Choose Custom Installation.

3. Note the required disk space for the options; some may be zero or

   negative.

REFERENCES


INF: How to Determine If a Form Exists in a Database

 Article Number: Q92825

 CREATED: 16-NOV-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article discusses how to obtain a dynaset containing the names of

all the forms in a database whether or not they are active.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

MORE INFORMATION

If you want to obtain a complete list of forms whether or not they are

active, you can create a dynaset that queries MSysObjects for all the

forms stored in the current database. MSysObjects stores the names of

every object in a database, and each record includes the type of

object represented by a code and stored in a field called Type. The

code that represents forms in the Type field is -32768. Given this

information, you can create a dynaset that obtains the names of all

the objects in MSysObjects that are forms:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   Dim DB As Database, S As Dynaset

   Set DB = CurrentDB()

   Set S = DB.CreateDynaset("SELECT Name FROM MSysObjects _

                                              WHERE Type = -32768;")

After executing the code above, a dynaset called S is created. This

dynaset contains the names of all the forms in the current user database.

You can then process the information as shown in the example below.

The procedure below accepts a form name and opens it if it exists in

the database, or presents a message indicating that it does not exist

in the database:

   Option Explicit

   Sub FormOpener (FormToOpen$)

      Dim DB As Database

      Dim S As Dynaset

      Set DB = CurrentDB()

      Set S = DB.CreateDynaset("SELECT Name FROM MSysObjects _

                    WHERE Type = -32768;")

      S.FindFirst "Name = '" & FormToOpen$ & "'"

      If S.NoMatch Then

         MsgBox FormToOpen$ & " does not exist in this database"

      Else

         DoCmd OpenForm FormToOpen$

      End If

   End Sub

In Microsoft Access version 2.0, you can use the following method that uses

data access objects (DAO):

   Option Explicit

   Sub DAOFormOpener (FormToOpen$)

      Dim mydb As Database, x As Integer

      Set mydb = dbengine(0)(0)

      For x = 0 To dbengine(0)(0).containers("forms").documents.count - 1

        If FormToOpen$ = _

                 dbengine(0)(0).containers("forms").documents(x).name Then

           DoCmd OpenForm FormToOpen$

           Exit Sub

        End If

      Next x

      MsgBox FormToOpen$ & " does not exist in this database."

   End Sub

Additional reference words: 1.00 1.10 2.00 VT


PRB: MS Access Short and Medium Time Formats Have Leading Zero

 Article Number: Q92826

 CREATED: 16-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you use the Short Time and Medium Time Date/Time formats,

a leading zero appears in your data.

RESOLUTION

To eliminate the leading zero, use a custom format, such as "h:mm am/pm".

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a Date/Time field.

2. Format it as Medium Time.

3. Type "4:57pm" (without the quotation marks).

4. Press TAB to leave the field.

The value you entered will be displayed as "04:57 PM."

Additional reference words: 1.00 1.10


PRB: Removing User Admin from Admins Group Cannot Be Reversed

 Article Number: Q92827

 CREATED: 16-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you start Microsoft Access as the Admin user (which occurs by

default) and then remove the user Admin from the Admins group, you

will not be able to go back and make the user Admin a member of the

Admins group during this session.

CAUSE

As soon as you remove the user Admin from the Admins group, this

change is written to the Microsoft Access system tables. At this

point, the Admin user no longer has permission to add anyone to the

Admins group, including itself.

RESOLUTION

To add the user Admin back to the group Admins, you must log on as

another user who is in the Admins group.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Change the password for the user Admin from blank to some nonblank

   password. (NOTE: This will allow you to bring up the Log On dialog

   box at the start of the next session.)

2. IMPORTANT: Create a new user and add this user to the Admins group.

   (There must always be at least one user in the group Admins.

   Remember that you are currently logged in as the user Admin.)

3. Remove the user Admin from the Admins group.

4. Try to add the user Admin back to the Admins group. You will

   receive the error:

      No permission for 'Admin'

    If you leave the Security menu and return to change the settings, you

    will receive the error:

        'No Permission for MSysGroups'

5. Quit Microsoft Access and restart it.

   The Log On dialog box will appear because of the change you made in

   step 1.

6. Log on as the user that you created in step 2.

7. Add the user Admin back to the Admins group.

  NOTE: To disable the Log On dialog box, you must change the Admin

  password back to an empty string (do not enter any information in

  the New Password or Verify fields).

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 25, "Administering a

Database System"

For more information on the Admin user, search on "Admin account" and

"password" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


PRB: Mail Label Wizard Shows Blank Line in Label Size List Box

 Article Number: Q92890

 CREATED: 17-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

In the Mailing Label ReportWizard, the Label Size list box has a blank

line at the bottom. This blank line shows on standard VGA and super

VGA monitors but does not show on model 8515/A monitors.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10


PRB: 'Invalid Range' Error When Importing Spreadsheet Range

 Article Number: Q92891

 CREATED: 17-NOV-1992

 MODIFIED: 28-DEC-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you try to import a range of cells from a spreadsheet, you

receive the following error message:

   Invalid Range.

The Select File dialog box appears after the error message.

CAUSE

You specified an invalid range of cells to import, either by

improperly referencing them (for example, R0C0:R5C3) or by

providing a nonexistent range name.

RESOLUTION

Reselect the file that you want to import, and then choose Import

from the File menu. When the Import Spreadsheet Options dialog box

is displayed, make sure you type a valid range reference in the

Spreadsheet Range box. This range can be a specific range of cells

(for example, A5:B12 or R3C3:R50C9) or a defined name that refers

to a range of cells on the spreadsheet (for example, MYRANGE).

STATUS

This behavior is by design.

References:

"Microsoft Access User's Guide," version 1.0, Chapter 4, pages 72-75

Additional reference words: 1.00 1.10 cell excel errmsg


PRB: Concatenation of Memo Fields Creates Text Field

 Article Number: Q92892

 CREATED: 17-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you use a make-table query to concatenate two memo fields, the

query concatenates the memo fields into a text field in the resulting

table. This will result in the truncation of memo field data in the

new text field if you have over 255 characters in the memo fields.

CAUSE

Text fields have a limit of 255 characters, but memo fields can

contain up to 32,000 characters.

RESOLUTION

A workaround is to perform an append query to an existing table with a

memo field and concatenate the two memo fields into the existing memo

field.

MORE INFORMATION

Steps To Reproduce:

-------------------

1. Create a table with two memo fields:

      Table: OldTable

      ------------------

      Field Name: Memo1

         Data Type: Memo

      Field Name: Memo2

         Data Type: Memo

2. Create a make-table query based on OldTable. Use the following SQL

   statement for the query:

      SELECT DISTINCTROW

         [Memo1]&[Memo2]

      AS Concat

      INTO NewTable

      FROM OldTable;

   After running the query, note that the NewTable table contains a text

   field with only 255 characters.

Workaround

----------

1. Create another table containing one memo field:

      Table: ExistingTable

      -------------------------

      Field Name: ExistingField

         Data Type: Memo

2. Create an append query based on OldTable. Use the following SQL

   statement for the Query:

      INSERT INTO ExistingTable

         ( ExistingField )

      SELECT DISTINCTROW

         [Memo1]&[Memo2]

      AS Concat FROM OldTable;

When you run this query, ExistingTable will contain the two memo fields

concatenated.

Additional reference words: 1.00 1.10 2.00


PRB: Two Error Messages with Database on Workgroups Server

 Article Number: Q92893

 CREATED: 17-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If you are connected to a Microsoft Windows for Workgroups server and

have a database from the server open on your workstation in Microsoft

Access, you may be disconnected by the server and receive error

messages from Microsoft Access.

CAUSE

The server can disconnect any client by using Net Watcher, a program

that comes with Windows for Workgroups. If you are disconnected, you

receive two separate error messages when you attempt to open a table

in Microsoft Access. The first error message is:

   Internal database error (-1106).

When you choose OK, you receive the second error message:

   Disk or Network error.

RESOLUTION

You must reconnect to the server on which the database is stored in

order to use the database.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Connect your computer (the client) to a Windows for Workgroups

   server.

2. Start Microsoft Access on the client and open a database file

   located on the server.

3. Start Net Watcher on the server.

   NOTE: Net Watcher is located in the Accessories group in Windows

   Program Manager.

4. From the Connection menu, choose Disconnect to disconnect the

   client from the server.

5. In the Database window on the client, select a table and try to open

   it. The database still appears to be open, even though the server

   has disconnected you.

Additional reference words: 1.00 1.10 wfwg errmsg client server


INF: Setup Options Dialog Box Lists Disk Space Info Twice

 Article Number: Q92894

 CREATED: 17-NOV-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

The Setup Options dialog box will be displayed during a Custom Setup, or

during an Express Setup if you have insufficient disk space for a full

installation. The bottom half of the Setup Options dialog box provides

disk information (space required and space available).

The bottom left side provides disk information about the drive that

you specified for Microsoft Access. The bottom right side provides

disk information about the drive that contains your Windows software.

If both Microsoft Access and Windows are located on the same drive,

the disk information displayed on the left side is also displayed on

the right side of the dialog box.

MORE INFORMATION

The Setup Options dialog box is a common dialog box. The same dialog

box is opened for installations with Microsoft Access and Windows on

the same drive, and Microsoft Access and Windows on different drives.

In the former, the disk information for Windows is identical to that

for Microsoft Access.

Steps to Reproduce Behavior

---------------------------

 1. Run SETUP.EXE for Microsoft Access.

 2. Specify an installation path that is on the same hard disk as

    your Windows directory.

 3. Choose Custom Installation (Option 2).

 4. The Microsoft Access Setup Options dialog box will open. The

    bottom half of the dialog box lists Space Required and Space

    Available information twice.

 5. Cancel Setup.

The following steps are optional:

 6. Run SETUP.EXE for Microsoft Access.

 7. Specify an installation path that is on a different hard disk

    than your Windows directory.

 8. Choose Custom Installation (Option 2).

 9. The Microsoft Access Setup Options dialog box will open. The

    bottom half of the dialog box lists different disk information:

    one set of information for the Microsoft Access hard disk, and

    one set of information for the Windows hard disk.

10. Cancel Setup.


INF: CopyObject Appears to Copy Wrong Object

 Article Number: Q92895

 CREATED: 17-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The macro command CopyObject always copies the currently selected

object from the Database window. When you precede this macro command

with a SelectObject command, set its In Database Window parameter

to No, then run the macro from the Database window, the macro is the

selected object and the object copied.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a table and save it as Table1.

2. Create the following macro and call it Macro1. Add the following

   actions:

      Macro1 Actions

      -------------------------

      SelectObject action

         Object Type: Table

         Object Name: Table1

         In Database Window: No

      CopyObject action

         New Name: Table2

3. Open and minimize the table Table1.

4. Select and run Macro1.

Result: Macro1 is copied to Table2, not Table1.

NOTE: If In Database Window is set to Yes, everything works as

expected.

For more information, search for "SelectObject Action" using the Help

menu.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, page 431

Additional reference words: 1.00 1.10 2.00 selectobject checkpage


PRB: Hourglass in Setup Changes to Arrow During Copy

 Article Number: Q92896

 CREATED: 17-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

During the Microsoft Access Setup process, the mouse pointer will

change from an hourglass to an arrow if the mouse is moved while files

are being copied. The pointer will not return to an hourglass until

the Setup program changes to another disk.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Run the Microsoft Access Setup program.

2. Choose Complete Installation. When Setup begins copying the files,

   move the mouse. The hourglass will change to an arrow.

Additional reference words: 1.00 1.10 cursor


INF: Changing the RowSource of a ListBox/ComboBox at Runtime

 Article Number: Q92897

 CREATED: 17-NOV-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

The RowSource property for a combo box or list box cannot be modified

while the form is active. However, there is a workaround for changing the

recordset that the object is bound to. This article discusses that

workaround.

MORE INFORMATION

The workaround for this problem is to bind the object to a query, then

manipulate the query's recordset underneath the object. For example, you

would bind the object to a query called Query1, then create a new query

called Query1 programmatically, while the object is active.

The following example illustrates this technique. In this example, there

is a combo box bound to data from the Products table in the sample

database NWIND.MDB. By selecting one of two check boxes, the order of

records in the combo box will be changed:

1. Create a form with an option group control called MyOption, and a

   combo box called MyCombo.

2. Add two check box controls to MyOption and specify the following

   property:

      AfterUpdate: =NewOrder([MyOption])

3. For MyCombo, specify the following properties:

      RowSourceType: Table/Query

      RowSource: DeleteMe

      ColumnCount: 2

      Locked: True

      Enabled: False

4. Add the following function to a module in the database:

   NOTE: In the following sample code, an underscore (_) is used as a

   line-continuation character. Remove the underscore when re-creating

   this code in Access Basic.

      Option Explicit

      Function NewOrder (WhichSort%)

         DoCmd Hourglass True

         Dim D As Database, Q As QueryDef

         Set D = CurrentDB()

         Screen.ActiveForm!MyCombo.Enabled = True

         Screen.ActiveForm!MyCombo.Locked = False

         On Error Resume Next

         D.DeleteQueryDef ("DeleteMe")

         On Error GoTo 0

         If WhichSort = 1 Then

            Set Q = D.CreateQueryDef("DeleteMe",_

                   "SELECT [Product ID], [Category ID]_

                   FROM Products ORDER BY [Product ID];")

         Else

            Set Q = D.CreateQueryDef("DeleteMe",_

                   "SELECT [Product ID], [Category ID]_

                   FROM Products ORDER BY [Category ID];")

         End If

         Q.Close

         D.Close

         DoCmd Requery "MyCombo"

         DoCmd Hourglass False

      End Function

5. Open the form, select one of the check boxes, and open the combo box.

   Note the order of the records in the combo box.

6. Select the other check box and open the combo box again. Note that the

   records' order has changed.

The key to changing the recordset is in Step 4. By using different SELECT

statements for the CreateQueryDef() methods, you can create any kind of

query.


INF: Double-Clicking on Control Moves Control Unintentionally

 Article Number: Q92898

 CREATED: 17-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

If you double-click a control on a form, a property sheet will appear

containing the properties for that control. A negative side-effect to this

feature is that the control sometimes gets moved when the user

double-clicks it. This article discusses some tips on how to avoid or

correct this situation.

MORE INFORMATION

Here are a couple of tips for avoiding this problem...

 - Use the TAB key to move between controls.. When you move to the control

   by using the TAB key, the control will not be moved.  Once the desired

   control has focus, you can choose the Property Sheet button in the

   toolbar at the top of the screen.

   An alternative to tabbing to the control is to select it by drawing

   a selection around it with your mouse.

 - Take advantage of the Snap To Grid feature.  This feature disallows

   any moving of a control unless the move is significant, thus

   reducing the possibility of moving the control accidentally. Turn

   Snap To Grid off only when you need fine movement for the control.

   You can toggle Snap To Grid by choosing Snap To Grid from the

   Layout menu.

 - If you accidentally move the control, you can choose Undo Move from

   the Edit menu immediately after the move.

Additional reference words: 1.00 1.10 2.00


INF: Requery Control Err Msg: There Is No Control Called...

 Article Number: Q92899

 CREATED: 17-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you try to requery a control by using the Requery macro action,

an error appears indicating that the specified control does not exist

even though the control clearly exists on the form.

MORE INFORMATION

For the Requery Control Name parameter, Microsoft Access expects a

short control name without any brackets. The Help system informs you

that you should not use the full syntax, but it does not mention that

the brackets must be omitted even if the control name consists of more

than one word. Because other scenarios require the use of brackets,

this inconsistency is confusing.

The following example reproduces the problem and discusses the

solution:

1. Create an unbound form called Form1.

2. Place a combo box bound to NWIND.MDB "Sales Totals Query" on the form

   and call the combo box Field1.

3. Create a macro called Macro1 with the following Action/Parameter:

      Action       : Requery

      Control Name : [Field1]

   Note that [Field1] is enclosed in brackets.

4. Save and close Macro1 and drag it on to Form1 in design mode.

5. Switch to Browse mode on the form and choose the button.

   The following error message appears:

      There is no control called '[Field1]'.

6. Remove the brackets from the Control Name parameter in Macro1 and

   try again.

   The control should now work properly.

Additional reference words: 1.00 1.10 2.00 errmsg


PRB: Choosing Toolbar Design Button Causes Unexpected Behavior

 Article Number: Q92949

 CREATED: 19-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you are viewing a form in Form view, choosing the Design button on

the toolbar does not switch the form to Design view if the form's OnClose

property opens another form.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create two new forms named Form1 and Form2.

2. Create the following new macro called TestMacro:

      Macro Name   Action

      ---------------------

      TestMacro    Close

                   OpenForm

      TestMacro Actions

      ----------------------

       Close

          Object Type: Form

          Object Name: Form1

       OpenForm

          Form Name: Form2

          View: Form

          Data Mode: Edit

3. View the property sheet for Form1. Set the OnClose property to

   TestMacro.

4. Save Form1 and then close it.

5. Open Form1 in Design view.

6. Choose the View Form button on the toolbar.

7. Choose the Design button on the toolbar.

Additional reference words: 1.00 1.10


PRB: Bound OLE Object Blank in Form View

 Article Number: Q92950

 CREATED: 19-NOV-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If a bound object frame on a form has its ControlSource property

set to a field that is not of the type OLE Object, the control

will be blank when the form is in Form view. In Datasheet view, the

cells for the control contain "Invalid Object" or "Long Binary Data"

depending on the version of Microsoft Access you are using.

CAUSE

A bound object frame must refer to a field of the type OLE Object

in a table or query in order to display anything in Form view. To

display an object in this control, the ControlSource property must

be set to an OLE Object field. For example, Microsoft Access cannot

display the contents of a Text field as an OLE Object. Object

frames will appear blank unless there is something to show.

RESOLUTION

Choose an OLE Object field as the ControlSource for the bound frame.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

The following steps use the sample database NWIND.MDB:

1. Create a new form using the Employees table.

2. Add a bound object frame control to the form.

3. Set the ControlSource property to First Name.

4. Switch the form to Form View.

Note that the bound object frame is blank.

REFERENCES

==========

For more information, search for "bound object frame" using the Microsoft

Access Help menu.

Additional reference words: 1.00 1.10 2.00 linking embedding empty


PRB: Edit Undo Command Text Is Misleading

 Article Number: Q92951

 CREATED: 19-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The text string for the Undo command does not correctly reflect the type of

object you are editing. For example, if you are adding or modifying actions

in a macro, and then open the Edit menu, the text string that you see for

the Undo command is "Undo Property Setting," rather than "Undo Macro

Action."

RESOLUTION

Even though the specific text associated with the Undo command is

misleading, the Undo functionality is unaffected, and will perform as it

should.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Create a new macro.

2. In the Macro Action column, type "Close" (without the quotation

   marks), and then press ENTER.

3. From the Edit menu, choose Undo Property Settings.

The word "Close" will be removed from the Macro action.

Additional reference words: 1.00 1.10 2.00


PRB: Import/Export Setup Cancel Button Cancels Unsaved Changes

 Article Number: Q93022

 CREATED: 22-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The Cancel button in the Import/Export Setup dialog box cancels only

those changes that have not been saved. It does not cancel all changes

made since entering the dialog box.

CAUSE

If you make a change to the specification and then choose the Save As

button, choosing the Cancel button does not invalidate those changes.

The Cancel button cancels only those changes that have not been saved

and then returns you to the Database window.

NOTE: The OK button performs a "save and exit"; the Save As button

saves your changes but does not close the dialog box.

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10 2.00


INF: No Custom Printer Setup for Mailing Labels ReportWizard

 Article Number: Q93023

 CREATED: 22-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The Mailing Labels ReportWizard allows you to choose from 66 different

labels. However, the ReportWizard does not verify whether the labels

you select will correctly fit on the paper size that you have

specified.

You may need to manually customize your printer setup or the number of

labels per page after using the ReportWizard.

MORE INFORMATION

The need to customize the printer setup is most common with dot-matrix

printers. Label sizes other than .5 inch or 1 inch may not fit evenly

on the default 11-inch page.

To manually customize your printer setup or the number of labels

per page:

1. Preview your report.

2. From the File menu, choose Print Setup.

3. Customize your margins to accommodate the number and width of

   the labels.

4. Choose the More button in the Print Setup dialog box to customize

   the number of rows of labels.

Additional reference words: 1.00 1.10 2.00 wizards


INF: Default AutoLabel and AddColon Properties

 Article Number: Q93024

 CREATED: 22-NOV-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

The following table shows the default values for the AutoLabel and

AddColon properties for the different form and report objects:

   Toolbox object       AutoLabel    AddColon

   ------------------------------------------

   Text box                Yes         Yes

   Option group            Yes         No

   Toggle button           No          No

   Option button           Yes         No

   Check box               Yes         No

   Combo box               Yes         Yes

   List box                Yes         Yes

   Subform/Subreport       Yes         Yes

   Bound object frame      Yes         Yes

   Command button          No          No

REFERENCES

==========

Microsoft Access "User's Guide," versions 1.0 and 1.1, Chapter 9,

"Designing Forms," and Chapter 18, "Designing Reports"

Microsoft Access "User's Guide," version 2.0, Chapter 15, "Designing

Forms," and Chapter 21, "Designing Reports"

Additional reference words: 1.00 1.10 2.00 auto label add colon


INF: Using DLookup() to Look Up Values in Forms and Reports

 Article Number: Q93025

 CREATED: 22-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

You can display multiple fields in a combo or list box on a form or report

even when those fields come from a table that is not bound to the form or

report. You can also update controls such as text boxes with new

information based on what a user selects from a combo or list box.

To accomplish these objectives, use one of these three techniques:

1. Use row fix-up in forms. For more information on row fix-up, query on

   the following words here in the Microsoft Knowledge Base:

      "row fix-up" and "multiple" and "one to many"

2. Use multiple DLookup() functions in forms and reports. See the "More

   Information" section below.

3. Use the Column property of a multiple-column combo box to update a

   text box control with new information as focus moves from row to

   row in the combo box. For more information on this, query on the

   following words here in the Microsoft Knowledge Base:

      "column property" and "combo box" and "update"

MORE INFORMATION

DLookup() Function

------------------

Here is the syntax for DLookup():

   DLookup(expr, domain, [criteria] )

The DLookup() function returns a value from a field in a specified set of

records called the domain. The DLookup() function specifies the criteria

for the domain. To make the domain dependent on one or more values listed

in controls on a form or report, refer to the controls in the DLookup()

criteria argument.

The following example looks in the Employees table (the domain) and returns

the Last Name of the Employee ID specified in the [ControlName] control on

the Form.

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   =DLookup("[Last Name]", "Employees", "[Employee ID] =_

            Forms!FormName![ControlName]")

For reports, use Reports!ReportName![ControlName].

DLookup() returns one value from a single field even if more than one

record satisfies the criteria. If no record satisfies the criteria or if

the domain contains no records, DLookup() returns Null.

REFERENCES

==========

For more information on the DLookup() function, search for "DLookup" then

"DLookup Function" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 functions checkpage


INF: Users Can Edit but Not Commit Read-Only OLE Objects

 Article Number: Q93026

 CREATED: 22-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Users are allowed to edit OLE objects in a database that has been

opened as read-only, or in a form that is read-only. However, when a

user attempts to move to the next record or chooses Save Record from

the File menu, Microsoft Access displays a message indicating that the

record cannot be updated.

To prevent users from attempting to edit OLE objects in read-only

forms, set the Enabled property of the object frame to No.

MORE INFORMATION

In a read-only database, a user is allowed to edit and update OLE

objects but is not allowed to commit a record with these changes. At

the point the record is committed, the following message appears:

   Can't save changes to this object because you don't have

   permission to write to the record. Copy the object to the

   Clipboard if you want to save it, then choose Undo Field.

The user must undo the changes before the record can be committed. To

save the changes, the user must copy the object to the Clipboard

before choosing Undo Field.

Additional reference words: 1.00 1.10 2.00 object linking embedding


INF: DeleteControl, DeleteReportControl, and CreateGroupLevel

 Article Number: Q93094

 CREATED: 23-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article discusses two Microsoft Access undocumented commands,

DeleteControl and DeleteReportControl, and an undocumented function,

CreateGroupLevel(). If you intend to write your own FormWizard or

ReportWizard, you can use the commands to delete controls on a form or

report that is available in Design view, and you can use the function to

create groups on a report that is available in Design view.

MORE INFORMATION

You can use DeleteControl and DeleteReportControl commands to delete a

control that exists on a form or report in Design view. Both commands

require a string value that represents the name of the form or report and

a string value that represents the name of the control.

DeleteControl and DeleteReportControl are commands, not functions. They do

not return a value.

The example below creates a form, then creates a button on the form,

displays a message, and deletes the button on the form:

   Dim MyForm As Form, MyControl As Control

   Set MyForm = CreateForm()

   Set MyControl = CreateControl(MyForm.FormName, 104)

   MsgBox "About to Delete " & MyControl.ControlName

   DeleteControl MyForm.FormName, MyControl.ControlName

When you delete a control using DeleteControl or DeleteReportControl,

there is no visual feedback that the control is gone if the form or report

is not minimized. The control still appears as if it were not deleted

even though you can not click it to give it focus. To make the deleted

control disappear, you must repaint the form design window by minimizing it

and then restoring it.

If you have a report available in Design view, you can create groups for it

in a procedure by using the CreateGroupLevel() function. Here is the syntax

for CreateGroupLevel():

   Function CreateGroupLevel(ReportName$,Expression$,

                             HasHeader$, HasFooter$)

ReportName is a string expression representing the report name.

Expression is a string expression representing the name of the field or

calculated field that you want to group by.

HasHeader and HasFooter indicate whether the group includes a group

header or group footer, respectively.

On execution, CreateGroupLevel() adds a group at the innermost level. For

example, if one group already exists, CreateGroupLevel() creates a second

group within the first group. CreateGroupLevel() returns a number

indicating which level it created, beginning with zero. In the example just

mentioned, CreateGroupLevel() returns one because it is the second group,

and the first group was Group zero.

REFERENCES

==========

For more information on Microsoft Access libraries, query on the following

words here in the Microsoft Knowledge Base:

   libraries and debugging and creating

For more information on other AccessWizard functions, query on the

following words here in the Microsoft Knowledge Base:

   CreateControl and CreateReportControl and CreateForm and

   CreateReport and "Section Property" and DeleteControl and

   DeleteReportControl and CreateGroupLevel

Additional reference words: 1.00 1.10 2.00


INF: CreateControl() and CreateReportControl() Functions

 Article Number: Q93095

 CREATED: 23-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article discusses the Microsoft Access functions CreateControl()

and CreateReportControl(). If you intend to write your own FormWizards

or ReportWizards, you can use these functions to create controls on a

form or report that are available in Design view.

This article is for those who are already familiar with Access Basic and

with designing forms and reports.

MORE INFORMATION

You can use the CreateControl() and CreateReportControl() functions to

create new controls for a form or report opened in Design view. These

functions require two arguments: the name of the form or report as a string

value and a numeric code that represents the control type.

Here are the control types and their associated numeric codes:

   Integer   Control Type

   --------------------------------------

   100       label

   101       rectangle

   102       line

   103       (not used)

   104       command button

   105       option button

   106       check box

   107       option group

   108       bound object frame

   109       text box

   110       list box

   111       text box with drop-down grid

   112       subform/subreport

   113       graph

   114       unbound object frame

   118       page break

CreateControl() and CreateReportControl() both return a control object

value. Therefore, you need first to define a control variable, and

then set the control variable equal to the function name.

For example, the following procedure creates a form and then adds a button

to the form:

   Dim MyForm As Form, MyControl As Control

   Set MyForm = CreateForm()

   Set MyControl = CreateControl(MyForm.FormName, 104)

When the procedure is finished, you can modify the properties of the new

control by using the control variable you defined. For example, you can

change the control's Width and Caption properties with these statements:

   MyControl.Width = 2000

   MyControl.Caption = "&Sum All Records"

For controls that are frequently associated with a field in a table or

query, you can modify the ControlSource property to bind the control to

the field.

By default, some controls are created with their Height and Width

properties set to zero to make them invisible. Also by default, controls

appear in the upper-left corner of the form. You can adjust the size and

position of a control immediately after you create it by changing the

control's properties. For example, the following code creates, sizes,

moves, and then binds a text box to a field by changing the properties:

   Set MyControl = CreateControl(MyForm.FormName, 109)

   MyControl.Width = 1500

   MyControl.Height = 200

   MyControl.Top = 440

   MyControl.Left = 200

   MyControl.ControlSource = "[Category ID]"

In addition to the form name and the code for the type of control, you can

also specify the form or report Section where you want Microsoft Access to

place the control.

The following is the CreateControl() syntax. The CreateReportControl()

syntax is identical.

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   Function CreateControl (FormName As String,_

                           ControlType As Integer_

                           [,SectionNumber As Integer])

SectionNumber is the Section property setting number that identifies a

particular section as follows:

   Detail section ................................ 0

   Form or report header section ................. 1

   Form or report footer section ................. 2

   Form or report page header section ............ 3

   Form or report page footer section ............ 4

   Group-level 1 header section (reports only) ... 5

   Group-level 1 footer section (reports only) ... 6

   Group-level 2 header section (reports only) ... 7

   Group-level 2 footer section (reports only) ... 8

If a report has additional group-level sections, the header/footer pairs

are numbered consecutively beginning with 9.

REFERENCES

==========

For more information on Microsoft Access libraries, query on the following

words here in the Microsoft Knowledge Base:

   libraries and debugging and creating

For more information on other AccessWizard functions, query on the

following words here in the Microsoft Knowledge Base:

   CreateControl and CreateReportControl and CreateForm and

   CreateReport and "Section Property" and DeleteControl and

   DeleteReportControl and CreateGroupLevel

For more information on the CreateForm(), CreateReport(), CreateControl(),

and CreateReportControl() functions, search for each function name and then

view its topic using the Microsoft Access version 2.0 Help menu.

Additional reference words: 1.00 1.10 2.00


INF: Using Undocumented CreateForm(), CreateReport() Functions

 Article Number: Q93096

 CREATED: 23-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article discusses the Microsoft Access undocumented functions

CreateForm() and CreateReport(). If you intend to write your own

FormWizard or ReportWizard, you can use these functions to create and

customize a blank form or report to which you can add controls.

This article assumes that you are familiar with Access Basic and

designing forms and reports.

MORE INFORMATION

CreateForm()/CreateReport() is roughly equivalent to choosing "New...

Form/New... Report" from the File menu at the top of the screen. When

the function is executed, a new empty form/report appears in an

iconized state.

Both functions return an object value that you can use for further

manipulation, and neither function requires parameters.

To use these functions, first define a form or report object

variable, then assign the variable to the function name. An example of

how to do this is:

   Dim MyForm As Form

   Set MyForm = CreateForm()

After opening the form/report in design mode after executing the

commands above, you can bind the form to a table or query by modifying

the form's/report's RecordSource property:

   MyForm.RecordSource = "Categories"

With the form/report in design mode, you can access and change any of the

other design-time properties of the form/report. You can also access and

change properties of each of the form's/report's sections via the Section

property. The Section property is actually an array with each array value

being a reference to a form's/report's section. For forms, the Section

property array is broken down as:

   Section(0) - Detail Section

   Section(1) - Form Header

   Section(2) - Form Footer

   Section(3) - Page Header

   Section(4) - Page Footer

For reports, the section property array is broken down as:

   Section(0) - Detail Section

   Section(1) - Report Header

   Section(2) - Report Footer

   Section(3) - Page Header

   Section(4) - Page Footer

   Section(5) - Group Level 1 Header

   Section(6) - Group Level 1 Footer

   Section(7) - Group Level 2 Header

      ...etc.

With this information, you can customize the design of a form/report

section programmatically. The following example creates a new report,

hides the page footer by setting its Visible property to false, sets

the Height property of the detail section, and enables its

KeepTogether property:

   Dim MyReport As Report

   Set MyReport = CreateReport()

   MyReport.Section(4).Visible = False

   MyReport.Section(0).Height = 1760

   MyReport.Section(0).KeepTogether = True

REFERENCES

==========

For more information on Microsoft Access libraries, query on the

following words here in the Microsoft Knowledge Base:

    libraries and debugging and creating

For more information on other ReportWizard and FormWizard functions,

query on the following words here in the Microsoft Knowledge Base:

   CreateControl and CreateReportControl and CreateForm and

   CreateReport and "Section Property" and DeleteControl and

   DeleteReportControl and CreateGroupLevel

For more information on the CreateForm(), CreateReport(), CreateControl(),

and CreateReportControl() functions, search for each function name and then

view its topic using the Microsoft Access version 2.0 Help menu.

Additional reference words: 1.00 1.10 2.00 wizards


PRB: Creating Multiple New Import/Export Specifications

 Article Number: Q93136

 CREATED: 24-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Creating multiple new Import/Export specifications using the

Import/Export Setup dialog box requires that you either exit the

dialog or delete or change each entry in the dialog that does not

apply. The dialog does not provide a method to clear or reset each

option in the dialog.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open any database or create a new one.

2. From the File menu, choose Imp/Exp Setup.

3. Enter information in several fields.

4. From the File menu, choose Save As.

If you want to create another specification at this point, you must

either exit this dialog or manually delete all of the irrelevant

information.

Additional reference words: 1.00 1.10 2.00


INF: Field Size of 0 Treated as 255

 Article Number: Q93137

 CREATED: 24-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

If you set a field size to zero (0) for a text field in table Design

view, the field is treated as if the size is set to 255. When you

close and save the table, and then reopen it in Design view, the field

size will have been changed to 255.

Additional reference words: 1.00 1.10 2.00 mode


INF: Using Column Property of Combo Box to Update Text Box

 Article Number: Q93138

 CREATED: 24-NOV-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

You can display multiple fields in a combo or list box on a form or report

even when those fields come from a table that is not bound to the form or

report. You can also update controls such as text boxes with new

information based on what a user selects from a combo or list box.

MORE INFORMATION

To accomplish these objectives, use one of these techniques:

 - Use Row Fix-up in forms. For more information on Row Fix-up, query on

   the following words here in the Microsoft Knowledge Base:

      Row and Fix-up

 - Use multiple DLookup() functions in forms and reports. For more

   information on the DLookup() function, query on the following words

   here in the Microsoft Knowledge Base:

      DLookup and forms and reports

 - Use the Column property of a multiple-column combo box to update

   a text box control with new information as focus moves from row to

   row in the combo box. The next section describes this technique in

   detail.

Using the Column Property of a Combo Box

----------------------------------------

By assigning the Column property of a multiple-column combo or list box to

a text box, you can display one column from the current combo box selection

in the text box. Microsoft Access automatically updates the text box when a

selection is made from the combo box. The following example demonstrates

how to do this:

1. Create your form or report based on the appropriate table or query.

2. Create a combo or list box that retrieves information from more than

   one field. For example, you might use the following multiple-column

   Select statement as the RowSource for a combo or list box to display

   information from several columns in the Categories table:

      Select [Category Id], [Category Name], [Description] from

         Categories Order by [Category Name];

   For this example, set the ColumnCount property to 3, and set the

   ColumnWidth property to an appropriate size for the combo or list

   box. Once you have the combo or list box sized correctly and

   defined to return multiple fields, you can use the Column property

   to display the current selection in a text box control. Choose one

   entry in the list box first or it will return a null.

   The Column property uses a reference argument to refer to a specific

   column in the multiple-column combo or list box. Use Column(0) to

   refer to the first column, Column(1) to refer to the second column,

   and so on.

   This example uses Column(1) to refer to [Category Name]--the second

   column in the combo box.

3. To display the [Category Name] of the current combo box selection,

   create a text box control. Make the text box a calculated control by

   defining the following expression as the data source for the text box:

      =[<ComboControlName>].Column(1)

   <ComboControlName> is the name of the combo box. The Column property

   will make the text box (calculated control) read-only.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 9, "Designing Forms,"

pages 233-245

Microsoft Access "User's Guide," version 2.0, Chapter 16, "Customizing

Forms," "Creating a List Box or Combo Box with a Wizard"

For more information on the Column property, search for "combo box:

properties" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


PRB: Error Message When Opening Second Instance of .MDB File

 Article Number: Q93139

 CREATED: 24-NOV-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you open a database exclusively, and then attempt to open the same

database as shared in another instance of Microsoft Access, you receive the

following error message:

   'Database.mdb' This file is already in use. Use a new filename or

   close the file in use by another application.

In Microsoft Access version 1.x, when you open a database as shared, then

attempt to open the same database exclusively in another instance of

Microsoft Access, you receive the error message:

   Couldn't open file '<path><filename>'.

This message is not very helpful, in that it does not state why the file

could not be opened.

In Microsoft Access version 2.0, you receive the error message:

   The Database is opened by user '<username>' on machine

   '<machine name>'. You can't open this database exclusively.

RESOLUTION

Open the database as shared in the second instance of Microsoft Access, or

close the database in the first instance of Microsoft Access.

STATUS

This behavior is by design.

REFERENCES

==========

For more information on opening a database for shared access, search for

"opening databases" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 lock network multiuser errmsg


PRB: Cannot Rollback in Transaction without Closing Database

 Article Number: Q93140

 CREATED: 24-NOV-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

A subroutine or a function contains a transaction process which

calls a subroutine or function that dimensions and opens a database

using the OpenDatabase method. When the subroutine or function

exits, Microsoft Access implicitly closes the database (no Close

method is called). When the subroutine or function attempts to

execute the CommitTrans or Rollback statement, Microsoft Access

displays the following message:

   Commit or Rollback without BeginTrans.

CAUSE

When the called subroutine or function exits, Microsoft Access

implicitly closes the database. Internally, the initial attempt to

close the database fails because the database was opened in a

transaction. Microsoft detects this error and performs an implicit

transaction rollback, then it closes the database successfully.

RESOLUTION

To perform a Rollback in the called subroutine or function, you

must first call the Close statement to close the open database.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create the following module.

      '************************************************************

      'Declarations section of the module.

      '************************************************************

      Option Explicit

      '============================================================

      'The following Sub procedure starts a transaction, calls

      'another sub procedure, then attempts to rollback.

      '============================================================

      Sub Test1

         BeginTrans

            Call Test2

         Rollback

      End Sub

      '============================================================

      'The following Sub procedure sets a Database variable to

      'the current database.

      '============================================================

      Sub Test2

         Dim MyDB as Database

         Set MyDB = CurrentDB()

         'the database is implicitly closed on exit

      End Sub

2. Compile the module.

3. In the Immediate window, enter Test1. Microsoft Access generates

   the following message:

      Commit or Rollback without BeginTrans.

Perform the following four steps to demonstrate the resolution to this

problem.

1. Perform Step 1 above.

2. Edit the second function to add MyDB.Close, as follows.

      '============================================================

      'The following Sub procedure will set a Database variable to

      'the current database, and then close the database.

      '============================================================

      Sub Test2

         Dim MyDB as Database

         Set MyDB = CurrentDB()

         MyDB.Close

      End Sub

3. Compile the module.

4. In the Immediate window enter Test1. The Rollback works correctly

   because the code explicitly closes the database opened in the

   transaction.

Additional reference words: 1.00 1.10


INF: How to Pass a Single Byte of Data to Windows API Calls

 Article Number: Q93141

 CREATED: 24-NOV-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access does not have a single-byte data type. To pass a byte

to an external function such as a Windows application programming

interface (API) function or a dynamic-link library (DLL), you should

declare the byte as an integer.

If you need to pass a single byte of information in a data type, such

as the RGBQUAD structure, you should pass the data structure as a

string type.

MORE INFORMATION

The Intel chip supports only a full word on the stack. You cannot put

just 8 bits on the stack; you must use the full 16 bits. If you

attempt to pass only 8 bits, you will end up passing 16 bits (your 8

bits of data plus an additional 8 bits that will be "padded"). This

is a limitation of the processor, not Microsoft Access.

To pass a single byte of data in a structure such as the RGBQUAD, use

a fixed-length string of 1. For example, suppose you want to pass a

single byte in the "C" RGBQUAD data structure, which looks like this:

   typedef struct tagRGBQUAD{

      BYTE   rgbBlue;

      BYTE   rgbGreen;

      BYTE   rgbRed;

      BYTE   rgbReserve;

   } RGBQUAD

You can redefine this structure with Access Basic as:

   Type RGBQUAD

      rgbBlue As String * 1

      rgbGreen As String * 1

      rgbRed As String * 1

      rgbReserve As String * 1

   End Type

   Dim RGB As RGBQUAD

   RGB.rgbBlue = Chr$(10)

   RGB.rgbRed = Chr$(14)

   RGB.rgbGreen = Chr$(15)

     NOTE: In the above example, Blue=10, Red=14, and Green=15.

For more information on this topic, search for "Type Statement" using

the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 windows API data type


PRB: Option Button Appears Fuzzy in Datasheet View

 Article Number: Q93142

 CREATED: 24-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you create a form and place an option button on the form, then

switch to Datasheet view, the outline of the option button will

appear fuzzy. This happens when the focus is on any option button

in Datasheet view.

RESOLUTION

Move the focus to a field that does not contain an option button.

The option button will change to a normal appearance.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Create a new blank form.

2. From the toolbox, select the Option button and place it on the

   form.

3. Switch to Datasheet view.

4. Make sure the focus is on the button. Notice the outline of the

   button has a fuzzy appearance.

Additional reference words: 1.00 1.10 2.00 misc


INF: Online Help for Sigma Button Is Incorrect

 Article Number: Q93143

 CREATED: 24-NOV-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

--------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

--------------------------------------------------------------------

SUMMARY

In Microsoft Access Help, if you search for "Sigma Button," you are

incorrectly pointed to information about the Reinitialize button.

Instead, you should be pointed to information about the Totals button.

MORE INFORMATION

One of the tools available on the toolbar in the Query Design window

is the Totals button. The symbol used to identify the Totals button is

the Greek letter sigma.

The Reinitialize button is one of the tools available on the toolbar

in the Module Design window.


INF: Microsoft Access is Pen Compatible but Not Pen Aware

 Article Number: Q93144

 CREATED: 24-NOV-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access is pen compatible but not pen aware. This means you

can use the pen as a substitute for the mouse.

MORE INFORMATION

The request to allow Microsoft Access access to Pen extensions has

been noted as an enhancement request and will be considered for future

releases.

Additional reference words: 1.00 1.10 2.00


INF: How MS Access Handles Logins to Attached SQL Tables

 Article Number: Q93145

 CREATED: 24-NOV-1992

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

How Microsoft Access handles a login to an attached SQL table depends

on how the table was originally attached, and whether the login and

password were saved with the table information. It may also depend on

who attached the SQL table, what rights that person has to that table,

what rights you have to that table, and where the tables are located

(different servers, different databases, same database).

MORE INFORMATION

If the "Save login ID and password locally" option was enabled when a

SQL table is attached, you will not be prompted for a login ID and

password. Instead, you automatically receive the rights to each table

that are appropriate for the login ID used when the table was

attached.

If this option was not enabled, you are prompted for a login ID and

password once for each unique data source, and you receive the rights

to each table that are appropriate for the login ID that you use.

NOTE: A unique data source is composed of the unique combination of a

SQL server and a database on that server.

So, if you attach multiple SQL tables and use different login IDs with

different rights for each table, but do not enable the option to save

the login and password information, the next time you access the

tables, the login ID and password you supply for each data source will

determine the authority you have to the tables from that data source.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 60-62 and 66-68

Additional reference words: 1.00 1.10


PRA: Error Msg: Data Has Changed, Operation Aborted

 Article Number: Q93146

 CREATED: 24-NOV-1992

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00

--------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

--------------------------------------------------------------------

SYMPTOMS

When a user (User1) attempts to commit a record in an attached Paradox

table and that record has been changed by another user (User2), User1

sees this error message:

   Data has changed; operation aborted.

After User1 chooses the OK button, a second error message appears:

   This record has been changed by another user since you

   began editing it...  Save Record, Copy to Clipboard,

   Drop Changes.

If User1 selects the Save Record option, the first error message is

repeated. User1 is caught in a continuous loop, unable to commit the

record.

RESOLUTION

To save the changes made to the current record, User1 must:

1. Select the Copy to Clipboard option.

2. Select the record User1 was attempting to change.

3. Choose Paste from the Edit menu.

4. Commit the record.

User1 can prevent User2 from changing a record while User1 is editing

it by changing the multiuser option to Edited Records.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version

1.0. This problem no longer occurs in Microsoft Access version 1.1.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

These steps require either two users or two instances of Microsoft

Access.

1. Both users attach to a Paradox Table.

2. Both users set their multiuser options to No Locks.

3. User1 starts to edit a field but does not commit the record.

4. User2 changes and commits the same record by choosing Save Record from

   the File menu or by moving the cursor to the next record.

5. User1 attempts to commit the changed record.

   Error Message #1: Data has changed; operation stopped.

   Error Message #2: This record has been changed by another user since you

   began editing it... Save Record, Copy to Clipboard, Drop Changes.

Additional reference words: 1.00 Misc multi-user transaction errmsg


PRB: Form Opened in Form View Is Completely Blank

 Article Number: Q93261

 CREATED: 03-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You open a form in Form view, and it is completely blank. There are no

controls or text. Everything is blank.

CAUSE

Typically, this happens because the dynaset contains no records or

privileges have been limited.

RESOLUTION

Controls located in form headers or footers are always visible--even

when privilege limits or empty dynasets prevent the display of controls

located in the detail section. Therefore, when you design a form, place

necessary controls such as command buttons and check boxes in the form

header or footer section. Also, you should ensure that each dynaset

contains at least one record.

STATUS

This behavior is by design.

MORE INFORMATION

The following situations may cause a blank form to display:

 - The form is based on a query that contains a one-to-many join, and

   the query returns no records.

 - The form is not updatable at all. It is a read-only form with the

   AllowUpdating property set to No Tables, or it is a static form that

   displays results by using a GROUP BY clause or a DISTINCT operator.

 - The form is based on a query that contains a one-to-one join, and one of

   the tables is in a read-only database.

 - The form is based on a query that contains a many-to-one inner join,

   and the query does not contain all the joined columns of the many-side

   table.

 - The form is based on a query that includes an updatable remote table

   but does not include all the columns that make up the primary key.

 - The form is read-only and is based on an empty table.

Steps to Reproduce Situation 1

------------------------------

1. Change the Catalog query in the NWIND sample database placing IS NULL

   in the criteria cell for the field [Category Name].

2. Create a new form based on the modified query, and place some fields

   and a command button in the detail section.

3. Switch to Form view.

Result: The blank form is displayed.

Steps to Reproduce Situation 6

------------------------------

1. Create a new table. Do not enter any data.

2. Create a new form based on the table. Add a command button and

   make the form read-only.

3. Switch to form view.

Result: A blank form is displayed.

The form displays blank in all situations because the dynaset is empty.

The form would display as expected if you were adding new records, but

the setting for the form or the joins in the query prevent you from

using the form to add new records.

To work around this issue, place necessary controls or command buttons in

the form header and footer. Headers and footers display even when the

detail section is blank.

Additional reference words: 1.00 1.10 2.00


PRB: Close Dynaset Based on Form Multiple Times

 Article Number: Q93292

 CREATED: 03-DEC-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you create a dynaset that is based on a form using Access Basic, you can

have multiple dynaset.Close statements without generating an error message.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Open the Customers form in Form view.

3. Create the following new module:

      '*******************************************************

      'Declarations section of the module.

      '*******************************************************

      Option Explicit

      '=======================================================

      ' The following function will create a dynaset based on

      ' the Add Products form in the NorthWind database. The

      ' function will then attempt to close the dynaset twice.

      '=======================================================

      Function MultiClose()

         Dim MyDyna as Dynaset

         Set MyDyna=Forms![Customers].Dynaset

         MyDyna.Close

         MyDyna.Close

      End Function

4. From the View menu, choose Immediate Window.

5. Run the code you created in step 3 by typing "? MultiClose()" (without

   quotation marks) in the Immediate window. Note that there are no error

   messages, even though the code attempts to close the dynaset more than

   once.

NOTE: This behavior is the same in Microsoft Access version 2.0. However,

you will get the error message "Object is no longer valid" if you attempt

to close a Recordset object multiple times in version 2.0.

Additional reference words: 1.00 1.10 2.00


PRA: Error Using SQL in Report RecordSource Property

 Article Number: Q93293

 CREATED: 03-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You receive the following error message when you try to use a valid

SQL statement as the RecordSource in a report:

   This report is bound to a table or query that doesn't exist:

   '<SQL statement>'.

RESOLUTION

Create a query using the SQL statement, and then base your report on that

query.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

versions 1.0 and 1.1. This problem no longer occurs in Microsoft Access

version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB.

2. Open the Category List query in Design view.

3. From the View menu, choose SQL.

4. Select the contents of the SQL window. Then, choose Copy from the Edit

   menu.

5. Choose Cancel to close the SQL dialog box. Then close the Category

   List query.

6. Open a new unbound form, and paste the SQL statement into the form's

   RecordSource property by choosing Paste from the Edit menu.

7. View the form in Form view.

8. Open a new unbound report, and paste the SQL statement into the

   report's RecordSource property by choose Paste from the Edit menu.

9. Preview the report.

Note that you do not receive an error message in step 7, but you do in

step 9. You can use a valid SQL statement as the RecordSource in a form,

but not in a report.

Additional reference words: 1.00 1.10 errmsg


INF: All Duplicate Macro Names in Macro Group Are Executed

 Article Number: Q93294

 CREATED: 03-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you have two macros in the same macro group with the same name, both

macros will be executed. This problem will not occur if the macros are not

consecutive in the macro group--that is, there is a different macro between

the two macros with the same name.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new macro with two actions:

      MacroName         Action   Argument

      ----------------------------------------------------

      First One         MsgBox   "This is the message"

      First One         MsgBox   "This is the message"

2. Save the macro as Macro1.

3. Run the macro using Macro1.FirstOne. The MsgBox will appear twice.

Additional reference words: 1.00 1.10 2.00


PRB: "Couldn't Open File" Error Message

 Article Number: Q93295

 CREATED: 03-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Attempting to open a database exclusively when another user already

has it open results in the error message:

   Couldn't open file <database name>.

CAUSE

The Help topic says in part "You must have ReadData permission for

the file in order to view its data." The error message and Help

text are misleading because the problem is that the file cannot be

opened exclusively.

RESOLUTION

To open the file successfully:

1. Press ESC or choose the OK button to exit the error message.

2. From the File menu, choose Open Database.

3. Select the database you want to open.

4. Clear the Exclusive check box.

5. Choose OK.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10 network share errmsg checkbox


INF: View Procedures Sorts Modules Alphabetically

 Article Number: Q93296

 CREATED: 03-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you choose Procedures from the View menu after opening a module,

the Modules box displays the modules in alphabetic order. If the

modules are numbered, they may appear out of order. You can rename the

procedures so they appear properly sorted in the list.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create three modules (Module1, Module2, Module19).

2. Open Module1, and choose Procedures from the View menu.

   The modules are listed Module1, Module19, and Module2, since they

   are sorted alphabetically.

To have the list sorted properly, rename Module1 and Module2 as

Module01 and Module02. The modules will now be sorted as Module01,

Module02, and Module19.

Note: The modules are sorted the same way in the Database window.

Additional reference words: 1.00 1.10 2.00


INF: How to Remove Attached Tables with a Macro

 Article Number: Q93297

 CREATED: 03-DEC-1992

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The TransferDatabase action is the macro equivalent of the Attach Tables

command on the File menu. However, there is no action to detach a table. To

remove an attached table from the Database window, select the table in the

Database window and press the DELETE key. You can also create a macro to

detach a table or you can call the action from an Access Basic module using

the DoCmd statement.

MORE INFORMATION

To detach a table in Microsoft Access version 1.x, create the following

macro:

   Macro Name    Action

   --------------------------

   RemoveTable   SelectObject

                 DoMenuItem

   RemoveTable Actions

   ---------------------------

   SelectObject

      Object Type: Table

      Object Name: <tablename>

      In Database Window: Yes

   DoMenuItem

      Menu Bar: Database

      Menu Name: Edit

      Command: Delete

To detach a table in Microsoft Access version 2.0, create the following

macro:

   Macro Name    Action

   --------------------------

   RemoveTable   DeleteObject

   RemoveTable Action

   ---------------------------

   DeleteObject

      Object Type: Table

      Object Name: <tablename>

In Access Basic, use a DoCmd statement to run the RemoveTable macro.

Additional reference words: 1.00 1.10 2.00 unattach


INF: How to Change Read-Only Properties at Run Time

 Article Number: Q93298

 CREATED: 03-DEC-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Microsoft Access does not allow you to change some control properties,

such as Color and Caption, at run time. This article discusses how you

can get around this limitation.

MORE INFORMATION

You can work around this limitation by creating two controls that are

identical except for the property you want to change. You place these

controls at the same location with their Visible property set to No.

At the point where the property is to change, set the Visible property

of the control with the desired property setting to Yes using a Macro

SetValue action, and set the Visible property of the other control to

No in the same manner.

The following example demonstrates this method. In the example, a form

appears with one button and text box. The text box is Blue, and the

button has the Caption "Red." When you click the button, the text

box's color will change to red and the button's caption will change to

"Blue." Clicking the Blue button will toggle back to Red, and so on.

1. Create a new form with the following two text boxes:

       Text Box

       -----------------

       Control Name: Red

       Fill Color: 255

       Visible: No

       Text Box

       --------------------

       Control Name: Blue

       Fill Color: 16711680

       Visible: Yes

2. Position the text box called Blue directly on top of the text box

   called Red and make sure they are exactly the same size so that

   one covers the other.

3. Add the following two command buttons to the form:

       Command Button

       ------------------------

       Control Name: RedButton

       Caption: Change to Red

       Visible: Yes

       On Push: ChangeColor.Red

       Command Button

       -------------------------

       Control Name: BlueButton

       Caption: Change to Blue

       Visible: No

       On Push: ChangeColor.Blue

4. Position the command button called BlueButton directly on top of the

   command button called RedButton and make sure they are exactly

   the same size so that one covers the other.

5. Add the following text box to the form and delete its label:

       Text Box

       -------------------------

       Control Name: GiveMeFocus

       Width: 0

   The purpose of the zero width for the text box is to maintain focus

   while the Visible properties of other controls are changing.

6. Save the form as ChangeColor and then close it.

7. Create the following new macro:

       Macro Name  Action          Arguments

       ---------------------------------------------------------------

       Blue        GoToControl     ControlName .. GiveMeFocus

                   SetValue        Item ......... [Blue]

                                   Expression ... [Red]

                   SetValue        Item ......... [Blue].Visible

                                   Expression ... True

                   SetValue        Item ......... [Red].Visible

                                   Expression ... False

                   SetValue        Item ......... [RedButton].Visible

                                   Expression ... True

                   SetValue        Item ......... [BlueButton].Visible

                                   Expression ... False

       Red         GoToControl     ControlName .. GiveMeFocus

                   SetValue        Item ......... [Red]

                                   Expression ... [Blue]

                   SetValue        Item ......... [Red].Visible

                                   Expression ... True

                   SetValue        Item ......... [Blue].Visible

                                   Expression ... False

                   SetValue        Item ......... [BlueButton].Visible

                                   Expression ... True

                   SetValue        Item ......... [RedButton].Visible

                                   Expression ... False

8. Save the macro as ChangeColor and then close it.

9. Open the ChangeColor form in Form view. Type any text in the text

   box, and then click the command button. Note that each time you click

   the command button, the color and caption of the button changes,

   without changing the value of the text box.


PRB: "Too Many Expressions in Distinct Output" Error

 Article Number: Q93299

 CREATED: 03-DEC-1992

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

An attempt to create an SQL statement in the SQL dialog box or in Access

Basic fails and Microsoft Access displays the following message:

   Too many expressions in DISTINCT output.

CAUSE

The query contains a DISTINCT clause that lists more than ten expressions.

The online Help file documents the ten-field limit as the cause of the

error. However, Help provides the only documentation of this limit. The

other reference, Appendix B in the Microsoft Access "Language Reference,"

version 1.0, does not state a ten-field limit for the DISTINCT clause.

RESOLUTION

There are two methods to deal with this error message:

 - Modify the query to remove the reserved word DISTINCT.

 - Reduce the number of fields in the DISTINCT clause to ten or

   fewer.

One possible method to work around this error involves concatenating some

of the fields into an expression when your query checks for DISTINCT rows.

Each concatenation equals one DISTINCT expression. For example, substitute

the code in example 1 below for the code in example 2 below.

Example 1

---------

   SELECT DISTINCT

      table1.lname & table1.fname,

      table1.address,...;

Example 2

---------

   SELECT DISTINCT

      table1.lname,

      table1.fname,

      table1.address,...;

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10 docbug errmsg


INF: Using Data from Access in a Word for Windows Print Merge

 Article Number: Q93427

 CREATED: 10-DEC-1992

 MODIFIED: 28-DEC-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

- Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Microsoft Word for Windows does not supply a converter for Microsoft

Access database files. To use data from a Microsoft Access database

in Microsoft Word for Windows, the data must be converted to a format

that Microsoft Word for Windows recognizes. This can be done by

exporting the data from Microsoft Access as text, or copying tables

and queries from Microsoft Access and pasting them into a Microsoft

Word for Windows document.

This article describes the steps to create a data file in Microsoft

Word for Windows using each of the methods described above.

MORE INFORMATION

A data file is a comma- or tab-separated file that contains information

that can be used in Microsoft Word for Windows for a print or mail

merge.

A field name in Microsoft Word for Windows cannot contain more than 20

characters. A field name must begin with a letter and can contain only

letters, numbers, and the underline character (_). For example:

   FirstName,LastName,Address,City,State,Postal_Code

   Randy,Johnson,123 West St.,Baker,OR,97445

   Jennifer,Smith,5 Circle Court,Yorkshire,WI,34507

NOTE: Do not include spaces after the commas. Spaces will be inserted as

part of the mail merge.

Method One: Copying and Pasting

--------------------------------

1. From the Database window, select the table or query

   that contains the information you want.

2. Choose Copy from the Edit menu.

3. Activate Microsoft Word for Windows and open a new document.

4. From the Edit menu, select Paste.

   Note: If there are spaces in your field name you will need to delete

   them once you have pasted the data into Microsoft Word for Windows.

5. Save this document as MyData.Doc.

Because this method does not place each field inside quotation marks,

you may encounter errors if any of the fields contain tabs.

Method Two: Using The Transfer Text Macro Action

------------------------------------------------

1. Open a new macro.

2. Add the macro action TransferText with the following

   arguments:

      Transfer Type: Export Delimited

      Specification Name: <leave blank>

      Table Name: <name of the table or query you wish

                   to export.>

      File Name: <valid DOS file name.>

         (Example: c:\winword\mydata.txt)

      Has Field Name: Yes

   This is a one time export. If the data in your database changes

   you will need to re-export it, overwriting the original file.

3. Perform the following steps in Microsoft Word for Windows:

     a. Open the main document.

     b. Choose Print Merge from the File menu.

     c. Choose the Attach Data File button.

     d. Select the exported text file that you created in step 2.

   NOTE: If you did not specify a full path name for the text file, it

   will be in the same directory as your Microsoft Access database.

Now you can use the merge features of Microsoft Word for Windows:

Insert Merge Fields, Edit Data Field, Check, and Print Merge. The

check button will make a pass through the data document and check for

errors, such as those caused by commas or tabs stored in the Microsoft

Access fields.

References:

"Microsoft Word for Windows User's Guide," version 2.0, pages 620-622

Additional reference words: 1.00 1.10 W4W printmerge Winword delimited


PRB: Cannot Write README.TXT Error Msg During Installation

 Article Number: Q93590

 CREATED: 16-DEC-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SYMPTOMS

While installing Microsoft Access, you see the following error message

when SETUP.EXE is processing Disk 6 or Disk 7:

   Cannot Write C:\MSACCESS\README.TXT

CAUSE

This is a setup problem that occurs setup when Microsoft Access is

writing the README.TXT file. There are a number of possible causes.

The MS-DOS APPEND command, located in the AUTOEXEC.BAT file, causes this

error if there is a README.TXT file in any of the directories that are

specified on the APPEND line.

When SETUP.EXE tries to install README.TXT, the APPEND command can cause

MS-DOS to tell SETUP.EXE that there is a file with the same name in the

installation directory. When SETUP.EXE is notified by MS-DOS that there

is an existing file with the same name, SETUP tries to overwrite the

existing file. MS-DOS returns an error code stating that the file is

write protected.

Some customers have reported possible problems installing the README.TXT

file when using certain terminate and stay resident programs (TSRs) such

as Quicken's BillMind and Logitech's Click and Logimenu.

RESOLUTION

There are several possible workarounds. They are detailed in the More

Information section below.

STATUS

This problem does not occur in Microsoft Access version 1.1

MORE INFORMATION

Before trying any of the following workarounds, ensure that you have a

standard Windows configuration. Then exit from Windows and from all

applications. Modify your AUTOEXEC.BAT file to remove any non-standard

TSRs, and then restart your computer.

Workaround One

--------------

1. Use File Manager to search the entire hard drive for all README.TXT

   files.

2. Rename all README.TXT files to another file name (for example,

   READTHIS.TXT).

3. Install Microsoft Access from the original disks.

Workaround Two

--------------

1. Change to the directory of the path given in the error message.

2. Use a text editor such as the MS-DOS Edit program to create an

   empty README.TXT file.

3. Install Microsoft Access from the original disks.

Workaround Three

----------------

1. Make a duplicate copy of Disk 6 or Disk 7.

2. On the new disk, copy the README.TX$ file to a new file

   named README.2

3. On the new disk, rename the README.TX$ file to README.1.

   Then rename README.2 to README.TX$.

4. Install Microsoft Access using the new disk you made.

Workaround Four

---------------

1. Make a duplicate copy of Disk 6 or Disk 7.

2. On the new disk, rename the README.TX$ file to README.1.

3. On the new disk, use a text editor such as the MS-DOS Edit

   to create a new file and save it as README.TX$.

4. Install Microsoft Access using the new disk you made.


INF: Microsoft Access Performance Enhancement Recommendations

 Article Number: Q93684

 CREATED: 17-DEC-1992

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

You can improve the performance of Microsoft Access by

altering the memory

configuration on your computer. This article lists several

tips that you

can use to enhance the performance of Microsoft Access on a

computer with 4

MB of memory.

MORE INFORMATION

The following tips can be used to enhance the performance of

Microsoft

Access versions 1.0 and 1.1 on computers with 4MB of RAM:

 - Do not use any of your RAM for a RAM disk.

 - Use a maximum of 512K for SMARTDrive or other disk

caches.

 - Set your network installation to use less than 200K of

RAM, if possible.

 - Do not run several other applications that require large

amounts of

   memory. Running even one other large application (such as

a spreadsheet,

   word processor, or alternate desktop manager such as

Norton Desktop for

   Windows) can significantly degrade the performance of

Microsoft Access.

 - Run Windows in standard mode.

 - Set the maxbuffersize entry under the [isam] section in

the MSACCESS.INI

   file to a value less than 512. In low memory cases this

will help, even

   though less memory will be used by Microsoft Access for

buffering

   database I/O. (See the Microsoft Access README.TXT file

for details on

   setting this value.)

 - Open databases as exclusive and read-only, if possible.

 - If you do not want to use Access Wizards, you can disable

them by

   removing the line "WIZARD.MDA=RO" from the [Libraries]

section of the

   MSACCESS.INI file. This frees up over 300K of RAM, but

takes away the

   ability to use Access Wizards.

 - Keep the number of Windows accessory applications running

to a minimum.

 - If you have a full-screen background bitmap (or

"wallpaper") on your

   Windows desktop, replace it with a smaller bitmap, or no

bitmap at all.

   For a standard VGA video display, this frees about 256K.

For a 1024x768

   256 color display, this can free about 3/4 of a megabyte.

(Your actual

   memory savings may vary, depending on the display.)

 - Keep in mind that CD-ROM device drivers, sound board

drivers, screen

   savers, MIDI drivers, multi-media support drivers, and

other drivers

   take extra memory. The 4 MB recommendation does not take

this into

   account. If you need to have several drivers running

under Windows, then

   more memory than 4 MB will be required for Microsoft

Access to run

   efficiently.

The 4 MB RAM recommendation was based on a 386/20 computer,

MS-DOS 5.0,

unmodified Windows 3.1, VGA display, mouse, and network

workstation

software. If your configuration is similar to, or better

than this, you

will get good performance. (This has been verified by

benchmarks with

Microsoft Access fully installed.) However, if your system's

configuration

is more sophisticated, you will require more memory for peak

Microsoft

Access performance.

Additional reference words: 1.00 1.10 optimize speed 4meg


PRB: 'Couldn't find object <tablename>' Error with Btrieve

 Article Number: Q93685

 CREATED: 17-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When attempting to import or attach Btrieve files, you receive the

following error message:

   Couldn't find object <tablename>

CAUSE

Microsoft Access requires all three Xtrieve data dictionary files

(FILE.DDF, INDEX.DDF, and FIELDS.DDF) in order to import or attach

Btrieve files. The path statements in FILE.DDF may not be correct for

the current environment.

RESOLUTION

Inspect the path statements in FILE.DDF. Either move the Btrieve

data files to the locations specified in FILE.DDF, or Use Btrieve or a

third-party tool to modify the FILE.DDF file so that the path statements

to the data files are correct.

MORE INFORMATION

Microsoft Access requires all three Xtrieve data dictionary files

(FILE.DDF, INDEX.DDF, and FIELDS.DDF) to be able to import or attach

Btrieve files.

FILE.DDF contains the MS-DOS file name of each data table in the

dictionary. These file names can be in any of the following valid MS-DOS

formats:

 - File Only (For example, MYDATA.DAT)

 - Relative Path (For example, ..\DEV\TEST\MYDATA.DAT)

 - Fully Qualified (For example, C:\TOOLS\DEV\TEST\MYDATA.DAT)

 - Universal Naming Convention (UNC) (For example,

   (\\MYSERVER\USERS\JOE\TOOLS\DEV\TEST\MYDATA.DAT)

When importing or attaching a Btrieve file, Microsoft Access retrieves the

MS-DOS file name from FILE.DDF and attempts to open the file. If the file

does not exist in the location specified, you will see this error:

   Couldn't find object

In the case of the File Only and Relative Path formats, the ability to open

the file depends on the accuracy of the current directory. For example, in

the File Only format, MYDATA.DAT must exist in the current directory. In

the Relative Path format, MYDATA.DAT must exist in the ..\DEV\TEST

directory, which in turn must exist relative to the current directory.

Exactly which directory is the current directory is complicated by the fact

that Windows-based applications all share the same environment and the same

current directory. For example, if you change the current directory in

Microsoft Excel by choosing Open from the File menu and changing

directories to open a file, you also change the current directory for

Microsoft Access.

Therefore, to fix the problem, you need to find out what path statements

are included in FILE.DDF. You can do this by opening FILE.DDF in Microsoft

Write, the word processor provided with Windows. When Microsoft Write asks

if you want to convert this file to Microsoft Write format, specify No

Conversion.

WARNING: Do not save the file after you finish viewing it with Microsoft

Write. If you do, you will corrupt FILE.DDF beyond repair.

After opening FILE.DDF in Microsoft Write, you will see several characters

that look like a box. Scroll to the end of the file. There you will see the

MS-DOS file names of the Btrieve data files. The extension is usually .DAT,

but it does not have to be. Once you have noted the names and paths, close

FILE.DDF taking care NOT to save the changes.

Now that you have the file names, here are two things you can do

to fix the problem:

1. Move the files into the correct location(s). This is the easiest method

   and the one Microsoft recommends.

2. Use Btrieve or a third-party tool to modify the FILE.DDF file so that

   the paths are correct. This method is much more complicated. Microsoft

   recommends you do not attempt them unless you are a Btrieve expert.

Additional reference words: 1.00 1.10 2.00 novell ddf 3rdparty errmsg


INF: Btrieve 6.0 Data Type Does Not Work with Microsoft Access

 Article Number: Q93687

 CREATED: 17-DEC-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access was not tested with Btrieve version 6.0. Therefore,

new data types introduced with this version of Btrieve may not be

compatible with Microsoft Access.

MORE INFORMATION

Btrieve 6.0 introduced the new data type Negative Sign Trailing Numeric

Field. Microsoft Access does not explicitly translate this data type.

REFERENCES

==========

Microsoft Access "User's Guide," versions 1.0 and 1.1, Chapter 4,

"Importing, Exporting, and Attaching," page 66

Microsoft Access "User's Guide," version 2.0, Chapter 9, "Importing,

Exporting, and Attaching"

Additional reference words: 1.00 1.10 2.00


INF: Export Btrieve Table Without Existing Xtrieve FILE.DDF

 Article Number: Q93688

 CREATED: 17-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

To export a Btrieve table by using the Microsoft Access user interface, you

must ensure that an Xtrieve dictionary file (FILE.DDF) exists. If the

FILE.DDF file does not exist, use the macro action Transfer Database to

export the table.

MORE INFORMATION

Multiple Btrieve tables can exist in Xtrieve databases, just as Microsoft

Access databases can have multiple tables. The FILE.DDF file describes the

structure of the Xtrieve database.

Example

-------

The following sample macro (TransBtrieve) transfers the Customers table

from the sample database NWIND.MDB to a Btrieve Table named Customers in an

Xtrieve database named C:\ACCESS\BTV00000.DAT. If C:\ACCESS is a valid

directory, the export occurs even if BTV00000.DAT does not exist.

Use the following as a guide to create the sample macro. Note that the

database name can be any complete file specification.

   Macro Name      Action

   --------------------------------

   TransBtrieve    TransferDatabase

   TransferDatabase Action

   -----------------------------------------

       Transfer Type: Export

       Database Type: Btrieve

       Database Name: C:\ACCESS\BTV00000.DAT

         Object Type: Table

              Source: Customers

         Destination: Customers

      Structure Only: No

Microsoft Access creates the following four files if they do not exist:

   FILE.DDF

   INDEX.DDF

   FIELD.DDF

   BTV00000.DAT

Transferring more than one table adds data to the existing files, but does

not create more files as long as the database name is not changed.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 4, "Importing,

Exporting, and Attaching," page 86

Additional reference words: 1.00 1.10 2.00 checkpage


INF: How to Update a Table Based on Values in a Second Table

 Article Number: Q93690

 CREATED: 17-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

To transfer data between two tables, create an additional field in

one of the tables to store the common data, then create an update

query to accomplish the transfer.

MORE INFORMATION

This process can be illustrated using the sample database NWIND.MDB.

The following example adds a Product Name field to the Order Details

table, then copies the Product Name field from the Products table

based on the Product ID field.

NOTE: Normally you would not duplicate the Product Name field, since

duplicate data is not good database design.

1. Open the Order Details table in Design view.

2. Add a Product Name field with the default Text data type.

3. Save and then close the table.

4. Create a new query based on the Order Details and Products tables.

   NOTE: These tables are automatically joined on the Product ID

   field because a relationship has already been defined. If your

   tables are not joined, join them on the original linked field.

5. From the Query menu, choose Update.

6. From the View menu, choose Table Names. Drag the Product Name field

   from the Order Details table to the first cell in the Field row of

   the query grid.

7. In the Update To row, type:

      [Products]![Product Name]

8. From the Query menu, choose Run. Close the query.

REFERENCES

==========

For more information about using an update query with two tables, query on

the following words here in the Microsoft Knowledge Base:

   update and counter and query

Microsoft Access "User's Guide," version 1.0, Chapter 7

Additional reference words: 1.00 1.10 2.00 link join transfer cascade


INF: Additions to User's Guide Appendix A Specifications

 Article Number: Q93691

 CREATED: 17-DEC-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article includes additions to the Microsoft Access "User's Guide,"

Appendix A, "Microsoft Access Specifications." Note that some but not all

of this information may already be in the Microsoft Access "User's Guide."

MORE INFORMATION

Tables

------

Attribute                                          Maximum

----------------------------------------------------------

Number of primary key fields and matching fields

  when defining a relationship between tables      5

Queries

-------

Attribute                                          Maximum

----------------------------------------------------------

Number of characters in a cell                     255

Number of GROUP BY fields in a totals query        10

Number of fields allowed when query property

  UniqueValuesOnly is selected (SELECT DISTINCT)   10

Number of ANDs in a WHERE clause (criteria)        40

Number of ANDs in a HAVING clause                  40

Additional reference words: 1.00 1.10 queries tables limits limitations


PRA: Unique Values Only Select Query Shows Duplicates

 Article Number: Q93692

 CREATED: 17-DEC-1992

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

The result of a query includes duplicate values even though

you

selected the Unique Values Only check box (SELECT DISTINCT)

in the

Query Properties dialog box.

CAUSE

Duplicate values occur when both of the following conditions

are met:

1. The query input data set contains more than approximately

64K of data

   and the duplicate values are widely scattered in the

input data.

   For example, a SELECT DISTINCT query on a text column

with an average

   length of 20 characters will not display duplicate values

unless the

   query input data set included more than 3,300 values

(65536 / 20 =

   3276.8. Note that if the query is based on a table that

has 10,000

   rows, but the specified criteria retrieves only 20 rows,

it is the

   set of 20 rows that determines the size of the query

input data set.

   In other words, it is the WHERE clause that determines

the size of

   the query input data set.

2. The values that have duplicates appear close (maybe in

the first

   dozen values) to what would normally be the beginning of

the query

   output. By default, a SELECT DISTINCT query displays data

sorted

   implicitly. For example, the following displays the

result sorted by

   Order ID:

      SELECT DISTINCT [Order Details].[Order ID]

      FROM [Order Details];

   However, in a SELECT DISTINCT query that uses more than

one column

   and sorts by a column other than the first one, the

duplicates could

   appear anywhere in the output. To see if there are

duplicates, you

   need to remove the sort.

NOTE: This problem also appears in a Crosstab query as

duplicated

columns with names like Field1. Use Fixed Column heading to

prevent

the problem.

RESOLUTION

In addition to SELECT DISTINCT queries, you can use GROUP

BYs in a

totals query to eliminate duplicates in the output. Both

SELECT

DISTINCT queries and GROUP BYs in a totals query are limited

to

10 columns. Usually, GROUP BY is faster when the resulting

data set

is much smaller than the input data set, and SELECT DISTINCT

is

faster when there are only a few duplicates.

To ensure the correct results, use GROUP BYs in a totals

query instead

of using the Unique Values Only query property. For example,

the

following two select queries give identical results:

   SELECT DISTINCT [Order Details].[Order ID]

   FROM [Order Details];

   SELECT DISTINCTROW [Order Details].[Order ID]

   FROM [Order Details]

   GROUP BY [Order Details].[Order ID];

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access version

1.0. This problem was corrected in Microsoft Access version

1.1.

REFERENCES


PRB: "Outdated COMMDLG.DLL" Error Message During Setup Program

 Article Number: Q93694

 CREATED: 17-DEC-1992

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SYMPTOMS

When you try to open a database, you receive the following

error

message:

   Outdated "COMMDLG.DLL." Please reinstall Microsoft

Access.

CAUSE

There are three possible causes of this problem:

1. More than one version of COMMDLG.DLL on your computer.

2. An outdated copy of the COMMDLG.DLL file.

3. An incompatible copy of COMMDLG.DLL.

RESOLUTION

The three solutions below correspond with the three causes

listed

above:

1. Rename the duplicate versions of COMMDLG.DLL.

2. Make sure the COMMDLG.DLL file in the WINDOWS system

subdirectory is

   newer than the following:

      3/10/92   (for Microsoft Windows version 3.1)

      10/01/92  (for Windows for Workgroups)

      10/25/92  (for Microsoft Access)

3. If you have a third-party COMMDLG.DLL file, make sure

that it is

   compatible with Microsoft Access.

The three sections under "More Information" describe these

procedures.

MORE INFORMATION

Searching for Copies of COMMDLG.DLL File

----------------------------------------

To search for all occurrences of the COMMDLG.DLL file,

follow these

steps:

1.  Exit Windows.

2.  Search for any other copies of COMMDLG.DLL on the

current drive by

    typing the following commands at the MS-DOS prompt:

      cd\

      dir commdlg.dll /s

Repeat these commands on all other drives and rename or

delete any

copies of the COMMDLG.DLL file that you find. When you

finish, you

should have a single copy of COMMDLG.DLL on your computer,

located in

the WINDOWS system subdirectory.

Installing a New COMMDLG.DLL File

---------------------------------

If you delete or rename all duplicates of the COMMDLG.DLL

file and

continue to get the above error message in Microsoft Access,

copy

COMMDLG.DL_ from Disk 1 of Microsoft Access and EXPAND.EXE

from Disk 3

of Windows version 3.1. Then use EXPAND.EXE to expand the

COMMDLG.DL_

file as follows:

   c:\<path>\EXPAND <path>\COMMDLG.DL_

c:\windows\system\COMMDLG.DLL

NOTE: Do not copy COMMDLG.DL$ from the Microsoft Access

disks.

Microsoft Access Setup is required to decompress

COMMDLG.DL$.

Ensuring No Other Applications Are Open

---------------------------------------

When Microsoft Access Setup tries to update the COMMDLG.DLL

file, you

may receive an error message stating that Microsoft Access

was unable

to access the file. In most cases, another application is

using

the COMMDLG.DLL file.

To ensure that no other applications are open when you run

Microsoft

Access Setup, use the following steps:

1. Add a new program group in Windows Program Manager called

   Temporary.

2. Move all the icons from the Startup program group to the

Temporary

   program group.

3. Edit the [Windows] section of the WIN.INI file as

follows:

      [Windows]

      RUN=

      LOAD=

4. Restart Windows and run Microsoft Access Setup.

If you continue to encounter problems, edit the AUTOEXEC.BAT

file to

look for conflicting terminate-and-stay-resident (TSR)

programs.

Additional reference words: 1.00 1.10 errmsg tsr


INF: Passing Values from a Form to a Parameter Query

 Article Number: Q93695

 CREATED: 17-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you run a parameter query, Microsoft Access prompts you to enter

each parameter in a separate dialog box. This article explains how to

create a form that will collect all the values for a parameter query.

MORE INFORMATION

The following step-by-step example uses the Orders table from the sample

database NWIND.MDB. The example shows you two things: how to create a form

that prompts for a date value, and how to add a command button to the form

to execute the query.

1. Open the NWIND database.

2. Create a query based on the Orders table. Add the following field

   names with the specified criteria and save the query as MyQuery:

      Field             Criteria

      ---------------------------------------------

      Customer ID

      Order ID

      Order Date        > [Forms]![MyForm]![MyDate]

3. Create a new macro with the following action argument, and save it

   as MyMacro.

      Action       Action Argument    Value

      ---------------------------------------

      OpenQuery    Query Name         MyQuery

4. Create an unbound, blank form by leaving the Select A Table/Query box

   empty and choosing the Blank Form button.

5. Place a text box control on the form and set the following

   properties:

      Text Box

      ------------------

      Name: MyDate

      Format: Short Date

   NOTE: In Microsoft Access versions 1.0 and 1.1, the Name property is

   called ControlName.

6. Select the Database window by pressing F11.

7. Choose the Macro button with the mouse, and drag MyMacro onto the

   form. This will generate a command button with the OnPush property set

   to MyMacro.

8. Click in the Form window to select it, and then save the form as

   MyForm.

9. Switch to Form view, enter a date such as 1/1/91, and then click the

   MyMacro button. This will execute the MyMacro macro and run the MyQuery

   query using the date you entered in the MyDate text box as the query

   parameter.

Additional reference words: 1.00 1.10 2.00 Parameters


INF: How to Dial a Phone Number in Microsoft Access

 Article Number: Q93696

 CREATED: 17-DEC-1992

 MODIFIED: 04-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes a sample user-defined Access Basic function,

DialNumber(), that you can use to dial a telephone number from Microsoft

Access using your computer's modem. This method uses Microsoft Windows

application programming interface (API) function calls.

Although this function will work with Microsoft Access version 2.0, version

2.0 has a new AutoDialer feature that can be used for dialing telephone

numbers. For more information about the AutoDialer feature, search for

"AutoDialer" using the Microsoft Access 2.0 Help menu.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

MORE INFORMATION

To dial a phone number in Microsoft Access, you can use Microsoft Windows

API calls in the dynamic-link library (DLL) USER.EXE. There are 17

communication API calls available in USER.EXE, but only the following 3 are

used to dial a phone number: OpenComm(), CloseComm(), and WriteComm().

The following steps demonstrate how to create and use the DialNumber()

function.

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

1. Open the sample database NWIND.MDB.

2. Create a new Access Basic module with the following in the Declarations

   section:

      Option Explicit

      ' The number of seconds to wait for the modem to dial before

      ' .. resetting the modem. If the phone hangs up prematurely

      ' .. try increasing this value by small increments.

      Const WAITSECONDS = 4

      Declare Function OpenComm Lib "User" (ByVal lpComName$, _

         ByVal wInQueue%, ByVal wOutQueue%) As Integer

      Declare Function CloseComm Lib "User" (ByVal nCid%) As Integer

      Declare Function WriteComm Lib "User" (ByVal nCid%, _

         ByVal lpBuf$, ByVal nSize%) As Integer

      Const ID_CANCEL = 2

      Const MB_OKCANCEL = 1

      Const MB_ICONSTOP = 16, MB_ICONINFORMATION = 64

3. Add the following function to the module:

      ' ***********************************************************

      ' FUNCTION: DialNumber()

      '

      ' PURPOSE: To dial a telephone number using the computer's modem

      '

      ' ARGUMENTS:

      '    PhoneNumber: The telephone number to dial

      '

      '    CommPort: The communications port the modem is connected

      '              to. Typically, modems are found on COM2, however,

      '              they can be configured for any COM port.

      '

      ' EXAMPLE:

      '    Type the following in the Immediate window using a modem

      '    connected to the COM2 port:

      '

      '       ? DialNumber("555-1212", "COM2")

      '

      ' ***********************************************************

      Function DialNumber (PhoneNumber, CommPort As String)

         Dim Msg As String, MsgBoxType As Integer, MsgBoxTitle As String

         Dim ModemCommand As String

         Dim OpenPort As Integer

         Dim RetVal As Integer

         Dim StartTime

         Dim CR As String: CR = Chr$(13)

         Dim LF As String: LF = Chr$(10)

         ' Ask the user to pick up the phone

         Msg = "Please pickup the phone and choose OK to dial " _

            & PhoneNumber

         MsgBoxType = MB_ICONINFORMATION + MB_OKCANCEL

         MsgBoxTitle = "Dial Number"

         If MsgBox(Msg, MsgBoxType, MsgBoxTitle) = ID_CANCEL Then

            Exit Function

         End If

         ' Open the communications port

         OpenPort = OpenComm(CommPort, 1024, 128)

         If OpenPort < 0 Then

            Msg = "Unable to open communication port " & CommPort

            GoTo Err_DialNumber

         End If

         ' Send the telephone number to the modem

         ModemCommand = "ATDT" & PhoneNumber & CR & LF

         If WriteComm(OpenPort, ModemCommand, Len(ModemCommand)) < 0 Then

            Msg = "Unable to dial number " & PhoneNumber

            GoTo Err_DialNumber

         End If

         ' Wait WAITSECONDS seconds for the phone to dial

         StartTime = Timer

         While Timer < StartTime + WAITSECONDS

            DoEvents

         Wend

         ' Reset the modem and take it off line

         ModemCommand = "ATH0" & CR & LF

         RetVal = WriteComm(OpenPort, ModemCommand, Len(ModemCommand))

         ' Close the communications port

         RetVal = CloseComm(OpenPort)

         Exit Function

      Err_DialNumber:      'This is not an On Error routine

         Msg = Msg & CR & CR & "Make sure no other devices are using _

            communication port " & CommPort

         MsgBoxType = MB_ICONSTOP

         MsgBoxTitle = "Dial Number Error"

         MsgBox Msg, MsgBoxType, MsgBoxTitle

      End Function

4. Open the Employees form in Design view.

5. Place a command button with the following properties on the form, next

   to the Home Phone field.

      Microsoft Access 1.x:

         ControlName: btnDialPhone

         Caption: Dial

         OnPush: =DialNumber([Home Phone], "COM2")

      Microsoft Access 2.0:

         Name: btnDialPhone

         Caption: Dial

         OnClick: =DialNumber([Home Phone], "COM2")

6. View the form in Form view. To dial an employee's home phone number,

   choose the Dial button.

Additional reference words: 1.00 1.10 2.00


INF: How To Get Microsoft Works Files into Microsoft Access

 Article Number: Q93698

 CREATED: 17-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access does not directly import the Microsoft Works for

Windows or Microsoft Works for MS-DOS database (.WDB) file format.

Microsoft Access does, however, import any version of Microsoft Works

spreadsheet (.WKS) files. This article explains how you can transfer

your database and spreadsheet files from Microsoft Works into

Microsoft Access tables.

MORE INFORMATION

You can import spreadsheet files (.WKS) directly into Microsoft

Access. To import database files you should save them as dBase III or

IV files, or convert them to Works spreadsheet files first.

Microsoft Works for Windows Database files

------------------------------------------

Database files created in Microsoft Works can be imported by Microsoft

Access if they are converted to a dBase III or IV file format. The

conversion retains field names and most data types, with these

exceptions:

 - Currency fields are converted to Number fields.

 - Fields defined as formulas are converted to Number fields with

   values.

Conversion process:

1. Start Microsoft Works and open your Works database file.

2. From the File menu choose Save As.

3. Using the Save File As Type box, change the format to dBase

   III or dBase IV.

4. Change the name of the file so it has a .DBF extension and choose

   OK.

5. Start Microsoft Access and open the .MDB file you want to import

   to.

6. From the File menu choose Import.

7. Select dBase III or dBase IV from the format list.

8. Select the name of your .DBF file from the list. If it does not

   appear in the list you may need to change the drive and directory

   to the correct location.

9. Choose the Import button. The file is imported as a Microsoft

   Access table with the same name as the .DBF file.

Microsoft Works for MS-DOS Database files

-----------------------------------------

Save your Microsoft Works 2.0 database files in the format "Text &

Commas". Microsoft Access imports this file type as Text (delimited)

files.

Save your Microsoft Works 3.0 database files in dBase III or dBase IV

format following the method outlined above.

Microsoft Works spreadsheet files (either version)

--------------------------------------------------

Spreadsheet files, created in either the MS-DOS or Windows version of

Works, can be imported by Microsoft Access with little effort. If the

first row of the spreadsheet contains a name for each column this can

be recognized as the name of each field in the new Microsoft Access

table. If there is only data in the spreadsheet Microsoft Access

creates default field names for the table. Most data types are

retained, with these exceptions:

 - Fields formatted as TRUE or FALSE are converted to Number fields.

   A FALSE value is converted to 0 and a TRUE value is converted

   to 1.

 - Formula fields are converted to Number fields with values.

Conversion process:

1. Start Microsoft Access and open the .MDB file you want to import

   the Microsoft Works spreadsheet file to.

2. From the File menu, choose Import.

3. Select Lotus (WKS) from the format list.

4. Select the name of the .WKS file from the list. If it does not

   appear, you may need to change the drive and directory to the

   correct location.

5. If the first row of the spreadsheet contains the column names,

   select the option "First Row Contains Field Names".

6. Select the Import button. The file will be imported as a Microsoft

   Access table with the same name as the .WKS file.

Depending upon the type of data in your Microsoft Works files, you may

choose either method to convert files to Microsoft Access tables.

REFERENCES

==========

For more information about sharing Microsoft Works data with other

progams, see the Microsoft Works "User's Guide."

Microsoft Access "User's Guide," version 1.0, pages 64-65 and 72-75

Additional reference words: 1.00 1.10 2.00 spreadsheet dbase


INF: MS Access Cannot Attach or Import Paradox 4.0 Tables

 Article Number: Q93699

 CREATED: 17-DEC-1992

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Microsoft Access supports attaching and importing from Paradox 3.x tables.

Microsoft Access does not support attaching Paradox 4.0 tables. If you

attempt to attach a version 4.0 table, you will be prompted for a password.

This also applies to Paradox 1.0 for Windows files.

MORE INFORMATION

If you are prompted to enter a password when you attach to a Paradox

table, and you know that there is no password for the table, it is

possible the table is a Paradox 4.0 file.

NOTE: These directions apply to Paradox 4.0 only; these directions do

not apply to Paradox for Windows.

To use data created in Paradox 4.0, use Paradox to restructure the table in

version 3.5 format. Paradox provides the capability to create files in

Compatible format; this will create files in version 3.5 format.

In Paradox, you can save a Paradox 4.0 table in version 3.5 format by

following these steps:

1. Copy the Paradox 4.0 table.

2. In Paradox, run the Modify/Restructure menu command.

3. Enter the name of the table.

4. Choose FileFormat/Compatible from the menu.

5. Press F2 to save the file in the restructured format.

For more information on restructuring Paradox tables, see the Paradox 4.0

documentation.

Paradox is manufactured by Borland International, a vendor independent of

Microsoft. Microsoft makes no warranty, implied or otherwise, regarding

this product's performance or reliability.

Additional reference words: 1.00 1.10


PRB: Microsoft Access Appears to Hang During Database Compact

 Article Number: Q93717

 CREATED: 20-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When Microsoft Access performs a database compact operation, the

status bar indicates the percentage of the task that is complete.

At times, the status bar may remain on one value for a very long

time and it may appear that Microsoft Access has hung. However, in

most cases when this occurs, Microsoft Access continues to work on

the compact operation.

CAUSE

When Microsoft Access performs a database compact operation, it

copies each object in the database into a new database. Because

different objects have different sizes, some objects require more

time to copy into the new database. The value displayed in the

status bar indicates the percentage of the number of objects

copied, not the percentage of the total size of all objects copied.

RESOLUTION

This behavior is by design.

MORE INFORMATION

For example, if your database contains a very large table, the

displayed percentage could go up to 90% rather quickly and then remain

static while Microsoft Access copies the table. While Microsoft Access

copies the table, it may appear to be hung. The 90% value indicates

that 90% of the objects have been copied; it does not indicate that

90% of the processing is complete.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, page 627

Additional reference words: 1.00 1.10 2.00 lockup lock up compact


PRB: Unable to Change Permissions (Security)

 Article Number: Q93718

 CREATED: 20-DEC-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you try to open an object or change permissions for an account,

you receive one of the following error messages:

   You can't view this object's permissions.

   -or-

   No permission for <object name>.

CAUSE

Only the database creator, or a member of the Admins group, has full

permissions to all database objects. This person is also the only user

who can assign security permissions.

RESOLUTION

Contact your database administrator. If you are the database

administrator, check to make sure you are logged in as a user who is a

member of the Admins group. If you still have the original user Admin,

make sure it is a member of the Admins group and try again.

STATUS

This behavior is by design.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 25, "Administering a

Database System," pages 609-629

Microsoft Access "User's Guide," version 2.0, Chapter 14

For more information search for "Error Messages: Reference" using the

Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


PRB: Changes to Shared Module Are Kept Local Until .MDB Closed

 Article Number: Q93719

 CREATED: 20-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Two or more workstations open a shared Database (.MDB) that has at

least one module. Changes are made to the module by workstation A.

The module is then saved by workstation A. Workstation B opens the

same module and does not see the changes made on workstation A.

STATUS

This behavior is by design.

MORE INFORMATION

The only way to update modules is to close and reopen the database.

Microsoft Access loads all modules once when the database is opened.

Changes made by one workstation will not affect any other

workstation(s) until the database is closed and then reopened.

Additional reference words: 1.00 1.10 2.00


PRB: DDE Statements Invalid in List Box or Combo Box Control

 Article Number: Q93720

 CREATED: 20-DEC-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you use a dynamic data exchange (DDE) function as the ControlSource of a

list box or combo box, you will receive a "#Error" message in the list box

when viewed in Form view. However, if you view the form in Datasheet view,

the first object in the DDE data will show up.

Using a DDE function in the RowSource property causes an error message in

both Form and Datasheet views of the form.

RESOLUTION

Using Access Basic, you can create a list function that returns to a

list box or combo box. You can use any Access Basic routine to obtain

the information used in the list, including DDE commands.

STATUS

This behavior is by design.

MORE INFORMATION

The ControlSource property of a list box or combo box may be blank if

the control is unbound, or may contain the name of the field that the

control is bound to; it may not contain a function.

The RowSource property of a list box or combo box may contain a list

of values, the name of a table or query, or an SQL string. This property

provides the list of values the user may select from.

Steps to Reproduce Behavior

---------------------------

1. Open a Microsoft Excel spreadsheet and enter a text string in Row 1,

   Column 1. Save the spreadsheet as TEST.XLS.

2. Create a new form in Microsoft Access and place a list box with the

   following property on the form:

      Object: List Box

      ----------------------------------------------

      ControlSource: =DDE("Excel","Test.xls","R1C1")

3. Make sure TEST.XLS in Microsoft Excel is open.

4. View the form you created in step 2 in Form view. In Microsoft Access

   version 1.x, the list box contains "#Error." In Microsoft Access

   version 2.0, the list box is empty.

5. View the form in Datasheet view. Note that the data from Microsoft

   Excel appears in the list.

REFERENCES

==========

Microsoft Access "Introduction to Programming," version 1.1, Chapter 7,

"Coding with Forms and Reports"

Microsoft Access "Building Applications," version 2.0, Chapter 3,

"Introducing Access Basic"

Additional reference words: 1.00 1.10 2.00 pounderror listbox combobox


PRB: Column in QBE Grid Keeps Focus After Clicking Field List

 Article Number: Q93721

 CREATED: 20-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

After you select a column in the QBE grid, the column does not lose

focus when you select a field list.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new query bound to any table.

2. Drag a few fields from the field list to the query grid.

3. Select a column in the query grid by clicking the column selector

   above the field box.

4. Click the field list for the table. Note that the column on the query

   grid does not lose the focus.

5. Press the DEL key. Note the the table field list and all the columns

   on the query grid are removed.

Additional reference words: 1.00 1.10


PRB: Microsoft Access Cannot Paste Entire Column in Query Grid

 Article Number: Q93722

 CREATED: 20-DEC-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you use the Query be Example (QBE) grid, an attempt to cut and paste

(or to copy and paste) an entire column places incorrect results into the

target column.

RESOLUTION

Before you paste information from the Clipboard, select an object

that has the same size as the information in the clipboard. In this

example, select an entire column when you paste the information

into the query grid.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a query.

2. Select an entire column in the query grid (click the mouse once at

   the top of a column when the mouse cursor changes to a down arrow).

3. From the Edit menu, choose either Cut or Copy.

4. Select a cell (to paste the copied column into) and choose Paste

   from the Edit menu.

The pasted values are not correct. The initial value displayed will

probably be a 1, which indicates that the Show box was selected in the

column you copied. You can scroll through values in the cell by using the

up and down arrow keys. If you attempt to move off the cell by clicking

elsewhere on the grid, you will receive a syntax error message.

REFERENCES

==========

For more information on pasting information in the query grid, query on the

following words here in the Microsoft Knowledge Base:

   queries and paste

Additional reference words: 1.00 1.10 2.00


PRB: Hourglass May Not Change After Illegal Function Call

 Article Number: Q93723

 CREATED: 20-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A user can change the mouse pointer from an arrow to an hourglass

cursor with a user-defined function in Access Basic. If the user

encounters an illegal function, or halts the code after setting the

pointer to an hourglass, the hourglass cursor does not change back

to the arrow pointer. However, you can still open and close items

by clicking them.

RESOLUTION

You can type "DoCmd Hourglass False" (without quotation marks) in the

Immediate window to get the pointer back while in design of the module.

STATUS

This behavior is by design. Access Basic will never reset Echo,

Warnings, or Hourglass when run from Access Basic. These are only

reset when the last script runs.

MORE INFORMATION

Because an illegal function call stopped the execution of the

function before the command to reset the mouse pointer from an

hourglass to an arrow, the mouse pointer remains in the hourglass

state.

Additional reference words: 1.00 1.10 2.00 mousepointer checkpage


PRB: "Generic/Text Only" Driver Print Quality List Error

 Article Number: Q93724

 CREATED: 20-DEC-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you select Generic/Text Only as your printer, the Print

Quality list in the Print dialog box contains four options:

High, Medium, Low, and Draft.

CAUSE

This behavior occurs because each printer driver, regardless of its

capabilities, has all four options built in. In some cases, as in

the Generic/Text Only driver, all four options perform the same

function. In other drivers, the Print Quality list shows only valid

options.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10 PtrIss


PRA: Non-TrueType Fonts with 8514.DRV Cause GP Fault

 Article Number: Q93725

 CREATED: 20-DEC-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Using fonts other than TrueType fonts with the Windows 8514.DRV video

driver may cause a general protection (GP) fault or other problems.

RESOLUTION

Use TrueType fonts with the Windows 8514 driver to avoid the GP fault and

to eliminate the horizontal "race lines" in large non-TrueType fonts. You

can also try reducing the size of non-TrueType fonts to 104 points or less

to eliminate horizontal race lines.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1, and 2.0. We are researching this problem, and will post new

information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

NOTE: You must have the windows 8514 video driver installed to reproduce

this problem.

1. Create a new form and size it to be 22 inches wide.

2. Add a text box to the form.

3. Set the font to Arial 8 point bold.

4. Type a line of text that is about 18 inches long in the text box.

5. Size the text box so that everything you typed fits on one line.

6. From the toolbar, select MS Sans-Serif for the font.

You will receive a message stating that Microsoft Access caused a GP fault

in 8514.DRV.

Additional reference words: 1.00 1.10 2.00 WinIss


PRB: Overlapped Printing an Access Query Using TTY.DRV

 Article Number: Q93726

 CREATED: 20-DEC-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you print a query using the Windows Generic Text Only printer

driver (TTY.DRV), the print overlaps on every sixth or seventh line.

RESOLUTION

The TTY.DRV driver can print only six lines per inch. You must set the

row height to 12 point to make the line spacing work correctly with

this printer driver. To change the row height, choose Row Height

from the Layout menu and type "12" (without the quotation marks).

This allows the TTY.DRV to print your query without overlapping text.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open a query.

2. From the File menu, choose Print Setup.

3. Select the Specific Printer option button, and select Generic Text

   Only from the list of printers. (This driver must be installed on your

   machine for this to option to appear.) Choose the OK button.

4. From the Query menu, choose Run.

5. From the File menu, choose Print, then choose the OK button.

Approximately every sixth line of print is overlapped.

Additional reference words: 1.00 1.10 2.00 PtrIss tty.drv generic text


PRB: Cannot Import YYMMDD Dates in Fixed-Width Text Files

 Article Number: Q93727

 CREATED: 20-DEC-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Microsoft Access will not import fixed-width text files if there

is a date field in the text file formatted as YYMMDD.

CAUSE

Microsoft Access does not recognize the YYMMDD date format in text

files, and will generate an error log when trying to import a text

file that includes a date in this format. The error log will show a

"Type Conversion Failure." The file will not import.

RESOLUTION

One workaround is to format the date as MMDDYY.

Another workaround is to import the YYMMDD field as a six-character

text field. Next, create a new field in the table called, for

example, NewDate, with a data type of Date/Time. Then run an

update query to derive the NewDate field from the OldDate field

as follows:

NOTE: In the following sample code, an underscore(_) is used as a

line-continuation character. Remove the underscore when re-creating

this code in Microsoft Access.

   Query: ReformatDate

   -------------------------------------------------------

   Field Name: NewDate

   Update to: Mid([OldDate],3,2) & "/" & Right([OldDate],2) & _

                  "/" & Left([OldDate],2)

If the text field containing the date has embedded slashes, such as

1/5/94, then the starting value in the Mid() function must be 4 rather

than 3. In the example above, you would change the Mid() to look like

Mid([olddate],4,2).

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

When importing a fixed-width text file with a date field formatted as

YYMMDD, Microsoft Access generates an Import Error log table, but

does not import the data. If you try to import the text file as

delimited the data is imported, but Microsoft Access changes the

format from date to number or text, depending upon the date delimiter.

Additional reference words: 1.00 1.10


PRA: HPPCL5A Printer in DEBUG Windows Causes GP Fault

 Article Number: Q93728

 CREATED: 20-DEC-1992

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Printing on a HPPCL5A printer while using the DEBUG version of Windows

3.1 causes a general protection (GP) fault and generates the following

error message:

   err ACCESS->HPPCL5A GLOBALSIZE+C: Invalid global handle: 0x000

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1, and 2.0. Microsoft is researching this problem and will post new

information here as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Use DEBUG Windows.

2. Open a database.

3. Create a new report.

4. Place two labels that overlap on the report.

5. Set the printer to the HPPLC5A printer. Then choose Print from the

   File menu.

Additional reference words: 1.00 1.10 2.00 WinIss errmsg


PRB: Microsoft Access Can't Recognize SQL Server Double Index

 Article Number: Q93925

 CREATED: 21-DEC-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SYMPTOMS

Microsoft Access does not recognize a SQL Server table index if the

index has a DOUBLE data type.

STATUS

This problem does not occur in Microsoft Access version 1.1.

MORE INFORMATION

Microsoft Access requires a unique index on any SQL Server table for

updates (editing), and it cannot use the data type DOUBLE as a unique

index. After reading the DOUBLE index value on the server, Microsoft Access

converts the value from binary to decimal and back to binary, causing

rounding errors, before storing it in a Microsoft Access virtual table

(VT). The same conversion process occurs when Microsoft Access sends the

value back to the server for an update. Microsoft Access uses the index

value to find the row in the table where the update is needed. Because of

the rounding errors, Microsoft Access cannot find the correct row to make

the update, so the update fails. Because updates cannot be made on this

type of index, even though it may be unique, Microsoft Access ignores the

index.


INF: Copying and Pasting Text in a Property Sheet

 Article Number: Q93926

 CREATED: 21-DEC-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

You cannot use the Edit menu's Copy or Paste command to edit text in a

property sheet.

Instead, use the equivalent keystroke combinations for the Copy and

Paste commands. CTRL+C copies information to Clipboard, while

CTRL+V pastes information from Clipboard.


INF: Repeat Group Name at the Top of New Column or Page

 Article Number: Q93927

 CREATED: 21-DEC-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article describes how to create a report that prints "continued" or

"Group Name continued" at the top of each new column or page when grouped

information flows from one column or page to another. At the end of this

article, you will find sources for additional information on multiple-page

and multiple-column report formats.

MORE INFORMATION

Microsoft Access prints a single group header at the beginning of a group

to identify the beginning of the group. It does not repeat the header at

the top of subsequent columns or pages. However, you can use the procedure

described below to force a report to repeat the group name if the detail

records in a group span several columns or pages. This article uses

the report List Of Products By Category from the sample database

NWIND.MDB.

Three-step Process

------------------

The report uses macros to identify the group. It uses the Top property to

determine whether a detail section is being formatted at the top

of a column or page. If it is, the report shows the contents of the text

box that contains the group name and "continued," and it hides the other

controls in the detail section. It is a three-step process.

Step One: Create a New Macro Group Containing Three Macros

----------------------------------------------------------

You need a macro group (Continued) containing three macros (Page Reset, Set

Top1, and Print) to check for certain conditions and perform specific

actions based on those conditions. By setting conditions, you give the

macro the branching characteristics of a program without using a

programming language.

The Page Reset macro sets the value of the Top1 text box to the value of

the Top property if the current value of Top1 is 0 when Microsoft Access

formats the group header.

The Set Top1 macro sets the value of the Top1 text box to 0 when

Microsoft Access formats the page header.

The Print macro sets the value of the Top1 text box to the value of

the Top property if the value of Top1 is 0 when Microsoft Access

formats a detail section. Or, if the Top property is equal to the value

of the Top1 text box, it sets the Visible property of the Continued

text box to Yes and the Visible property for each of the controls in

the detail section to No. In the List Of Products By Category report,

there are four controls to hide in the detail section. It also sets

the NextRecord property to False. Otherwise, it hides the message and

prints the detail record.

To create the macro group:

1. Create a new macro.

2. From the View menu, choose Macro Names or choose the Macro Names button

   on the toolbar.

3. From the View menu, choose Conditions or choose the Conditions button

   on the toolbar.

   Microsoft Access displays the complete grid in the Macro window,

   including the Macro Name, Condition, and Action columns.

4. Enter the macro names, conditions, actions, and action arguments using

   the following two tables as a guide. Use the first table to fill the

   grid and use the second to add action arguments to each action. Do not

   enter the reference letters: [a], [b], [c], and so on. These reference

   letters are there to help you associate the actions shown in the first

   table with the action arguments shown in the second table.

      Macro Name   Condition    Action       Reference

      ------------------------------------------------------------

      Page Reset                SetValue     [a]

      Set Top1     [Top1]=0     SetValue     [b]

      Print        [Top1]=0     SetValue     [c]

                   Top=[Top1]   SetValue     [d]

                   ...          SetValue     [e] -- repeat for

                   ...          SetValue     [e] -- each control

                   ...          SetValue     [e] -- in the

                   ...          SetValue     [e] -- detail section

                   ...          SetValue     [f]

                   ...          StopMacro    [g]

                                SetValue     [h]

                                SetValue     [i] -- repeat for

                                SetValue     [i] -- each control

                                SetValue     [i] -- in the

                                SetValue     [i] -- detail section

   The ellipses in the Condition column are required for lines e, f, and g;

   enter them exactly as shown. Microsoft Access evaluates macro conditions

   as true or false. If the expression is true, Microsoft Access performs

   the action. If it is false, Microsoft Access ignores the action. The

   ellipses in the Condition column force Microsoft Access to perform the

   action on that line if the condition on the preceding line is true.

   Here is the second table. It gives the action arguments for each action:

      Reference   Action       Action Arguments

      ----------------------------------------------------------

      [a]         SetValue     Item: [Top1]

                               Expression: 0

      [b]         SetValue     Item: [Top1]

                               Expression: Top

      [c]         SetValue     Item: [Top1]

                               Expression: Top

      [d]         SetValue     Item: [Continued].Visible

                               Expression: Yes

      [e]         SetValue     Item: [Product Name].Visible

                               Expression: No

      [e]         SetValue     Item: [Product Id].Visible

                               Expression: No

      [e]         SetValue     Item: [Quantity Per Unit].Visible

                               Expression: No

      [e]         SetValue     Item: [Units In Stock].Visible

                               Expression: No

      [f]         SetValue     Item: NextRecord

                               Expression: False

      [g]         StopMacro

      [h]         SetValue     Item: [Continued].Visible

                               Expression: No

      [i]         SetValue     Item: [Product Name].Visible

                               Expression: Yes

      [i]         SetValue     Item: [Product Id].Visible

                               Expression: Yes

      [i]         SetValue     Item: [Quantity Per Unit].Visible

                               Expression: Yes

      [i]         SetValue     Item: [Units In Stock].Visible

                               Expression: Yes

5. The SetValue actions in lines e and i are used to hide the controls

   in the detail section of your report. The List Of Products By

   Category report has 4 controls in the detail section: Product Name,

   Product Id, Quantity Per Unit, and Units In Stock. You should

   repeat lines e and i for the number of controls in your detail

   section. For example, if you have only one control in the detail

   section, you need only one e and one i.

6. Save the macro group and specify Continued as the name. This makes

   Continued the name of the macro group. It now appears in the list of

   macros and macro groups in the Database window. Use the following syntax

   to specify each macro in the macro group when you attach a macro to a

   property on the report:

      macrogroupname.macroname

   For example, the following specifies the Print macro: continued.print.

Step Two: Attach the Macros to the Report

-----------------------------------------

1. Open the report in Design view.

2. Set the following properties for the specified sections by selecting

   each section with the mouse and viewing its properties:

      Section Name           Property     Expression

      --------------------------------------------------------

      Page Header            OnFormat     Continued.Page Reset

      Category Name Header   OnFormat     Continued.Set Top1

      Detail                 OnFormat     Continued.Print

                             CanShrink    Yes

      Category Name Footer   OnFormat     Continued.Set Top1

   This sets the Top1 control to the current value of the Top expression

   to keep track of the current twip value (position) of the top.

Step Three: Add Controls to the Report and Set Properties

---------------------------------------------------------

1. Open the report in Design view.

2. Create an unbound text box control named Top1.

3. Place the Top1 text box control in the Category Name header section.

4. Assign the following property values to the Top1 text box control:

      Property         Expression

      ---------------------------

      ControlName:     Top1

      Visible:         No

5. In the detail section, create a text box bound to an expression. Locate

   it near the top in the same vertical location as that of the group

   header label. Assign the following property values to the text box:

      Property         Expression

      ------------------------------------------------

      ControlName:     Continued

      ControlSource:   =[Category Name] & " continued"

      Visible:         No

      CanShrink:       Yes

   NOTE: Replace Category Name with the name of the field being

   grouped.

6. Save and run the report.

The approach described here works well for both single-column and

multiple-column reports, but there is a simpler method you can use

for a single-column, multiple-page report.

For more information about the simpler method, query on the following words

here in the Microsoft Knowledge Base:

   continued and groups

REFERENCES

==========

For more information about how to make the page header span the full width

of a multiple-column report, query on the following words here in the

Microsoft Knowledge Base:

   span and width

For information about how to create multiple-page reports with snaking

column, search on "multiple-column reports" then "Creating Snaking Columns

on a Report" using the Microsoft Access Help menu.

Also, see the Microsoft Access "User's Guide," version 1.0, Chapter 19,

"Sorting and Grouping Data."

Additional reference words: 1.00 1.10 multicolumn snake snaking-column


PRB: Exporting Table with OLE Object or Memo Field to Paradox

 Article Number: Q93928

 CREATED: 21-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you export a table from Microsoft Access that contains a field

with an OLE object or Memo data type in Paradox 3.x format, the

resulting Paradox table contains one entry that says m_i_c_r_o_s_o_f_t.

You can see this result by importing the Paradox table you just exported

and then opening the table.

Microsoft Access version 2.0 can export Memo and OLE fields to Paradox 4.x

format. If you export Microsoft Access version 2.0 Memo or OLE fields to

Paradox 3.x format, the problem mentioned above will occur.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. In Microsoft Access, copy any existing table to a new name.

2. In Design view, add an OLE Object field or Memo field to the copied

   table.

3. After saving and closing the table, export it choosing Paradox 3.x as

   the data destination and TESTFLD.DB as the name. You will get this

   error: "Invalid Data Type." However, the TESTFLD.DB file is created.

4. Import TESTFLD.DB using Paradox 3.x as the Data Source.

5. Open the resulting table. You will see a table consisting of one field

   with the field name m_i_c_r_o_s_o_f_t and the data type Number, but

   there is no data in the table.

Paradox is manufactured by Borland International, a vendor independent of

Microsoft; we make no warranty, implied or otherwise, regarding this

product's performance or reliability.

Additional reference words: 1.00 1.10 2.00 memo


INF: How to Open UTILITY.MDA

 Article Number: Q93929

 CREATED: 21-DEC-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

If you try to open the UTILITY.MDA file, you receive the following

error message:

   The database "UTILITY.MDA" is already open as a library database.

To open the UTILITY.MDA file, you must create a copy of UTILITY.MDA,

rename the copy, and then open it in Microsoft Access.

MORE INFORMATION

Use the following steps to open the UTILITY.MDA file.

NOTE: UTILITY.MDA is a collection of tables, forms, and modules used by

Microsoft Access. You should always have a backup copy of UTILITY.MDA; this

is a vital database to Microsoft Access and any changes in it may result in

unexpected behavior.

1. Copy UTILITY.MDA to UTILITY.SAV.

2. In Microsoft Access, open UTILITY.SAV by choosing Open from the

   File menu.

3. Choose OK when the following error message is displayed:

      Tried to load module with duplicate procedure definition:

        <procedure name>

After you make any changes to the copy of UTILITY.MDA, you can rename the

original UTILITY.MDA file and substitute the edited copy of the UTILITY.MDA

file for the one that Microsoft Access uses when the application is opened.

Additional reference words: 1.00 1.10 2.00 errmsg utility


INF: How to Use DDE to Fill a List Box

 Article Number: Q94003

 CREATED: 22-DEC-1992

 MODIFIED: 22-AUG-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article contains an example of an Access Basic list function

that uses dynamic data exchange (DDE) to populate a list box.

The example assumes that you are familiar with DDE, how to create

modules in Access Basic, and how to create list boxes on forms.

MORE INFORMATION

The function below will use DDE to retrieve a list of countries from

Microsoft Excel. The list will be used to populate a list box bound to

the Country field of the Suppliers table in the sample database NWIND.MDB.

 1. In a new worksheet in Excel, enter the following in the first

    column:

       A1  Australia

       A2  China

       A3  Scotland

 2. Save the worksheet as COUNTRY.XLS.

 3. Open NWIND.MDB in Microsoft Access and open a new module.

 4. Place the following in the Declarations section:

       Option Explicit

       Dim Countries(10) As String

       Dim CountryData As String

 5. Create the following subroutine:

      Sub DDEFillCountries ()

         Dim EndString%, i%

         Dim Chan

         EndString% = 0

         i% = 0

         Chan = DDEInitiate("Excel", "COUNTRY.XLS")

         CountryData$ = DDERequest(Chan, "R1C1:R10C1")

         DDETerminate Chan

         EndString% = InStr(1, CountryData, Chr(10))

         Do Until Len(CountryData$) = 0

            Countries(i%) = Left(CountryData, EndString% - 1)

            EndString% = InStr(1, CountryData, Chr(10))

            CountryData$ = Right(CountryData, _

                         Len(CountryData) - EndString% - 1)

            i% = i% + 1

         Loop

      End Sub

 6. Create the following function:

      Function DDEFillList (fld As Control, id, row, col, code)

         Static MonthNum

         Select Case code

            Case 0

               Call DDEFillCountries

               DDEFillList = True

            Case 1

               DDEFillList = id

            Case 3

               DDEFillList = 12

            Case 4

               DDEFillList = 1

            Case 5

               DDEFillList = -1

            Case 6

               DDEFillList = Countries(row)

         End Select

      End Function

 7. Save the module as DDE Fill List Box.

 8. Create a new form based on the Suppliers table.

 9. Add a list box bound to the Country field and set the following

    properties:

      RowSourceType: DDEFillList

10. Verify that Excel is running and the worksheet COUNTRY.XLS is

    open. Switch to browse mode. The list box should now be populated

    with the countries that you entered into Excel.

NOTE: This article demonstrates a simple example and is not a complete

and robust function. If you intend to use this with a form, there are

several things that you may want to add to your code:

 - Error checking for the DDE portion to handle cases where Excel is

   not running or is busy.

 - The example assumes that there are ten countries listed in Excel.

 - This list function does not return the number of rows in the data

   to Microsoft Access.

 - The form may need to be refreshed to show updated data.

References:

Microsoft Access "User's Guide," version 1.0, chapter 9

"Microsoft Access Basic: An Introduction to Programming," version 1.0,

page 82

Additional reference words: 1.00 1.10 checkpage


INF: Installing Microsoft Access on a Diskless Workstation

 Article Number: Q94010

 CREATED: 22-DEC-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

The third paragraph on page 658 of the Microsoft Access "User's Guide,"

version 1.0, states that a workstation that runs Microsoft Access from the

network requires 1 megabyte. This means that a workstation that has a hard

disk requires 1 megabyte of hard disk space, and a diskless workstation

requires 1 megabyte of space in the user's directory on the network--not

on the local workstation.

MORE INFORMATION

You can install and run Microsoft Access from a diskless workstation

as long as your workstation meets the basic requirements for running

Microsoft Access.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Appendix D, "Setting up

Microsoft Access on a Network," page 658

Microsoft Access "User's Guide," version 1.1, Appendix D, "Setting up

Microsoft Access on a Network," page 668

Additional reference words: 1.00 1.10 network requirements


PRA: Datasheet Form Saved as Subreport Causes GP Fault

 Article Number: Q94026

 CREATED: 22-DEC-1992

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

A report containing a subreport created from a form causes a

general

protection (GP) fault in Microsoft Windows if the

DefaultView property of

the original form is set to Datasheet.

The following error message appears after you choose Print

Preview or

Print from the File menu:

   MSACCESS caused a General Protection Fault in module

MSACCESS.EXE

   at 006A:0A26

RESOLUTION

You can use a form as a subreport by embedding it directly

in the main

report. You do not need to choose the Save As Report menu

option. A

form with its DefaultView property set to Datasheet will not

cause a

GP fault when it is embedded in a report. The following

steps demonstrate

how to do this:

1. Open the sample database NWIND.MDB.

2. Create a new report.

3. Drag the Categories Subform form from the Database window

to the main

   report.

   -OR-

1. Open the original form in Design view.

2. Change the DefaultView property to either Single Form or

Continuous

   Forms.

3. From the File menu, choose Save As Report.

4. Embed the new form in your report.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access version

1.0. This problem no longer occurs in Microsoft Access

version 1.1.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB.

2. Open the Categories Subform form in Design view.

3. From the File menu, choose Save As Report.

4. Create a new report based on the Categories table.

   NOTE: The GP fault only occurs if the main report is

bound.

5. Drag the Categories Subform report that you created in

step 3 to

   the main report that you created in step 4.

6. Preview the report.


PRB: Query by Form Returns No Rows When All Rows Expected

 Article Number: Q94027

 CREATED: 22-DEC-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

While specifying criteria for a query in a previously designed form,

you leave one of the fields empty because you want all the records,

not just the ones that match a certain value. But instead of getting

all the records, as you expected, you get none at all.

CAUSE

Queries that contain empty criteria fields may return unexpected

results because an empty criteria field results in the following

condition in the WHERE clause:

   Like Null

This condition is always false because any operation that includes a

null value returns a null result.

Queries can reference form fields through implicit parameters--

making a query by form. For example, an application developer might

put the following criteria on the CustomerName field:

   Like Forms!CriteriaDialog!CustomerName

Here CriteriaDialog is a form that holds the criteria fields. Someone

using the application might omit a customer name entry in the

CriteriaDialog form in the hopes of seeing all the rows. However, the

query actually returns no rows because of the null reference in the

resulting WHERE clause.

RESOLUTION

Application developers can work around this potential problem by

adding the following function to a module:

   Function CNulls (v As Variant, subs As Variant) As Variant

      If (IsNull(v)) Then

         CNulls = subs

      Else

         CNulls = v

      End If

   End Function

The CNulls() function converts null values to a given value.

Essentially, if the first argument to the function is null, the second

argument is returned. Otherwise, the first argument is returned

unchanged.

After you add the function to a module, change the criteria to read

like this:

   Like CNulls( Forms!CriteriaDialog!CustomerName, "*"  )

Now, if the user does not supply a customer name, the CNulls() function

will return the asterisk, and the condition will return all rows that

contain data.

Additional reference words: 1.00 1.10 2.00 Queries Forms AB


PRB: Cannot Check to See If Database Was Opened Exclusively

 Article Number: Q94035

 CREATED: 22-DEC-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

In a multiuser environment, you cannot use the OpenDatabase command to

find out if the current database was opened exclusively. If you attempt

to open the current database with the OpenDatabase command in Access

Basic and the current database was originally opened exclusively,

the database will open and no error will be returned.

CAUSE

Microsoft Access ignores the option flags for all opens except the

first for a given window's task, so a system administrator cannot use

this to test if a database has been opened exclusively. The technique

does not work because Microsoft Access does not check the option flags.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

The following Access Basic subroutine successfully opens the current

database, even if the current database has been opened exclusively.

1. Open a database called DB1.MDB.

2. Enter the Access Basic sub shown below in a new module:

   NOTE: In the following sample code, an underscore _ is used as a

   line-continuation character. Remove the underscore when re-creating

   this code in Access Basic.

      '********************************************************

      'Declarations section of the module

      '********************************************************

      Option Compare Database

      '===============================================================

      ' The following sub is named Test().

      '===============================================================

      Sub Test ()

         On Error GoTo ErrorHandler

         Dim db As Database

         Set db = OpenDatabase("db1.mdb", False)

         db.Close

         Exit Sub

      ErrorHandler:

         If Err = errCantOpenDbShared Then

            MsgBox "You opened the database exclusively. Please_

               re-open it non-exclusively!"

            DoCmd SelectObject A_TABLE, "", True

            DoCmd Close

         Else

            Resume Next

         End If

      End Sub

3. Run the subroutine from the Immediate Window by typing Test.

You do not receive an error message.

Additional reference words: 1.00 1.10 2.00


PRB: Cannot Perform OpenTable Method on an Attached Table

 Article Number: Q94036

 CREATED: 22-DEC-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

--------------------------------------------------------------------

SYMPTOMS

If you try to use an OpenTable method on an attached table, you will

receive one of the following error messages:

   Can't perform operation; it is illegal.

   -or-

   Invalid Operation.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Attach any valid table.

2. Create the following module:

      '***********************************************************

      'Declarations section of the module

      '***********************************************************

      Option Explicit

      '================================================================

      'The following will set the database to the current database and

      'attempt to open the attached SQL table. Name equals the attached

      'table's name.

      '================================================================

      Sub Test

         Dim db as Database

         Dim t as Table

         Set db = CurrentDB()

         Set t = db.OpenTable("dbo_name")

      End Sub

3. Compile the module, then execute the sub. You will receive one of the

   error messages stated above.

Additional reference words: 1.00 1.10 2.00 errmsg


INF: Attach R:BASE Table by Exporting dBASE Format in R:BASE

 Article Number: Q94037

 CREATED: 22-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access does not ship with an ISAM driver that supports attaching

R:BASE tables to Microsoft Access databases. However, R:BASE can export

tables into several different formats that Microsoft Access can import.

To retain column names and data type definitions, export R:BASE tables

from R:BASE using the dBASE format.

MORE INFORMATION

R:BASE can export the following data types:

 - ASCII delimited

 - ASCII fixed width

 - DIF (VisiCalc or other program)

 - SYLK (Multiplan or other program)

 - dBASE II, dBASE III, or dBASE III Plus (DBF)

 - Lotus 1-2-3 (version 1.0 and 2.0) or Symphony (WKS, WK1, or WRK)

R:BASE and dBASE are manufactured by vendors independent of Microsoft; we

make no warranty, implied or otherwise, regarding these products'

performance or reliability.

Additional reference words: 1.00 1.10 2.00 rbase


PRA: Memo Field with Format Property Truncates Data

 Article Number: Q94039

 CREATED: 22-DEC-1992

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

- Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SYMPTOMS

If you apply formatting to a Memo field by using the Format

field

property, Microsoft Access truncates the data at 255

characters. The

field retains its Memo data type, but data after the first

255

characters disappears. This happens to existing data in the

Memo field

as well as any new data you enter.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0 and 1.1. We are researching this problem and

will post new

information here in the Microsoft Knowledge Base as it

becomes

available.

Additional reference words: 1.00 1.10 memo format lost


INF: How to Use SendKeys in a Macro to Change an OLE Link

 Article Number: Q94040

 CREATED: 22-DEC-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes two methods to automate the changing of a linked

object's source. The first method is to use a macro, and the second method

is to use OLE Automation, which is available in Microsoft Access version

2.0.

MORE INFORMATION

Macro Method

------------

The following example demonstrates how to create and use a macro that

will automatically change the source of a linked OLE object based on a

filename stored in a table.

1. Create a new table with the following fields, and then save it as

   Linked References:

      Table: Linked References

      ------------------------

      FieldName: Key

         DataType: Counter

      FieldName: File Name

         DataType: Text

      FieldName: Linked Object

         DataType: OLE Object

2. In Datasheet view, add the following records to the table. Note

   that the bitmaps used in this example are stored in the Microsoft

   Windows directory (by default, C:\WINDOWS). To embed the objects,

   open each bitmap in Microsoft Windows Paintbrush, select the bitmap

   with the selection tool, and then choose Copy from the Edit menu.

   Switch to Microsoft Access, place the cursor in the Linked Object

   field, and choose Paste Link from the Edit menu.

      Key           Filename      Linked Object

      --------------------------------------------------

      (counter)     ARCADE.BMP     Paste Link ARCADE.BMP

      (counter)     ARCHES.BMP     Paste Link ARCHES.BMP

      (counter)     ARGYLE.BMP     Paste Link ARGYLE.BMP

3. Create a new form based on the table Linked References, and add all

   three fields to the form.

4. Save the form as OLE Test.

5. Create a new macro with the following actions:

      In Microsoft Access version 1.x:

         Action           Arguments

         ----------------------------------------------------------

         GoToControl      Control Name: Linked Object

         SendKeys         Keystrokes: %eol

                          Wait: No

         SendKeys         Keystrokes: =Forms![OLE Test]![File Name]

                          Wait: No

         SendKeys         Keystrokes: {ENTER}

                          Wait: No

      In Microsoft Access version 2.0:

         Action           Arguments

         ----------------------------------------------------------

         GoToControl      Control Name: Linked Object

         SendKeys         Keystrokes: %ekl%c

                          Wait: No

         SendKeys         Keystrokes: =Forms![OLE Test]![File Name]

                          Wait: No

         SendKeys         Keystrokes: {ENTER}{ENTER}

                          Wait: No

6. Save the Macro as Update OLE Link.

7. Open the form OLE Test in Design view and select the control File

   Name.

8. Set the AfterUpdate property to the macro Update OLE Link.

9. To test the form, switch to Form view. Change the field File Name

   in the first record to LEAVES.BMP. The OLE object should update to

   display the bitmap LEAVES.BMP.

OLE Automation

--------------

Microsoft Access version 2.0 supports OLE Automation, a feature of the OLE

2.0 standard. You can use OLE Automation to directly access and manipulate

another application's objects from outside that application.

1. Create the following subprocedure in the File Name control's AfterUpdate

   event procedure. The procedure uses the SourceDoc and Action properties

   to change the source of the linked object.

      Sub File_Name_AfterUpdate ()

        Const OLE_LINKED = 0

        Const OLE_CREATE_LINK = 1

        Const OLE_SIZE_ZOOM = 3

        [Linked Object].OLETypeAllowed = OLE_LINKED ' Object type allowed

        [Linked Object].SourceDoc = [File Name]     ' Specify source file

        [Linked Object].Action = OLE_CREATE_LINK    ' Create linked object

        [Linked Object].SizeMode = OLE_SIZE_ZOOM    ' Adjust control size

      End Sub

2. View the Linked References table in Form view.

3. Change the File Name control to REDBRICK.BMP. The OLE object should

   update to display the REDBRICK.BMP bitmap.

REFERENCES

==========

Microsoft Access "User's Guide," versions 1.0 and 1.1, Chapter 13

Microsoft Access "User's Guide," version 2.0, Chapter 19

Microsoft Access "Building Applications," version 2.0, Chapter 13

Additional reference words: 1.00 1.10 2.00 bound


PRB: Grid Lines Not Visible In Table Datasheet View

 Article Number: Q94041

 CREATED: 22-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Grid lines between records and fields are not visible when you open

tables.

CAUSE

The color palette has been changed and now the colors for the

background and the grid lines are the same or very close.

RESOLUTION

Change the Windows Background setting to the default color or to

a new color in the color section of the Microsoft Windows Control Panel

and the grid lines will reappear when you open a table in Access.

Additional reference words: 1.00 1.10 2.00 gridline show


INF: Function to Delete Table Without Using DoMenuItem

 Article Number: Q94042

 CREATED: 22-DEC-1992

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

You can create and use the DeleteTable() function to delete

a table

without using the DoMenuItem() or SendKeys() functions.

MORE INFORMATION

Microsoft Access stores all references to objects (tables,

queries,

forms, reports, macros, and modules) in a system table

called

MSysObjects. You can delete an object from the MSysObjects

table if

you have permission to do so.

To view the system objects in your database,

1. From the View menu, choose Options.

2. Under the General category, change the Show System

Objects item to

   Yes.

3. Choose OK.

All the system tables should now be visible in the Database

window.

Next, use the following steps to assign yourself permission

to delete

objects from the MSysObjects table:

1. From the Security menu, choose Permissions.

2. Choose modify rights for the table by selecting or

clearing the

   appropriate check boxes.

The DeleteTable() function accepts the name of a table as

its

parameter. It finds the record in MSysObjects that

corresponds to that

table name and deletes that record. The function also

deletes records

from other system tables, including MSysACEs, MSysIndexes,

and

MSysColumns, that relate to the deleted table. The function

returns

a value of True if it successfully deletes the table you

specified; it

returns a value of False if it cannot find a table with the

name you

specified.

NOTE: Modifying data in any system table can have serious

ramifications. Do not attempt to do this unless you are

thoroughly

familiar with the database and know exactly where, when, and

how the

table you want to delete is used elsewhere in the database.

It is

best to use the DeleteTable() function on temporary tables

only.

The Access Basic code for the DeleteTable() function is as

follows:

NOTE: In the following sample code, an underscore (_) is

used as

a line-continuation character.  Remove the underscore when

re-creating this code in Access Basic.

   Option Explicit

   Function DeleteTable (TableName as String)

      Dim SQL As String, Msg As String

      If DCount("[Name]", "MSysObjects", "[Name] = '" _

            & TableName & "'") = 0 Then

         DeleteTable = FALSE

         Exit Function

      End If

      On Error GoTo DeleteErrorProc

   ' Suppress the "Do you want to delete these records?"

message.

      DoCmd SetWarnings False

   ' SQL statement to delete appropriate entries from the

MSysColumns

   ' table follows:

      SQL = "DELETE DISTINCTROW MSysObjects.Name,

MSysColumns.*"

      SQL = SQL & " FROM MsysObjects, MSysColumns,"

      SQL = SQL & " MSysColumns INNER JOIN MSysObjects ON"

      SQL = SQL & " MSysColumns.ObjectId = MSysObjects.Id"

      SQL = SQL & " WHERE ((MSysObjects.Name = '" &

TableName & "'));"

      DoCmd RunSQL SQL

different ObjectID

   ' SQL Statement to delete appropriate entries from

MSysACEs table

   ' follows:

      SQL = "DELETE DISTINCTROW MSysObjects.Name,

MSysACEs.*"

      SQL = SQL & " FROM MSysObjects, MSysACEs,"

      SQL = SQL & " MSysObjects INNER JOIN MSysACEs ON"

      SQL = SQL & " MSysObjects.Id = MSysACEs.ObjectID"

      SQL = SQL & " WHERE ((MSysObjects.Name= '" & TableName

& "'));"

      DoCmd RunSQL SQL

   ' SQL statement to delete references to indexes in

MSysIndexes follows:

      SQL = "DELETE DISTINCTROW MSysObjects.Name,

MSysIndexes.*"

      SQL = SQL & " FROM MSysObjects, MSysIndexes,"

      SQL = SQL & " MSysObjects INNER JOIN MSysIndexes ON"

      SQL = SQL & " MSysObjects.Id = MSysIndexes.ObjectId"

      SQL = SQL & " WHERE ((MSysObjects.Name= '" & TableName

& "'));"

      DoCmd RunSQL SQL

   ' SQL statement to delete references to table object from

MSysObjects

   ' follows:

      SQL = "DELETE DISTINCTROW MSysObjects.Name "

      SQL = SQL & " FROM MSysObjects"

      SQL = SQL & " WHERE ((MSysObjects.Name = '" &

TableName & "'));"

      DoCmd RunSQL SQL

   ' If you decide to update the Database window, include

the following

   ' command:

      SendKeys "{F11} %VQ%VT"'

   ' Test to make sure the object was deleted, then exit.

      If DCount("[Name}, "MSysObjects", "[Name] = '" _

            & TableName & "'") = 0 Then

         DeleteTable = True

         Exit Function

      EndIf

   ' If error occurs, display the error message and

terminate with error.

   DeleteErrorProc:

      Msg = "An unexpected error has occurred." & Chr(13) &

Chr(10)

      Msg = Msg & "Error: " & Error$

         MsgBox Msg

      DeleteTable = False

      Exit Function

   End Function

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, chapter 25

Additional reference words: 1.00 1.10 functions sysfiles


INF: Northwind 'Sales Totals by Amount' Report Is Incorrect

 Article Number: Q94043

 CREATED: 22-DEC-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

The report named "Sales Totals by Amount" included in the sample

database Northwind Traders (NWIND.MDB) does not work correctly. The

report uses the Conditional Page Break macro to print 10 lines on each

page of the report. This works properly for only the first page

because the counter on the report is not being reset. To enable this

to work correctly, you must change the Conditional Page Break macro.

In the macro named Show Break within the macro Conditional Page Break,

you must change the Condition to read as follows:

   [COUNTER] MOD 10 = 0

This will now perform a page break after every 10 lines of the report

for every page.


PRB: Err Msg: "Couldn't Update: Currently Locked by User..."

 Article Number: Q94080

 CREATED: 23-DEC-1992

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The following message appears either when two users simultaneously try to

update a similar object in a shared database, or on a single-user system if

the system runs out of locks:

   Couldn't update; currently locked by user '<user name>' on machine

   '<machine name>'

CAUSE

On a multiuser system, a conflict exists with the SYSTEM.MDA file.

By design, Microsoft Access cannot simultaneously update the

MsysObjects table in the SYSTEM.MDA file for multiple users.

On a single-user system, there are not enough locks specified in the

AUTOEXEC.BAT file.

RESOLUTION

Multiuser System

----------------

On a multiuser system, try saving the object again. If no one is

updating a similar object at the same time, the Save command should

work. This error can occur in Access Basic code also, so you will need

to handle error trapping for this.

Single-User System

------------------

1. Exit Windows.

2. Delete all the .LDB files from the Microsoft Access directory.

3. Delete all the .TMP files from the Windows directory and from the

   WINDOWS\TEMP directory.

4. Edit the AUTOEXEC.BAT file. Look for a line similar to:

      C:\DOS\SHARE.EXE

   Add "/L:500" (without quotation marks) to the end of the line, so it

   reads:

      C:\DOS\SHARE.EXE /L:500

   Note that this line will not be present if you run VSHARE.EXE, OS/2,

   or you are running on a network.

5. After saving the AUTOEXEC.BAT file, restart your computer.

MORE INFORMATION

The SYSTEM.MDA file conflict is likely to occur only on systems with

many (100+) users.

Steps to Reproduce Behavior

---------------------------

1. User A and user B open the same database on a shared drive.

2. Both users create a new object of similar type (such as a table,

   form, report, query, or macro).

3. Both users choose Save from the File menu and enter a unique filename.

4. Simultaneously, user A and user B press ENTER to update the object.

5. Microsoft Access presents the error message listed above. Choose OK

   to dismiss the message and try again.

Additional reference words: 1.00 1.10 2.00 network errmsg


PRB: Append Query Results in Duplicate Counter Numbers

 Article Number: Q94105

 CREATED: 28-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A table that you append data to using an append query now has

duplicated numbers in a field defined as a Counter data type. The

expected result was appended data with incremented numbers in the

Counter field.

CAUSE

Your append query is explicitly referencing the field with the

Counter data type. You are, in essence, overriding the automatic

counter function that you specified in your table design. This may

result in duplicate numbers.

RESOLUTION

Do not include a field with a Counter data type in the Append To

row of the QBE grid in your append query. By omitting this field in

your append query, Microsoft Access will automatically generate

incremental numbers in the appended table's Counter field.

STATUS

This behavior is by design.

MORE INFORMATION

You will only get duplicates if there is no Primary Key or Index

(No Duplicates) defined on the Counter field in the table that you are

appending to. By definition, primary keys are unique.

Including fields with Counter data types in your append query might

also result in non-contiguous numbers in the table that you are

appending to. For example, if the table you are appending to has

values of 1 to 20 in the Counter field, and the table you are

appending from has values of 20, 34, and 55, you will end up with one

duplicate value. The next time you add a new row to the appended to

table, the Counter field will be assigned a value of 56.

Additional reference words: 1.00 1.10 2.00


PRB: Access Adds Date Delimiters When Importing Text

 Article Number: Q94106

 CREATED: 28-DEC-1992

 MODIFIED: 19-JUL-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When importing a text file that contains date values that do not

contain a date delimiter such as a '/' into Microsoft Access version

1.0, the '/' date delimiter will be added to the date field in the Table.

An example date would be 112192.  This date value would be loaded into

Microsoft Access as 11/21/92.

CAUSE

Microsoft Access will automatically separate the month, day, and year

with a '/' date delimiter when importing a text file, regardless of whether

the text file is formatted with a date delimiter.  This only occurs when

you import the file to an existing table only.  If the import created the

table then the 112192 date value would be loaded as 111292 with a Number

datatype.

STATUS

his behavior is by design.

Additional reference words: 1.00 1.10 date delimiter


INF: Importing Fixed-Width Text Files

 Article Number: Q94107

 CREATED: 28-DEC-1992

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00

------------------------------------------------------------

--------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

--------

SUMMARY

This article describes the fixed-width text file format and

explains how to

import this type of file.

MORE INFORMATION

A fixed-width text file in Microsoft Access is a file that

contains records

of a fixed, consistent width. The data fields in each record

begin at fixed

offsets from the beginning of the record.

You cannot import files that have variable length records

that do not

contain field separators (for example, commas or tabs).

These files are not

fixed-width text files. To import this kind of file, you

need to first

process the file using an editor to insert field separators

or to turn the

file into a true fixed-width text file by, for example,

adding spaces to

each record to make all records the same width (number of

characters).

Microsoft Access imports fixed-width text files by casting a

record

template into the file at calculable offsets. It uses the

offsets to

determine the logical beginning of each new record.

Microsoft Access

determines the logical record width by scanning the first

data record of

the file to locate the first carriage return and line feed

(CR/LF). It

assumes that the first CR/LF marks the end of the first

record (see point

three later in this article).

The data fields defined in the template come from the

information

you supplied when you set up the import/export

specification. Microsoft

Access uses the template to extract the individual field

values. Then it

enters the field values into table and advances the template

to the next

record.

To import fixed-width text files successfully, they must

meet the following

conditions:

1. The file must be truly fixed-width. That is, all records

have the same

   width with all fields in the records beginning at

consistent offsets.

2. The import/export specification you set up must match the

physical

   file. Microsoft Access uses the specification to create

the template

   of fields after inspecting the physical file to determine

the overall

   record size. If the field template differs from the

actual record size,

   you may get bad results.

   Ensure that the greatest (Offset + Width - 1) in your

import/export

   specification is less than or equal to the physical

record width

   excluding the CR/LF at the end of the record. In other

words, an

   import/export specification that defines two fields--ID

beginning at

   offset 1 for a width and of 8 and DATA beginning at

offset 11 for a

   width of 50--requires your physical file to contain

records of no less

   than 60 bytes (11 + 50 - 1) not counting the CR/LF.

Microsoft Access

   will ignore records that have extra data beyond the last

byte defined in

   the import/export specification.

3. The first record in the file must not contain embedded

CR/LF characters.

   Otherwise, the Microsoft Access record size calculation

will be wrong.

REFERENCES

==========

For more information, search for "Fixed-width text files"

using the

Microsoft Access Help menu. Also, see the Microsoft Access

"User's Guide,"

version 1.0, Chapter 4, "Importing, Exporting, and

Attaching," pages 72-85.

Additional reference words: 1.00 Import/Export Keys Forms


INF: MS Access Does Not Support Parameter Queries as DDE Topic

 Article Number: Q94108

 CREATED: 28-DEC-1992

 MODIFIED: 28-DEC-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Microsoft Access does not support parameter queries through dynamic

data exchange (DDE). To perform a parameter-driven query, Microsoft

Access must receive parameters in a manner that DDE does not support.

MORE INFORMATION

An attempt to initiate a DDE channel with a parameter query fails. The

resulting error message depends on the DDE client application

involved. When the DDE client is Microsoft Visual Basic, it displays

the following message:

   No foreign application responded to DDE Initiate

Microsoft Excel displays the following error message:

   Remote Data not Accessible. Start "MSACCESS.EXE"?

One method to work around this situation links a Microsoft Access form

to the DDE client. This link transfers the parameter to Microsoft

Access. You then can modify the query to retrieve the parameter from

the form.

To implement this method in Microsoft Excel, perform the following

five steps and their respective subprocedures:

1. Create the DDE Link

----------------------

   a. Start Microsoft Excel and open a new Macro sheet.

   b. In Cell A1, type "DAIR" (without the quotation marks).

   c. Save the macro sheet as DDETEST.XLM.

   d. Select Cell A1 and choose Copy from the Edit menu.

   e. Start Microsoft Access and open the sample database NWIND.MDB.

   f. Create a new, unbound form.

   g. From the Edit menu, choose Paste Special.

   h. In the Data Type list box, select Text, then choose Paste Link.

      A Text box that contains the following formula is created:

         =DDE("Excel","C:\ACCESS\DDETEST.XLM","R1C1")

   i. If the Properties box is not available, choose Properties from the

      View menu.

   j. Select the text box created in Step g. Change the Control Name

      property to "DDE Parameter" (without the quotation marks).

   k. Save the form as [DDE Link Form].

2. Modify the Query

-------------------

   a. Open the [Products By Category (Parameter)] query in Design

      view.

   b. From the Query menu, choose Parameters. Delete the [Enter a

      Category ID] criteria from the query.

   c. In the [Category ID] field in the query grid, replace the existing

      query with the following:

         =Forms![DDE Link Form]![DDE Parameter]

   d. Test the query. Verify that the DDETEST.XLM macro sheet is open in

      Microsoft Excel and that the [DDE Link Form] in Microsoft Access is

      open in Form view. Run the query and verify that the products

      displayed are in the "DAIR" category.

3. Create a Macro to Open the Form

----------------------------------

   a. Create a new macro in Microsoft Access.

   b. Add the following action to the macro:

         OpenForm

            Form Name: DDE Link Form

            View: Form

   c. Save the macro as Open Form.

4. Create a Macro to Run the Query

----------------------------------

   a. Create a new macro in Microsoft Access.

   b. Add the following action to the macro:

         OpenQuery

            Query Name: Products by Categories (Parameter)

            View: Datasheet

   c. Save this macro as Run Query.

5. Create the DDE Macro

-----------------------

   a. In the DDETEXT.XLM macro sheet in Microsoft Excel, enter the

      following macro:

         Cell    Command

         --------------------------------------------

         A1      DAIR

         A2

         A3      chan=INITIATE("MSAccess","System")

         A4      =EXECUTE(chan,"Open Form")

         A5      =APP.ACTIVATE("Microsoft Access")

         A6      =SEND.KEYS("{F9}")

         A7      =TERMINATE(chan)

         A8      =ON.TIME(0.010,Run_Query)

         A9

         A10     chan=INITIATE("MSAccess","System")

         A11     =EXECUTE(chan,"Run Query")

         A12     =TERMINATE(chan)

         A13     =RETURN()

   b. Select Cell A10. Choose Define Name from the Formula menu. In the

      Define Name dialog box, type "Run_Query" in the Name field. Choose

      Command in the Macro group box, then choose OK. This step assigns

      the name Run_Query to the macro that begins in Cell A10.

   c. In Microsoft Access, close all forms, macros, and queries.

   d. To run the macro, make DDETEXT.XLM the active macro sheet and

      select Cell A3. Then choose Run from the Macro menu and choose OK.

      NOTE: The Microsoft Excel macro runs much more quickly if you set

      the DDE Timeout option in Microsoft Access to 1 second.

Questions & Answers

-------------------

Q. Why does the Microsoft Excel macro use SendKeys?

A. Microsoft Excel instructs Microsoft Access to open the form [DDE

   Link Form]. When it opens this form, Microsoft Access attempts to

   update the DDE link in the [DDE Parameter] control. However,

   Microsoft Excel does not process any requests until it receives

   notification that Microsoft Access has successfully completed the

   macro.

   In turn, Microsoft Access does not complete executing the macro until

   it successfully updates the link to Microsoft Excel. Eventually,

   Microsoft Access times out and displays the #Error message. The

   SendKeys command sends the F9 key sequence to Microsoft Access to

   refresh the form.

Q. How can I send this information to Microsoft Excel?

A. To transfer the results of a query to Microsoft Excel, change the

   query to a make-table query. Then use the DDERequest() function to

   retrieve the data in the table from Microsoft Excel.

REFERENCES

==========

For information about the DDE server topics that Microsoft Access

supports, please refer to the README.TXT file for Microsoft Access

version 1.0. This file is located in your program directory.

For more information on parameter queries, please refer to the

"Microsoft Access User's Guide," version 1.0, Chapter 7, "Designing

Action Queries and Parameter Queries," pages 178-181.

For more information on creating DDE links in forms and reports,

please refer to the "Microsoft Access User's Guide," version 1.0,

Chapter 13, "Using Pictures, Graphs, and Other Objects," pages

337-339.

Additional reference words: 1.00 1.10 checkpage


PRB: Trailing CR/LFs Stripped From Text Box When Retrieved

 Article Number: Q94109

 CREATED: 28-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Trailing carriage returns and line feeds (CR/LFs) are deleted when you

retrieve data from a text box. Although you can insert CR/LFs  into a

text box, when you attempt to retrieve the data, they are deleted.

STATUS

This is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the Customers Form in the sample Northwind Traders database

   (NWIND.MDB).

2. Open the Immediate window, and position it on the screen so that

   it and the Customers form are both in view.

3. Type the following command in the Immediate window:

      Forms!Customers.[Contact Name] = "Chris" & chr(13) & chr(10)

   At this point, the Contact Name control on the form should be

   updated and should contain the text 'Chris' with a blank line below

   it. This shows that the CR/LF is in the text box.

4. Type the following command in the Immediate window.

      MyValue = Forms!Customers.[Contact Name]

   The variable MyValue contains the text 'Chris', but there is no

   CR/LF at the end of the text. This can be tested by executing

   the following command from the Immediate window:

      Print MyValue & "*"

   This returns the value 'Chris*' which shows that there is no CR/LF

   at the end of MyValue.

Additional reference words: 1.00 1.10 2.00 strip out eliminate truncate


PRB: Full Path Causes Endless Loop in StartApp() Example

 Article Number: Q94110

 CREATED: 28-DEC-1992

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

Passing the full path of a DDE server to the StartApp()

function will

cause an endless loop. The function will continue to run,

starting up

new copies of the specified DDE server, until the user stops

the code

or the workstation runs out of memory and the code fails.

The function works correctly if the name of the DDE server

without

the path is used.

MORE INFORMATION

The sample database NWIND.MDB contains a module called

Introduction to

Programming. Much of the Access Basic code used as examples

in the

"Microsoft Access Basic: An Introduction to Programming"

manual, version

1.0 is included in this module. The sample function

StartApp() from

page 142 contains a routine that can be used to initiate a

DDE channel.

If the DDEInitiate() in the StartApp() function fails, the

error

handling routine StartApp: attempts to start the server. The

error

routine then passes control back to the main body of code,

where the

DDEInitiate is tried again.

If the full path to the DDE server is used when the

StartApp()

function is called, the DDEInitiate() function will fail,

but the

Shell() function in the error routine will be successful.

The following is an example of using StartApp() that will

cause an

endless loop:

   =StartApp("c:\winword\winword.exe","system")

The following is an example that will work correctly:

   =StartApp("winword","system")

Additional reference words: 1.00 1.10 excel channel


PRB: Hewlett-Packard Dashboard GP Faults in Microsoft Access

 Article Number: Q94111

 CREATED: 28-DEC-1992

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You get a General Protection (GP) Fault when using Microsoft Access with

the Hewlett-Packard Dashboard 1.0.

RESOLUTION

Hewlett-Packard Company has released a patch that fixes this problem.

Download the patch from the CompuServe HPSYS forum. The file you want is

DB101U.EXE in Library 11.

MORE INFORMATION

To obtain the file, sign on to CompuServe and follow this procedure:

1. Type GO HPSYS at the ! prompt in CompuServe, and press ENTER. CompuServe

   will give you general information about the forum and ask you to join.

2. Press ENTER until you reach the Forum! prompt.

3. Type LIB, and press ENTER. When CompuServe prompts you for a library

   number, type 11, and press ENTER.

4. Type DOWN DB101U.EXE, and press ENTER. CompuServe will ask you for a

   local file name. Enter DB101U.EXE along with the path indicating where

   you want to store the file, and press ENTER. For example, you might

   enter this:.

      C:\WINDOWS\DB101U.EXE

At this point, CompuServe will begin to download the file.

5. When the download process is complete, you are ready to run the patch.

   When you run it, it will expand into more than one file, so create a

   subdirectory and copy DB101U.EXE into it. Then change to that

   subdirectory and enter DB101U at the MS-DOS command prompt.

   DB101U.EXE will automatically extract and expand the patch and a

   readme file. Hewlett-Packard Company recommends that you follow the

   instructions in that readme file.

Dashboard is a trademark of Hewlett-Packard Company. Dashboard is

manufactured by a vendor independent of Microsoft; we make no warranty,

implied or otherwise, regarding this product's performance or reliability.

Additional reference words: 1.00 1.10 WinIss 3rdparty gp fault gpf


INF: Microsoft Access 1.0 Disks 1-4 Contents (5.25 Inch 1.2MB)

 Article Number: Q94112

 CREATED: 28-DEC-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

----------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

----------------------------------------------------------------------

SUMMARY

The following lists the directory contents of disks 1-4 shipped with

Microsoft Access version 1.0 (5.25 inch, 1.2 MB).

Disk 1

------

Volume Label: DISK1

1        WMF      4470 10-25-92  12:00a

1E       WMF      4022 10-25-92  12:00a

COMMDLG  DL$     46406 10-09-92  10:02a

COMMDLG  DL_     89248 10-25-92  12:00a

CTL3D    DL$      7524 08-16-92   7:35p

DDEML    DL$     20305 03-10-92   3:10a

DETCMD   DL_     24128 10-25-92  12:00a

MSACCESS IN$       519 10-25-92  12:00a

MSACCESS RE$       552 10-25-92  12:00a

MSAIN100 DL$     71625 10-25-92  12:00a

OLECLI   DL$     41083 10-09-92  10:02a

OLESVR   DL$     13129 10-09-92  10:02a

ORDENTRY TX$      2281 10-25-92  12:00a

ORDENTRY HL$     14224 10-25-92  12:00a

ORDENTRY MD$    200396 10-25-92  12:00a

PIM      HL$      8119 10-25-92  12:00a

SETUP    EXE     21472 10-25-92  12:00a

SETUP    INI       149 10-25-92  12:00a

SHARE    EX$      8112 10-09-92  10:02a

SHELL    DL$     23296 10-09-92  10:02a

SMALLB   FO$      9687 03-06-92   7:16p

SMALLE   FO$     11236 03-06-92   7:16p

SMALLF   FO$      9376 03-06-92   7:16p

STFSETUP EX_    477376 10-25-92  12:00a

STFSETUP IN_     56600 10-25-92  12:00a

VER      DL_      9008 10-25-92  12:00a

VER      DL$      5653 10-09-92  10:02a

WORKGRP  IN_      1393 10-25-92  12:00a

       28 file(s)    1181389 bytes

Disk 2

------

Volume Label: DISK2

2        WMF      8022 10-25-92  12:00a

2E       WMF      6870 10-25-92  12:00a

MSACCESS HL$   1189376 10-25-92  12:00a

        3 file(s)    1204268 bytes

Disk 3

------

Volume Label: DISK3

3        WMF      8950 10-25-92  12:00a

3E       WMF      8470 10-25-92  12:00a

MSABC100 DL$    187802 10-25-92  12:00a

MSAES100 DL$     16899 10-25-92  12:00a

MSAFIN   DL$     18553 10-25-92  12:00a

WIZARD   MD$    174297 10-25-92  12:00a

MSACCESS EX$    790199 10-25-92  12:00a

        7 file(s)    1205170 bytes

Disk 4

------

Volume Label: DISK4

4        WMF      8246 10-25-92  12:00a

4E       WMF      7766 10-25-92  12:00a

ANALYZER MD$     49740 10-25-92  12:00a

NEWCUST  DB$      1212 10-25-92  12:00a

NWIND    MD$    555226 10-25-92  12:00a

PIM      MD$    109267 10-25-92  12:00a

SYSTEM   MD$     98863 10-25-92  12:00a

UTILITY  MD$     47055 10-25-92  12:00a

WINHELP  EX$    147911 10-09-92  10:02a

WINHELP  HL$     28161 10-09-92  10:02a

       10 file(s)    1053447 bytes


INF: Microsoft Access 1.0 Disks 5-9 (5.25 inch, 1.2 MB)

 Article Number: Q94113

 CREATED: 28-DEC-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SUMMARY

The following lists the directory contents for disks 5-9 including the ODBC

Setup disk and the Windows for Workgroups Driver disk shipped with

Microsoft Access version 1.0 (5.25 inch, 1.2 MB).

MORE INFORMATION

Disk 5

------

Volume Label: DISK5

5        WMF      4662 10-25-92  12:00a

5E       WMF      4150 10-25-92  12:00a

CBTLIB4  DL$     11179 10-25-92  12:00a

CUECARD  EX$     60269 10-25-92  12:00a

CUECARDS DL$      2047 10-25-92  12:00a

CUECARDS LE$    887544 10-25-92  12:00a

        6 file(s)     969851 bytes

Disk 6

------

Volume Label: DISK6

6        WMF      3702 10-25-92  12:00a

6E       WMF      3222 10-25-92  12:00a

BTRVISAM DL$     57918 10-25-92  12:00a

DBSISAM  DL$    135919 10-25-92  12:00a

GRAPH    EX$    364877 10-09-92  10:02a

MSAJT100 DL$    338672 10-25-92  12:00a

MSAJU100 DL$     38945 10-25-92  12:00a

MSGRAPH  HL$    110291 10-09-92  10:02a

PDXISAM  DL$    106830 10-25-92  12:00a

REGEDIT  EX$     18176 10-09-92  10:02a

WBTRCALL DL$     30679 10-25-92  12:00a

       11 file(s)    1209231 bytes

Disk 7

------

Volume Label: DISK7

7        WMF      5846 10-25-92  12:00a

7E       WMF      5366 10-25-92  12:00a

MSACCES2 HL$   1133393 10-25-92  12:00a

PSSKB    TX$      7951 10-25-92  12:00a

README   TX$      9465 10-25-92  12:00a

ERRATA   TX$      9805 10-25-92  12:00a

        6 file(s)    1171826 bytes

ODBC Setup Disk

---------------

Volume Label: ODBC

DBNMP3   DLL      8241 10-22-92   3:06p

INSTCAT  SQL     93796 10-25-92  12:00a

MSCOMSTF DLL     74528 10-25-92  12:00a

MSDETSTF DLL     24544 10-25-92  12:00a

MSINSSTF DLL     65440 10-25-92  12:00a

MSSHLSTF DLL     14928 10-25-92  12:00a

MSUILSTF DLL      6144 10-25-92  12:00a

ODBC     DLL     44736 10-25-92  12:00a

ODBC     INF      1226 10-25-92  12:00a

ODBCADM  EXE      9136 10-25-92  12:00a

ODBCADM  HLP      4942 10-25-92  12:00a

ODBCINST DLL      6016 10-25-92  12:00a

SETUP    EXE     54464 10-25-92  12:00a

SETUPI   DLL     44032 10-25-92  12:00a

SQLSETUP DLL     11024 10-25-92  12:00a

SQLSRVR  DLL    135792 10-25-92  12:00a

VER      DLL      9008 10-22-92   3:06p

LANMAN21     <DIR>     10-25-92  12:00a

       18 file(s)     607997 bytes

Windows for Workgroups Driver Disk

----------------------------------

Volume Label: WFWDRV

WFWDRV   EXE     23581 11-02-92   3:11a

WFWNET   DR_    165600 11-02-92   3:11a

        2 file(s)     189181 bytes


INF: Microsoft Access 1.0 Disk Contents (3.5 inch, 1.44 MB)

 Article Number: Q94114

 CREATED: 28-DEC-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0

---------------------------------------------------------------------

SUMMARY

The following lists the directory contents for each disk shipped

with Microsoft Access version 1.0 (3.5 inch, 1.44 MB).

MORE INFORMATION

Disk 1

------

Volume Label: DISK1

1        WMF      4470 10-25-92  12:00a

1E       WMF      4022 10-25-92  12:00a

BTRVISAM DL$     57918 10-25-92  12:00a

COMMDLG  DL$     46406 10-09-92  10:02a

COMMDLG  DL_     89248 10-25-92  12:00a

CTL3D    DL$      7524 08-16-92   7:35p

DBSISAM  DL$    135919 10-25-92  12:00a

DDEML    DL$     20305 03-10-92   3:10a

DETCMD   DL_     24128 10-25-92  12:00a

MSACCESS IN$       519 10-25-92  12:00a

MSACCESS RE$       552 10-25-92  12:00a

MSAIN100 DL$     71625 10-25-92  12:00a

MSAJU100 DL$     38945 10-25-92  12:00a

OLECLI   DL$     41083 10-09-92  10:02a

OLESVR   DL$     13129 10-09-92  10:02a

ORDENTRY TX$      2281 10-25-92  12:00a

ORDENTRY HL$     14224 10-25-92  12:00a

ORDENTRY MD$    200396 10-25-92  12:00a

PIM      HL$      8119 10-25-92  12:00a

SETUP    EXE     21472 10-25-92  12:00a

SETUP    INI       149 11-25-92  10:51a

SHARE    EX$      8112 10-09-92  10:02a

SHELL    DL$     23296 10-09-92  10:02a

SMALLB   FO$      9687 03-06-92   7:16p

SMALLE   FO$     11236 03-06-92   7:16p

SMALLF   FO$      9376 03-06-92   7:16p

STFSETUP EX_    477376 10-25-92  12:00a

STFSETUP IN_     56427 10-25-92  12:00a

VER      DL$      5653 10-09-92  10:02a

VER      DL_      9008 10-25-92  12:00a

WORKGRP  IN_      1393 10-25-92  12:00a

       31 file(s)    1413998 bytes

Disk 2

------

Volume Label: DISK2

2        WMF      8022 10-25-92  12:00a

2E       WMF      6870 10-25-92  12:00a

MSACCESS HL$   1189376 10-25-92  12:00a

PDXISAM  DL$    106830 10-25-92  12:00a

REGEDIT  EX$     18176 10-09-92  10:02a

WBTRCALL DL$     30679 10-25-92  12:00a

        6 file(s)    1359953 bytes

Disk 3

------

Volume Label: DISK3

3        WMF      8950 10-25-92  12:00a

3E       WMF      8470 10-25-92  12:00a

MSABC100 DL$    187802 10-25-92  12:00a

MSAES100 DL$     16899 10-25-92  12:00a

MSAFIN   DL$     18553 10-25-92  12:00a

WIZARD   MD$    174297 10-25-92  12:00a

MSACCESS EX$    790199 10-25-92  12:00a

        7 file(s)    1205170 bytes

Disk 4

------

Volume Label: DISK4

4        WMF      8246 10-25-92  12:00a

4E       WMF      7766 10-25-92  12:00a

ANALYZER MD$     49740 10-25-92  12:00a

MSAJT100 DL$    338672 10-25-92  12:00a

NEWCUST  DB$      1212 10-25-92  12:00a

NWIND    MD$    555226 10-25-92  12:00a

PIM      MD$    109267 10-25-92  12:00a

SYSTEM   MD$     98863 10-25-92  12:00a

UTILITY  MD$     47055 10-25-92  12:00a

WINHELP  EX$    147911 10-09-92  10:02a

WINHELP  HL$     28161 10-09-92  10:02a

       11 file(s)    1392119 bytes

Disk 5

------

Volume Label: DISK5

5        WMF      4662 10-25-92  12:00a

5E       WMF      4150 10-25-92  12:00a

CBTLIB4  DL$     11179 10-25-92  12:00a

CUECARD  EX$     60269 10-25-92  12:00a

CUECARDS DL$      2047 10-25-92  12:00a

CUECARDS LE$    887544 10-25-92  12:00a

GRAPH    EX$    364877 10-09-92  10:02a

MSGRAPH  HL$    110291 10-09-92  10:02a

        8 file(s)    1445019 bytes

Disk 6

------

Volume Label: DISK6

6        WMF      5846 10-25-92  12:00a

6E       WMF      5366 10-25-92  12:00a

MSACCES2 HL$   1133393 10-25-92  12:00a

PSSKB    TX$      7951 10-25-92  12:00a

README   TX$      9465 10-25-92  12:00a

ERRATA   TX$      9805 10-25-92  12:00a

        6 file(s)    1171826 bytes

ODBC Installation Disk

----------------------

Volume Label:  ODBC

DBNMP3   DLL      8241 10-22-92   3:06p

INSTCAT  SQL     93796 10-25-92  12:00a

MSCOMSTF DLL     74528 10-25-92  12:00a

MSDETSTF DLL     24544 10-25-92  12:00a

MSINSSTF DLL     65440 10-25-92  12:00a

MSSHLSTF DLL     14928 10-25-92  12:00a

MSUILSTF DLL      6144 10-25-92  12:00a

ODBC     DLL     44736 10-25-92  12:00a

ODBC     INF      1226 10-25-92  12:00a

ODBCADM  EXE      9136 10-25-92  12:00a

ODBCADM  HLP      4942 10-25-92  12:00a

ODBCINST DLL      6016 10-25-92  12:00a

SETUP    EXE     54464 10-25-92  12:00a

SETUPI   DLL     44032 10-25-92  12:00a

SQLSETUP DLL     11024 10-25-92  12:00a

SQLSRVR  DLL    135792 10-25-92  12:00a

VER      DLL      9008 10-22-92   3:06p

LANMAN21     <DIR>     10-25-92  12:00a

       18 file(s)     607997 bytes

Windows For Workgroups Driver Disk

----------------------------------

Volume Label: WFWDRV

WFWDRV   EXE     23581 11-02-92   3:11a

WFWNET   DR_    165600 11-02-92   3:11a

        2 file(s)     189181 bytes


INF: How to Retrieve Information from the Clipboard

 Article Number: Q94162

 CREATED: 29-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

There is no command in Microsoft Access to retrieve information from the

Clipboard. To retrieve information from the Clipboard, you need to define

an Access Basic function that calls several Windows API functions. This

article defines a function that retrieves text from the Clipboard.

MORE INFORMATION

Add the code defined below to an Access Basic module. Make sure that the

declare functions are all listed on one line and that the MsgBox procedure

is also defined on one line. Since you may have some of the Windows API

functions defined in an underlying library, some of them might not be

needed. If this is the case, remove or comment the declarations from your

code.

To call the function you can make a string assignment to the returned

value, such as:

   ReturnString$ = ClipBoard_GetData ()

Sample Code

-----------

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   Option Explicit

   Declare Function OpenClipBoard% Lib "User" (ByVal hwnd%)

   Declare Function GetClipboardData% Lib "User" (ByVal wFormat%)

   Declare Function GlobalAlloc% Lib "Kernel" (_

      ByVal wFlags%, ByVal dwBytes&)

   Declare Function GlobalLock& Lib "Kernel" (ByVal hMem%)

   Declare Function lstrcpy& Lib "Kernel" (_

      ByVal lpString1 As Any, ByVal lpString2 As Any)

   Declare Function GlobalUnlock% Lib "Kernel" (ByVal hMem%)

   Declare Function CloseClipBoard% Lib "User" ()

   Declare Function GlobalSize& Lib "Kernel" (ByVal hMem%)

   Global Const GHND = &H42

   Global Const CF_TEXT = 1

   Global Const MAXSIZE = 4096

   Function ClipBoard_GetData()

      Dim hClipMemory%

      Dim lpClipMemory&

      Dim MyString$

      Dim Junk&

      Dim X%

      If OpenClipBoard(0&) = 0 Then

         MsgBox "Could not open the Clipboard. Another _

            application could have it open"

         Exit Function

      End If

      '-------------------------------------------

      ' Obtain the handle to the global memory

      ' block that is referencing the text.

      '-------------------------------------------

      hClipMemory% = GetClipboardData(CF_TEXT)

      If IsNull(hClipMemory%) Then

         MsgBox "Could not allocate memory"

         GoTo OutOfHere

      End If

      '-------------------------------------------

      ' Lock Clipboard memory so we can reference

      ' the actual data string

      '-------------------------------------------

      lpClipMemory& = GlobalLock(hClipMemory)

      If Not IsNull(lpClipMemory&) Then

         MyString$ = Space$(MAXSIZE)

         Junk& = lstrcpy(MyString$, lpClipMemory)

         X% = GlobalUnlock(hClipMemory)

         'peel off the null terminating character

         MyString$ = Mid(MyString$, 1, InStr(MyString$, Chr$(0)) - 1)

      Else

         MsgBox "Could not lock memory to copy string from."

      End If

   OutOfHere:

      X% = CloseClipBoard()

      ClipBoard_GetData = MyString$

   End Function

REFERENCES

==========

"Programming Windows by Charles Petzold," Second Edition, pages 780-781

Additional reference words: 1.00 1.10 2.00 windows API checkpage


PRB: 'FastForward' Button Is Unavailable in Graph FormWizard

 Article Number: Q94174

 CREATED: 29-DEC-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SYMPTOMS

When you use the Graph FormWizard to create a form, the Fast Forward

button (>>|) is unavailable if you use the button labeled Back to

move back one or more screens.

STATUS

This problem does not occur in Microsoft Access version 1.1.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new form using the Graph FormWizard.

2. Proceed to the last Graph FormWizard screen. (This screen gives you

   the option to open or design your form.)

3. Choose the button labeled "Back" to go back any number of screens.

The "Fast Forward" button is now unavailable. This button should be

available to move you to the last screen of the Graph FormWizard.


PRB: Date/Time Formats Not Used In List or Combo Box Controls

 Article Number: Q94175

 CREATED: 29-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

A list or combo box based on a Date/Time field does not display the date

or time format assigned to the underlying field. This is particularly

noticeable in a list or combo box control on a form.

CAUSE

Microsoft Access does not have a Format property for list or combo boxes

even though the underlying table field has a defined Format property.

RESOLUTION

Use the Format() function in an expression in a query to format the data.

Then base the list or combo box on the query field instead of the

underlying table field.

For example, define a query named QueryTest. Then instead of entering

the name of the underlying Time/Date field (Event Date) as the field

on the QBE grid, enter this expression:

   Event Day: Format([event date],"mmmm d"", ""yyyy")

Base the list or combo box on this query field to display Event Date

with the desired format.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

----------------------------

1. Create a new table with the following fields:

      Field Name         Data Type

      ----------------------------

      Event ID           Counter

      Event Date         Date/Time

2. Set the Event Date field's Format property to "mmm d, yyy" (without

   quotation marks).

3. Save the table as Events. View the table in Datasheet view and enter

   "8/11/92" (without quotation marks) in the Event Date field. Add a

   few more records with any valid dates. Note that the dates are

   displayed correctly.

4. Create a new form based on the Events table. Add the following list

   box to the form:

      Object: List Box

      ----------------------------

      Control Name:    Event ID

      Control Source:  Event ID

      Row Source Type: Table/Query

      Row Source:      Events

      Column Count:    2

      Column Heads:    Yes

      Column Widths:   0;1

      Bound Column:    1

5. View the form in Form view. Note that the underlying field's Format

   property is ignored.

Additional reference words: 1.00 1.10 controls expressions


PRB: Form Objects Not Placed on Grid by Wizard

 Article Number: Q94176

 CREATED: 29-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you are using FormWizards, objects do not appear to be aligned to

the grid even though you have set Objects Snap To Grid to Yes.

CAUSE

FormWizards are designed to place objects on the form and position them

in the appropriate manner. The Objects Snap To Grid option is a feature

to help you place controls on forms. Since you are not positioning the

objects manually, there is no need for FormWizards to use the Objects

Snap To Grid feature.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Use the FormWizard to create a new Single-Column form based on the

   Employees table.

3. Place all the fields on the form.

4. Select Standard style.

5. Open the form in Design view. Note that objects on the form do not

   appear to be aligned with the grid.

Additional reference words: 1.00 1.10 wizards


PRB: Can't Create Two Relationships Between Same Tables

 Article Number: Q94189

 CREATED: 29-DEC-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If you create a second relationship between two tables that already have

a relationship, Microsoft Access will automatically remove the first

relationship between the two tables.

STATUS

This behavior is by design.

MORE INFORMATION

Steps To Reproduce Behavior

---------------------------

1. Create two tables that share a common field:

      Table: Table1

      ------------------------------

      Field Name: Test [Primary key]

      Date Type: Text

      Table: Table2

      ----------------

      Field Name: Test

      Date Type: Text

2. From the Edit Menu choose Relationships, and create a relationship

   between Table1 and Table2 on the Test field with the Enforce

   Referential Integrity check box selected. Choose Add.

3. Create another relationship between the two tables. Choose Add.

   Note that creating the second relationship removes the first.


PRB: Arrow Keys Inconsistent Between Forms and Datasheets

 Article Number: Q94190

 CREATED: 29-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you set ARROW key behavior to Next Field, pressing an ARROW key

at the end of a field in Datasheet view will move you to the next

field. However, in Form view, pressing an ARROW key at the end of a

control has no effect (that is, it will not move the focus to the

next control).

CAUSE

This behavior is by design.

MORE INFORMATION

You can set certain keyboard attributes, such as ARROW key behavior

(from the View menu choose Options, then select Keyboard). You can set

the ARROW key behavior to either Next Field or Next Character. When

set to Next Field, the ARROW key behavior will vary between Datasheet

view and Form view. The difference in behavior depends on the mode of

the Microsoft Access text editor.

If the editor is in "enter" mode (the entire field or control is

selected), pressing an ARROW key in either Datasheet view or Form

view moves you to the next field or control and remains in enter mode.

When you reach the last field or control, you will move to the next

record.

If the editor is in "edit" mode (text has been entered), pressing an

ARROW key at the end of a field in Datasheet view will move you to the

next field and return to enter mode. However, in Form view, pressing

an ARROW key at the end of a control has no effect. This behavior is

by design, and is meant to ensure that pressing an ARROW key on the

last control in edit mode does not move to the next record.

REFERENCES

==========

For more information on the text editor, query here in the Microsoft

Knowledge Base on the following key words:

   key and behavior and edit and box

Additional reference words: 1.00 1.10 2.00 arrow behavior next


PRB: Query Error Caused by Colon in Field Name

 Article Number: Q94191

 CREATED: 29-DEC-1992

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

A query results in one of the following error messages:

 - Query must have at least one output field

 - Can't set criteria unless you've specified a field

 - Syntax Error

CAUSE

One of the query's criteria includes a field name that ends with a

colon(:). For example, the fieldname "Field:" used as a criteria would

cause an error message.

RESOLUTION

Field names that include colons must be enclosed in brackets to be used

as criteria. For example, to use the field name "Field:" as a criteria,

you would enter it as "[Field:]" (without quotation marks).

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

In a query's Design view, you can rename a field to be more descriptive.

Place the insertion point in front of the first letter of the field name

in the QBE grid. Then type the new name followed by a colon. Do not

delete the underlying field name. Now, in Datasheet view, you will see

the descriptive label as the heading instead of the underlying field

name.

Using this technique to change a field name in a query's Design view

automatically changes the heading in the query's Datasheet view, and it

changes the field name in a form or report based on the query. But the

underlying field name in the table does not change.

The error messages shown above occur because without brackets around the

field name, Microsoft Access interprets the colon in the field name as a

request to add a label (rename) that field.

Steps to Reproduce Behavior

---------------------------

1. Create a new table named Test with one field named FullName:.

2. Save the table as Table1.

3. Create a query based on Table1.

4. Drag the field FullName: to the query grid.

5. Run or view the results of the query. You will receive an error

   message.

REFERENCES

==========

For more information on renaming fields in queries, search for "renaming

fields" then "Renaming a Field in a Query" using the Microsoft Access

Help menu.

Microsoft Access "User's Guide," version 1.0, Chapter 5, "Query Basics,"

page 96

Additional reference words: 1.00 1.10 errmsg


PRB: Incorrect Characters in Crosstab Query Column Headings

 Article Number: Q94192

 CREATED: 29-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If the data in a field used as a column heading in a crosstab query

contains a decimal, an exclamation mark, or a square bracket

character, this character will be changed to an underscore

character in the column heading. This does not happen if the same

data is used as a row heading.

CAUSE

Queries can be used as input to other queries, forms, or reports,

and therefore column headings must be formatted as field names.

Because field names cannot contain decimals (.), exclamation marks

(!), or square bracket characters ([ or ]), these characters are

converted to underscore characters in the column headings of the

crosstab query.

STATUS

This behavior is by design.

REFERENCES

==========

For more information on names, search for "naming conventions" then

"Standard Naming Conventions" using the Microsoft Access Help menu.

For more information on crosstabs, search for "crosstab queries" then

"Summarizing Data Using a Crosstab Query" using the Microsoft Access Help

menu.

Additional reference words: 1.00 1.10 2.00


INF: Attaching to FoxPro Data in Microsoft Access

 Article Number: Q94193

 CREATED: 29-DEC-1992

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

----------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

----------------------------------------------------------------------

SUMMARY

According to the marketing literature, Microsoft Access cannot attach

FoxPro data, but is able to import FoxPro data. There is an exception to

this rule, which allows a user to attach, rather than import, FoxPro

data.

MORE INFORMATION

FoxPro uses a DBF file structure, similar to the structure that dBASE

uses. However, Microsoft Access cannot attach most FoxPro files because

the memo and index structures are different. Consequently, you can attach

a FoxPro table as a dBASE IV table if it meets the following two

conditions:

 - The FoxPro table does not contain any memo fields

 - The FoxPro table is attached without any FoxPro index files

If either of these conditions is not met, then you must import the data

from the FoxPro table instead of attaching it.


INF: Importing DataEase Data Files

 Article Number: Q94194

 CREATED: 29-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access does not import DataEase data files directly, but you

can export your DataEase data to a formatted disk file that Microsoft

Access can import. The information is this article applies to DataEase

versions 4.2, 4.5, and 4.53. DataEase is a character-based relational

database system.

To export DataEase data from DataEase, create a DQL report, specify the

Format as export, and set the Print Style to print to a disk file. Select

one of the following export formats to create a file Microsoft Access can

import:

   Lotus           (creates a .WKS file)

   Variable Length (creates a delimited ASCII text file)

   Fixed Length    (creates a fixed-width ASCII text file)

MORE INFORMATION

Export Using DataEase

---------------------

To create a formatted disk file in DataEase 4.x, create a DQL report using

the following steps. For more detailed information about creating reports,

please refer to the DataEase documentation.

1. Define the report specifying the fields you want to include in the

   output.

2. Specify the report Format as Export by choosing either Define Format or

   Modify Format under either DQL Advanced Processing or Query by Example -

   Quick Reports.

   Select 7. Export under Define Format or Modify Format. You should see

   the following list of the export formats DataEase supports.

      * 1. Lotus (wks)

        2. GrafTalk

        3. MultiMate

        4. WordPerfect

        5. Mail-Merge

      * 6. Variable Length

      * 7. Fixed Length

        8. DIF

   Choose 1, 2, or 6. Depending on your choice, DataEase may ask you if you

   want to include field names in the exported file.

3. Specify the Print Style for the report. Enter the Report Destination as

   option #3 Disk to print to a disk file. Then enter a valid file name in

   the Filename field.

Import Using Microsoft Access

-----------------------------

1. Start Microsoft Access and open your database.

2. From the File menu, choose Import.

3. In the Data Source box, select the import format that matches the export

   format you chose in DataEase.

Choosing Export/Import Format

-----------------------------

Here are some things to consider when choosing an export/import format.

Microsoft Access can import Lotus (.WKS) files and create a table with

field names if you included the field names when exporting in DataEase.

During the import process, Microsoft Access asks you if the first row

contains field names. Most DataEase data types should convert to

appropriate Microsoft Access field types.

If you choose the Variable Length format when exporting, DataEase will ask

you to enter the field separator. Enter a comma (,). Microsoft Access

recognizes the comma as the default field separator.

If you choose the Fixed Length format when exporting in DataEase, you will

need to create an Import Specification file in Microsoft Access prior to

importing the file.

For additional information registered DataEase users can contact DataEase

International HotLine Support at 1-203-374-2825.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 4, "Importing,

Exporting, and Attaching," pages 72-81

Additional reference words: 1.00 1.10 2.00 checkpage


PRB: Unable to Paste Information into Property Sheet

 Article Number: Q94218

 CREATED: 30-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You are unable to paste information into a property sheet using the

Edit menu's Paste command. Instead, you keep creating a new label

control on your form or report.

CAUSE

You are using menu commands that do not apply to pop-up windows.

RESOLUTION

Use equivalent keyboard actions rather than selecting commands from

the Microsoft Access menu bar. In this case, use CTRL+V or SHIFT+INSERT to

paste information into a pop-up window.

STATUS

This behavior is by design.

MORE INFORMATION

Property sheets are actually pop-up windows. When you use menu commands,

Microsoft Access returns focus (from the pop-up window) to the parent

window. When you use equivalent keyboard actions, Microsoft Access retains

focus on the current edit control (in this case the property sheet).

Therefore, selecting the Paste command from the Edit menu will paste a new

label in the "parent" form or Report window.

Steps to Reproduce Behavior:

----------------------------

1. In the sample database NWIND.MDB, create a form based on the Orders

   table.

2. In this form, create a combo box bound to the Customer ID field.

3. Go to the Customer List query, and copy the SQL statement to the

   Clipboard.

4. Return to the form and select the RowSource property for the combo

   box.

5. Try to paste the SQL code into the RowSource property.

If you use CTRL+V or SHIFT+INSERT, Microsoft Access pastes the

information from the Clipboard into the property sheet. If you choose

Paste from the Edit menu, Microsoft Access creates a new label on the

form.

REFERENCES

==========

For more information, search for "pop-up forms" then "keyboard: editing

keys" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


PRB: GP Fault Using an Out of Date ODBC Driver

 Article Number: Q94219

 CREATED: 30-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Microsoft Access displays the following error message when

using an out of date ODBC.DLL driver:

   General Protection Fault (GPF) in ODBC.DLL

CAUSE

When Microsoft Access initiates an ODBC connection, ODBC does not check

the version of the ODBC driver. The ODBC Setup program will only replace

an older version of the ODBC.DLL with a newer version if the file

resides in the \WINDOWS\SYSTEM subdirectory. If the file is found

elsewhere, ODBC Setup places a copy of ODBC.DLL in the \WINDOWS\SYSTEM

subdirectory. This can cause a problem if the directory that contains

the older .DLL is in the path, and is found first.

RESOLUTION

Rename or delete the old ODBC.DLL and run the ODBC Setup program

from the Setup disks that come with Microsoft Access. This will

install a correct version of ODBC.DLL.

Additional reference words: 1.00 1.10 2.00 UAE unrecoverable application


PRB: Back Button Disabled After Selecting Wizard Type

 Article Number: Q94220

 CREATED: 30-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The Back button is unavailable in a FormWizard or ReportWizard after you

select the type of wizard (Single-Column, Tabular, Graph, and so on) to

use. This means that you cannot go back and select a different type of

wizard to use. If you want to use a different wizard, you must choose

Cancel and start over.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10 wizards


INF: Microsoft Access Table Structure Is Variable Length

 Article Number: Q94221

 CREATED: 30-DEC-1992

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access will set the field length of a text field to the

length of the entered text if the text entered is shorter than the

maximum field size.

MORE INFORMATION

When you set Field Size in the Field Properties of a table in design

mode, you are setting the maximum length for the field. If text

entered into that field is shorter than the specified maximum length,

then the length of that field equals the length of the text that has

been entered. This means whether you design a text column as 20

characters or 255 characters, it will only take up the amount needed

to store the field. The difference between the two is that one is

limited to 20 characters on entry while the other will allow up to 255

characters.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, page 38

Additional reference words: 1.00 1.10 2.00 checkpage


PRA: Selecting Options in Find Dialog Box

 Article Number: Q94222

 CREATED: 30-DEC-1992

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

There are three known problems with the Find dialog box. To see the Find

dialog box, choose Find from the Edit menu.

1. The check boxes for Match Case and Search Fields As Formatted

   work correctly when selected with a mouse, but mistakenly allow

   both boxes to be selected when using the plus (+) and minus (-) keys

   to select or clear the check boxes.

2. There is a slight painting problem when you select the All Fields

   option button under Search In. The default value is false for the

   Match Case and Search Fields as Formatted check boxes, but after

   you select the All Fields option button, Microsoft Access dims the

   Search Fields as Formatted check box caption and selects it.

3. After experiencing the painting problem and seeing the dimmed X in

   the Search Fields as Formatted check box, if you again select

   Current Field under Search In, Microsoft Access incorrectly selects

   the Search Fields as Formatted check box. This occurs whether you use

   the mouse or the keyboard to select Current Field.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

versions 1.0, 1.1, and 2.0. We are researching this problem and will post

new information here in the Microsoft Knowledge Base as it becomes

available.

Additional reference words: 1.00 1.10 2.00


PRB: Pressing ENTER with Database Window Minimized Opens a Doc

 Article Number: Q94390

 CREATED: 06-JAN-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If no documents are open and you have the Database window minimized

when you press ENTER, the object selected in the Database window

will open. However, if there is an open object (minimized or not),

nothing happens when you press ENTER on the Database window icon.

RESOLUTION

To restore the Database window, do one of the following:

 - Double-click the icon with the mouse.

 - Press ALT+minus sign (-) to access the Control menu, then press

   ENTER.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10


PRB: Cannot Use "y," "n," "t," or "f" in Yes/No Field

 Article Number: Q94391

 CREATED: 06-JAN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You receive the following error message when you type the letter "y"

or "n" into your field:

   The value you entered isn't appropriate for this field

CAUSE

You are not typing the entire word into a Yes/No boolean field, a

True/False field, or an On/Off field.

RESOLUTION

Type the entire word "yes" or "no" instead of the abbreviation "y" or "n"

in a field defined with a Yes/No data type. The capitalization does not

make a difference.

Additional reference words: 1.00 1.10 2.00 errmsg


PRB: Border Properties Ignored with Special Effect

 Article Number: Q94392

 CREATED: 06-JAN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The following properties are ignored when you set the SpecialEffects

property to Sunken or Raised:

   BorderColor

   BorderWidth

   BorderStyle

STATUS

This is behavior by design.

Additional reference words: 1.00 1.10 2.00


PRB: "Welcome to Microsoft Access" Screen Disables Status Bar

 Article Number: Q94393

 CREATED: 06-JAN-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you start Microsoft Access with the "Welcome to Microsoft

Access" screen, the status bar will not show whether the CAPS LOCK

and NUM LOCK keys are on or off.

RESOLUTION

If you turn off the "Welcome to Microsoft Access" screen, the

status bar functions normally. Another workaround is to close the

screen, then switch the NUM LOCK and CAP LOCK keys off then on.

This will reinitialize the status bar.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Turn on the CAPS LOCK and NUM LOCK keys.

2. Start Microsoft Access with the "Welcome to Microsoft Access"

   screen enabled.

Note that the status bar does not show whether the CAPS LOCK and NUM

LOCK keys are on.

Additional reference words: 1.00 1.10


PRB: Control Menu Move Command Requires Keyboard Input

 Article Number: Q94394

 CREATED: 06-JAN-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

After choosing the Move command from the Control menu of any non-standard

window, you are unable to change the window's location with the mouse.

CAUSE

The Palette and Toolbox windows in Microsoft Access are non-standard

windows. Like other windows, you can move these windows by dragging the

title bar of the window to the new location. But unlike other windows,

dragging the title bar will have no effect if you choose the Move command

from the window's Control menu.

RESOLUTION

After choosing the Move command from the Control menu of any non-

standard window, use the ARROW keys on the keyboard to move the window.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Using the mouse, drag the title bar of the Database window to a new

   location on your screen. You will have successfully moved the window.

3. Press ALT+MINUS SIGN (-) to open the Database window's Control menu.

4. Choose Move.

5. Repeat step 2. Note that you can still move the window with the

   mouse.

6. Open the Categories form in Design view. If the Palette window is

   not visible, choose Palette from the View menu.

7. Select the Palette window. Press ALT+MINUS SIGN (-) to open the

   Palette window's Control menu. Choose Move.

8. Using the mouse, drag the title bar of the Palette window to a new

   location on your screen. Note that the window does not move.


INF: How to Show Field in Datasheet View But Not Form View

 Article Number: Q94396

 CREATED: 06-JAN-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

In Microsoft Access version 1.x, no command exists to display a control in

Datasheet view that is invisible in Form view. By changing the color

characteristics and the size, you can create a control that will seem

invisible in Form view yet be visible in Datasheet view.

MORE INFORMATION

Microsoft Access 1.x

--------------------

To create a control that is visible in Datasheet view and invisible

in Form view, you need to set the following properties of the control:

   BorderStyle: Clear

   Width: 0

   Height: 0

You will also have to remove the caption box if one exists with the

control.

NOTE: The drawback of this method is that, although you cannot see the

control, the control still has a tab order.  Because of this, a user

can have the focus set to the control immediately before the invisible

control and press TAB. The focus will move to the control, yet the

user will not see anything, making it look as though the cursor has

disappeared. Pressing TAB again or setting focus to another control

with the mouse will cause the cursor to reappear.

Microsoft Access 2.0

--------------------

If a control's Visible property is set to No, the control will be visible

in Datasheet view, but invisible in Form view. You do not need to do

anything special to see the field in Datasheet view.

Additional reference words: 1.00 1.10 2.00


INF: Adding a Dynamic Counter to a Query to Count Records

 Article Number: Q94397

 CREATED: 06-JAN-1993

 MODIFIED: 08-DEC-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

You can identify the position of a record by using a dynamic counter

value in a query field. Microsoft Access does not have a built in

feature for adding a dynamic counter to a query or form. This article

provides an example of Access Basic code that can implement a dynamic

counter.

Please note the following limitations to this article:

 - You must reset the global counter to 0 before running the query

   each time. You can use the function SetToZero() to do this.

 - Any scrolling, minimizing and maximizing, switching focus away and

   back, etc. causes a repaint to occur, which in turn causes the query

   to call the function again.

 - You cannot place criteria on the counter expression; the function

   will be called twice per record.

 - Do not place the counter expression in the first column of the

   query; the number will be off by one.

 - Do not sort the query; if you sort the query, the counter is no longer

   in sorted order. To sort the query, base the query on another query that

   presorts the data.

MORE INFORMATION

There are two steps to the process:

1. Create a user-defined function named QCntr() to increment the counter

   for each new record. Make the function look something like this:

      Declarations:

      Global Cntr

      Function QCntr(x) As Long

         Cntr = Cntr + 1

         QCntr = Cntr

      End Function

2. Create the following user-defined function named SetToZero to reset

   the Cntr value each time the query is run:

      Function SetToZero()

         Cntr = 0

      End Function

3. Call the function in the query field by putting QCntr() in an

   expression. Use the following as a guide on the Field line of the

   query grid:

      Field:      Expr: QCntr([FieldName])

   Here [FieldName] is any field from the underlying table or query.

   [FieldName] is passed to the function to force evaluation of the

   function for every record in the query's dynaset. It doesn't matter

   which field you use as long as it has a valid field name.

4. Run the query from a macro with the following actions:

   Macro       Action

   ---------------------------------

   [Macroname] RunCode

               OpenQuery

   Macro Action Arguments

   ---------------------------------

   RunCode

      Function Name: SetToZero()

   OpenQuery

      Query Name: [Query Name]

      View: Datasheet

      Data Mode: Edit

Running the query from this macro resets the function QCntr to zero in

each iteration to provide accurate results.

REFERENCES

==========

For more information on when functions are executed in queries, query

on the following words here in the Microsoft Knowledge Base:

   custom and function and executes

Additional reference words: 1.00 1.10 counter rank top 10 custom


PRB: Unable to Import Portion of Fixed-Width Text Files

 Article Number: Q94417

 CREATED: 06-JAN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You cannot import any portion of a fixed-width text file.

CAUSE

Each record in a fixed-width text file must be separated from the next by a

carriage return and line feed, and all the records must contain the same

number of characters. The text file you are trying to import does not meet

these criteria.

RESOLUTION

Modify the text file to ensure that all records meet these requirements:

 - Each record is on a different line.

 - Each record contains the same number of characters.

STATUS

This behavior is by design.

MORE INFORMATION

Microsoft Access cannot import fixed-width text records that are not

delimited by a carriage return or line feed.

Mainframe users may be familiar with long strings of data where the first x

number of characters are the first record, the next x number of characters

are the second record, and so on. In order to import these records into

Microsoft Access, you must ensure that each record is on its own line with

a carriage return and line feed at the end of each record.

For example, consider the following string of characters:

   lastnamefirstnameagelastnamefirstnameagelastnamefirstnameage

You cannot import these records into Microsoft Access without modification.

If you try to import the above string as a fixed-width text file, you will

either create an empty table or you will be unsuccessful and may need to

repair your database.

To modify the file, use Access Basic and follow these steps:

1. Read in the file in Binary mode with a fixed-length string that is the

   same length as the record.

2. Write each string to a new file that is open for sequential output.

3. Repeat steps 1 and 2 until you reach the end of file.

Microsoft Access can import the following records:

   lastnamefirstnameage

   lastnamefirstnameage

   lastnamefirstnameage

To import a file containing records like these, follow these steps:

1. From the File menu, choose Imp/Exp Setup.

2. Change the Text Delimiter from " to {none}.

3. Enter the following settings for Field Information:

      Field Name   Data Type   Start   Width

      --------------------------------------

      Last         Text        1       8

      First        Text        9       9

      Age          Number      17      3

4. Choose OK, and save this specification as TEST.

5. From the File menu, choose Import.

6. Select Text (Fixed-Width), then choose OK.

7. Select the text file you want to import, then choose Import.

8. In the Import Text Options dialog box, select the TEST specification.

   Choose OK.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 4, "Importing,

Exporting, and Attaching," pages 75-81

Additional reference words: 1.00 1.10 2.00 checkpage


INF: Printing Microsoft Access Reports on HP Laserjet

 Article Number: Q94418

 CREATED: 06-JAN-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you print to a Hewlett-Packard Laserjet II, set the option Print

TrueType As Graphics in Print Setup. This is necessary because mixing

TrueType (TT) fonts and graphical objects on the HP Laserjet printer

can cause inconsistent results (that is, not true WYSIWYG). To set the

option, choose Print Setup from the File menu. Choose the Options

button. Then choose the box in the bottom left hand corner, Print True

Type as Graphics.

MORE INFORMATION

Before setting the Print Option, you might see the following problems when

printing Microsoft Access reports on a Hewlett-Packard Laserjet II:

 -  Microsoft Access displays white text on a black line in the report

    preview, but it prints a solid black line.

 -  Microsoft Access begins to print reports containing lines (graphics)

    with the text aligned correctly, but subsequently prints the line and

    then prints the text shifted to the far right.

REFERENCES

==========

For additional information, query on the following words here in the

Microsoft Knowledge Base:

   truetype and graphics and laserjet

Additional reference words: 1.00 1.10 2.00 PtrIss HPII


PRB: Exclusively Locked Error When Attaching to Btrieve Table

 Article Number: Q94419

 CREATED: 06-JAN-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SYMPTOMS

When attaching a Btrieve table, you get one of the following error messages

when you choose FILE.DDF:

   Table <tablename> is exclusively locked.

or

   Couldn't open file <filename>.

CAUSE

When attaching to a table, Microsoft Access needs to open the target

Btrieve table exclusively for a moment. If any other user has the target

table open at the same time Microsoft Access is attempting to attach to it,

you will see one of these error messages.

RESOLUTION

Find an available time when no other user is using the target Btrieve

table. Once Microsoft Access attaches to the Btrieve table successfully,

you will no longer receive the error messages.

STATUS

This problem does not occur in Microsoft Access version 1.1.


PRB: Error Message When Attaching Btrieve Table

 Article Number: Q94420

 CREATED: 06-JAN-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SYMPTOMS

When you try to attach a Btrieve table in Microsoft Access, you

receive the following error message:

   <tablename> is corrupted or isn't a Microsoft Access database.

CAUSE

When Microsoft Access attaches a Btrieve table, it compares

information in the Xtrieve dictionary file (FILE.DDF) with information

in the TBLNAME.DAT file. The most common reasons for the above error

message are differences in index information.

RESOLUTION

Redefine the Btrieve index so that it is exactly the same length as

the field it indexes.

STATUS

This problem does not occur in Microsoft Access version 1.1.

MORE INFORMATION

In the Btrieve file format, the length of the index may not match the

length of the field. This is a valid condition. The Xtrieve dictionary

file (FILE.DDF) ignores these indexes, but Microsoft Access interprets

them as invalid and returns the above error message.

You can correct this problem by turning the invalid indexes into valid

indexes. Use one of the following options to ensure that the length of

the index and the length of the field are identical:

 - Ask the vendor who created the Btrieve files to change the length

   of the index.

 - Use Btrieve or Xtrieve to redefine the index.

 - Use any third-party utility available to modify the Btrieve

   index.

The following four examples all require changes to the Btrieve index:

Example 1

---------

The TBLNAME.DAT file is defined with the following three columns:

    Column name   Field Length    Index Length

    ------------------------------------------

    Firstname     10              <= Combined length of

    Lastname      10              <= 20 characters

    Company       25

Index1 is defined with a length of 20 characters, the combined length of

the Firstname and Lastname fields.

Resolution: Redefine the Btrieve index into one multiple-segment

index, giving each segment a defined length of 10 characters.

Example 2

---------

The TBLNAME.DAT file is defined with the following three columns:

    Column name   Field Length    Index Length

    ------------------------------------------

    Firstname     10              4 characters

    Lastname      10

    Company       25

Index2 is defined with a length of four characters, shorter than the

defined length of the Firstname field.

Resolution: Redefine the Btrieve index on Firstname. Give it a

10-character length, matching the size of the Firstname field.

Example 3

---------

The TBLNAME.DAT file is defined with the following three columns:

    Column name   Field Length    Index Length

    ------------------------------------------

    Firstname     10              12 characters

    Lastname      10

    Company       25

Index3 is defined with a length of 12 characters, slightly longer than

the defined length of the Firstname field.

Resolution: Redefine the Btrieve index on Firstname. Give it a

10-character length, matching the size of the Firstname field.

Example 4

---------

The TBLNAME.DAT file is defined with the following two columns:

    Column name   Length

    --------------------

    Firstname -   10

    Lastname  -   10

    Company   -   25

Index4 is defined on a numeric byte range index. There is no index defined

on any field in the table.

Resolution: Remove the numeric byte range index completely, then

redefine the index on an existing field. Be sure that the length of

the index matches the length of the indexed field.

Btrieve and Xtrieve are manufactured by Novell, Inc., a vendor independent

of Microsoft; we make no warranty, implied or otherwise, regarding

these products' performance or reliability.


INF: System Objects Retain System Object Properties

 Article Number: Q94597

 CREATED: 11-JAN-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

A system object always retains the original system object attributes.

Operations performed on system objects such as Import, Rename, and

Copy preserve the flags in MSysObjects.

MORE INFORMATION

Operations such as Import, Rename, Copy, and Paste do not change the

flags in MSysObjects. In order to get a copy of a system table without

retaining the system settings, use a make-table query.

Steps to Reproduce Behavior

---------------------------

1. From the View menu, choose Options. Set the argument for Show

   System Objects to Yes.

2. In Micrososft Access version 2.0, import the MSysToolbars table from the

   SYSTEM.MDA. In Microsoft Access version 1.x, import the MSysAccounts

   table from the SYSTEM.MDA.

3. Rename the imported table to TableNew.

4. From the View menu, choose Options. Set the argument for Show

   System Objects to No.

The table TableNew disappears from the Database window because it has

the attributes of a system object.

REFERENCES

==========

For more information about system objects, search for "system objects"

using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 system


PRA: Incorrect Action Query Message Box Text

 Article Number: Q94598

 CREATED: 11-JAN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

-------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

An error message generated by an action query (that is, a delete,

make-table, update, or append query) may contain the following

incorrect message box text:

   Errors were encountered: The contents of fields in <number>

   record(s) were deleted, <number> record(s) were lost due to

   key violations and <number> record(s) were locked and couldn't

   be modified. Proceed anyway?

CAUSE

This problem is caused by the way Microsoft Access handles errors for

action queries. Microsoft Access uses the same error message for every

action query instead of using a separate error message for each type

of action query.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

The portion of the above error message that reports key violations:

   <number> record(s) were lost due to key violations

becomes active whenever referential integrity is violated during a query.

However, this specific information only applies to Append and Make Table

queries. If an update or delete query violates referential integrity, this

portion of the error message erroneously gives the impression that records

have been lost, when in fact they simply were not updated or deleted.

Steps to Reproduce Problem

--------------------------

1. Create the following two tables:

      Table: Table1

      ---------------------------

      FieldName: ID  [PrimaryKey]

         DataType: Text

      FieldName: Name

         DataType: Text

      Table: Table2

      -----------------

      FieldName: ID

         DataType: Text

      FieldName: Hobby

         DataType: Text

2. Create a one-to-many relationship between Table1 and Table2, with

   ID as the matching field. Enforce referential integrity rules.

3. Add two records to each table.

4. Create the following query based on Table1:

      Query: Query1

      -------------

      Field: ID

      Field: Name

5. Change Query1 from a select query to a delete query by choosing

   Delete from the Query menu.

6. Run Query1 by choosing Run from the Query menu.

7. Choose the OK button to delete the records.

The following error message is displayed:

   Errors were encountered: The contents of fields in 0 record(s) were

   deleted, 2 record(s) were lost due to key violations and 0 record(s)

   were locked and couldn't be modified. Proceed anyway?

This message correctly identifies that there were key violations

(because of referential integrity), but it incorrectly indicates the

loss of two records. In actuality, the records were not modified and

therefore not lost.

Additional reference words: 1.00 1.10 errmsg


INF: Placing the User Login Name on a Form or in the Title Bar

 Article Number: Q94599

 CREATED: 11-JAN-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article explains how to use the User() function in Microsoft Access

version 1.x, or the CurrentUser() function in Microsoft Access version 2.0,

to display the current user name in a control on a form or in the title bar

of the Microsoft Access window.

MORE INFORMATION

In Microsoft Access, you can implement security to control user access to

the different objects in your database. Then you can use the User() or

CurrentUser() function to display the current user's name.

How to Display User Name in a Control on a Form

-----------------------------------------------

Use the following procedure to display a user name in a control on a form:

1. Create a form and place an unbound text box control on the form.

2. For Microsoft Access version 1.x, type "=User()" (without quotation

   marks) in the text box ControlSource property.

   For Microsoft Access version 2.0, type "=CurrentUser()" (without

   quotation marks) in the text box ControlSource property.

3. Switch to Form view to see the current user name displayed in

   the control.

How to Display User Name in the Title Bar

-----------------------------------------

Use the following procedure to display a user name in the title bar of the

Microsoft Access window:

1. Create a new module.

2. Enter the following Access Basic code:

   NOTE: In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

   '=====================================================================

   'Declarations section of the module

   '=====================================================================

   Option Explicit

   Declare Function SendMessage& Lib "User" (_

                ByVal hw%, ByVal message%, ByVal wParam%, LParam As Any)

   Declare Function GetActiveWindow% Lib "User" ()

   Const WM_SETTEXT = &HC

   DIM stTitle$

   DIM x%

   '=====================================================================

   'The following function places the user name in the title bar.

   '=====================================================================

   Function SetDatabasewindowWindowTitle ()

   'USE ONLY ONE OF THE FOLLOWING TWO LINES OF CODE

   'DEPENDING ON YOUR VERSION OF MICROSOFT ACCESS

      stTitle$ = "User = " + User()          '>>>>>FOR VERSION 1.X

      stTitle$ = "User = " + CurrentUser()   '>>>>>FOR VERSION 2.0

      x% = SendMessage(GetActiveWindow(), WM_SETTEXT, 0, ByVal stTitle$)

   End Function

   '=====================================================================

   'End of code section

   '=====================================================================

3. From the Run menu, choose Compile All.

4. Save the module.

5. Create a new macro with the RunCode action, using the following

   as the action argument:

      SetDatabasewindowWindowTitle()

   Save the macro and name it ShowUser.

6. Run the ShowUser macro. You should see the Database window title bar

   change from "Microsoft Access" to "User = <username>".

REFERENCES

==========

For more information, search for either "User" then "User Function," or

"CurrentUser" then "CurrentUser Function" using the Microsoft Access Help

menu.

Additional reference words: 1.00 1.10 2.00


PRB: "Invalid Database Object" Error Message

 Article Number: Q94600

 CREATED: 11-JAN-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you are trying to use a database object (database, QueryDef,

table, dynaset, snapshot) within Access Basic, you may receive the

following error message:

   Invalid Database Object.

CAUSE

The problem occurs if you are within a transaction, you call

another function or procedure which dimensions the database, and

then leave the function or procedure which implicitly closes the

object that was opened within the transaction.

In this case Microsoft Access will try to close it and since it was

opened within a transaction, Microsoft Access will roll back all

levels of nested transactions.

If any other database objects were opened within the transaction,

rolling back has the effect of closing them. This means that any

references to an object opened within a transaction after another

object was forced to be implicitly closed will result in the "Invalid

database object" error message.

This problem will not occur if you always close database objects

before they go out of scope. The problem only occurs if you let

Microsoft Access implicitly close them.

RESOLUTION

 - You should always try to open database objects outside of

   transactions.

 - You should always explicitly close database objects.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

Open the sample database NWIND.MDB and enter the following code fragment in

a module to illustrate the problem:

   Function One ()

      Dim MyDB As Database, MyTable As Table

      Set MyDB = CurrentDB()

      BeginTrans

         Set MyTable = MyDB.OpenTable("Employees")

         X = Two()

         Debug.Print MyTable.RecordCount '"Invalid database object."

         MyTable.Close

      CommitTrans

      MyDB.Close

   End Function

   Function Two ()

      Dim MyDB2 As Database

      Set MyDB2 = CurrentDB()

   End Function

MyDB loses scope, implicitly rolls back and closes MyDB with the

effect of also closing MyDB in the One() function.

To circumvent the problem, change the procedure Two to:

   Function Two()

      Dim MyDB2 as Database

      Set MyDB2 = CurrentDB()

      MyDB2.Close

   End Sub

Additional reference words: 1.00 1.10 errmsg


PRB: GraphWizard Does Not Run or "Syntax Error" Is Displayed

 Article Number: Q94601

 CREATED: 11-JAN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If you choose the Graph icon from the toolbox, the GraphWizard does

not run, or the following error message is displayed:

   Syntax Error

CAUSE

This error is caused by an incorrect List Separator entry in the

[International] section of your WIN.INI file.

RESOLUTION

In Control Panel, select the International icon. In the List

Separator box, enter the default value, a comma (,). Microsoft

Graph should now run correctly. Note that different List Separator

entries will cause different results.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. In Control Panel, select the International icon.

2. Change the List Separator to something other than a comma.

   Different settings will cause different results. For example, a

   minus sign (-) will not open Graph or give an error message. A

   space will generate a "Syntax Error" message.

3. In Microsoft Access, create a new form.

4. Choose the Graph icon from the toolbox.

5. Select an area on your form and click the mouse to insert the

   graph. The border will briefly appear, but then disappear without

   opening the GraphWizard, or the "Syntax Error" message will be

   displayed.

Additional reference words: 1.00 1.10 wizards graph chart errmsg


INF: Use Append Query to Set Initial Value of Counter Field

 Article Number: Q94821

 CREATED: 19-JAN-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

You can change the starting value of a Counter field to a number other

than 1 by using an append query.

MORE INFORMATION

By design, Microsoft Access always numbers Counter fields beginning

with the number 1. You cannot edit a Counter field or change its

starting value.

However, you can force Microsoft Access to number a Counter field with

a number you choose by doing the following:

1. Create a new table containing a single Number field. Set FieldSize

   to Long Integer.

2. Give the new Number field a name identical to the name of the

   Counter field in your original table.

3. Use an append query to join this new record to your original table.

   This action forces Microsoft Access to number any new Counter

   fields with your number + 1.

For the expanded procedure, see the "How to Renumber the Counter

Field" section below.

Your original table has the following properties:

   Table: Receiving

   ---------------------

   FieldName: ID Number

      Data Type: Counter

   FieldName: Name

      Date Type: Text

How to Renumber the Counter Field

---------------------------------

1. Create a new table with the following structure and save it as

   Sending:

      Table: Sending

      -----------------------

      FieldName: ID Number

      Data Type: Number

      FieldSize: Long Integer

2. Open the Sending table in Datasheet view. Add a new record by

   inserting a value in the Number field. The value you enter must be

   1 less than the starting value you want for the Counter field in

   your original table. For example, if you want the Counter value in

   your original table to start at 100, enter 99 in the Number field.

3. Create a new append query to append the single record from the new

   table (Sending) to your original table (Receiving). To do this,

   choose Query, then choose New and select the Sending table. Save

   the query as AppendCounter.

4. From the Query menu, choose Append. Select Receiving from the

   Append To Table Name combo box, then choose OK.

   At this point, you have instructed Microsoft Access to append (or

   join) a field (or fields) from the Sending table to the Receiving

   table. Now you need to tell Microsoft Access which field or fields

   to append.

5. Append the ID Number field from the Sending table to the Receiving

   table either by selecting ID Number from the Field combo box in the

   query grid or by dragging the ID Number field from the Sending

   table to the query grid.

   Because Microsoft Access recognizes that the two fields in Sending

   and Receiving have identical names, it automatically places ID

   Number in the Append To field of the query grid, as follows:

      Query: AppendCounter

      --------------------

      FieldName: ID Number

      AppendTo: ID Number

6. Run the query by choosing the exclamation point (!) button on the

   toolbar. The following message is displayed:

      1 Row(s) will be appended.

   Choose OK to append the record to the Receiving table.

7. Delete the Sending table, then delete the newly appended row from

   the Receiving table.

   You are now ready to add a new record to your original table. The

   Counter will start at the number you have chosen.

   NOTE: Do not compact the database before adding a new record to the

   original table. If you do, Microsoft Access will reset the Counter

   value to the number 1.

REFERENCES

==========

For more information on append action queries and Counter fields,

search on the following words here in the Microsoft Knowledge Base:

   counter and append

For more information on customizing Counter fields, search on the

following words here in the Microsoft Knowledge Base:

   counter and custom

Microsoft Access "User's Guide," version 1.0, page 174

Additional reference words: 1.00 1.10 2.00 appending starting initial


INF: How to Install the Database Analyzer on the Help Menu

 Article Number: Q94822

 CREATED: 19-JAN-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

To add the Database Analyzer to the Help menu, add the following lines

the MSACCESS.INI file in the Windows directory:

   [Menu Add-ins]

   &Database Analyzer==StartAnalyzer()

   [Libraries]

   Analyzer.MDA=

Restart Microsoft Access. Database Analyzer will appear on the Help menu.

When you choose Database Analyzer from the Help menu, the Database

Analyzer will start.

REFERENCES

==========

For more information on adding other items to the Help menu, query on the

following words here in the Microsoft Knowledge Base:

   msaccess.ini and menu

For more inforation on the Database Analyzer, see the file PSSKB.TXT that

ships with Microsoft Access version 1.0, or see the file ANALYZER.TXT

that ships with Microsoft Access version 1.1.


INF: Error Messages May Be Caused by International Setting

 Article Number: Q94825

 CREATED: 19-JAN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

An attempt to enter an expression that requires a list separator

in the QBE grid field or criteria cells, or as the ControlSource

for a text box in a form or report, fails and Microsoft Access

generates the following message:

   Syntax error

An attempt to enter an expression that requires a list separator

in an action argument for a macro action fails and Microsoft

Access generates the following message:

   Can't parse expression: '<Expression that was entered>'

CAUSE

These errors can be caused by an incorrect setting for the "slist"

parameter in the [intl] section of your WIN.INI file. This setting

specifies the character used to separate items in a list. In United

States English, the most common list separator is a comma (,).

RESOLUTION

There are three methods to address this situation, as follows:

 - Use the Microsoft Windows Control Panel to modify the list

   separator in your WIN.INI file. Choose International from the

   Settings menu. Specify the correct separator in the List

   Separator field.

 - Use a text editor to modify the list separator in your WIN.INI

   file.

 - Modify the expression to use the list character specified in

   your WIN.INI file.

MORE INFORMATION

When this error occurs, the WIN.INI file might appear as follows:

   [intl]

   slist=;

The default United States English settings are as follows:

   [intl]

   slist=,

Additional reference words: 1.00 1.10 2.00 errmsg


PRA: Wrong RowSourceType for Combo Box Causes GP Fault

 Article Number: Q94826

 CREATED: 19-JAN-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

If you set the RowSourceType for a combo box or list box to

an invalid

value, when you switch from Form Design view to Form Browse

view, a

general protection (GP) fault may occur.

CAUSE

Valid values for the RowSourceType property are Table/Query,

Value

List, and Field List. If RowSourceType is set to

Table/Query, an SQL

SELECT statement is a valid value for the RowSource

property.

If a SQL statement is incorrectly entered into

RowSourceType, a GP

fault may occur. This problem may also occur if the

RowSourceType

information includes random characters.

RESOLUTION

Be sure that RowSouceType is set to a valid value:

Table/Query, Value

List, or Field List.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0. This problem no longer occurs in Microsoft

Access

version 1.1.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. In the sample database NWIND.MDB, create a new, unbound

blank form,

   and place a combo box on the form.

2. If RowSourceType is set to

      Select [employee id] from employees;

   when you switch from Form Design view to Form Browse

view, a dialog

   box with the following text is displayed:

      'select [employee id] from employees;' isn't a valid

setting for

       RowSourceType property.

   Choosing OK at this point would switch you to Form Browse

view. (If

   you are using a list box, #Error is displayed in the list

box.)

3. If the WHERE clause [employee id] = 7 is added to the SQL

statement

   in RowSourceType, the result is the same.

   If the WHERE clause is changed to [employee id] =

forms!form10!xx,

   a GP fault occurs, and the following message is

displayed:

      Application Error  MSACCESS caused a General

Protection

      Fault in module MSACCESS.EXE at 009A:09F6.

   Note: xx, as referred to in the WHERE clause, is not a

control on

   the form.

REFERENCES


INF: Definitions for Settings in WIN.INI Btrieve Section

 Article Number: Q94827

 CREATED: 19-JAN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access uses the Btrieve section of the WIN.INI file when it

uses Btrieve files. After you install Microsoft Access, the WIN.INI file

contains the following default settings in the [btrieve] section:

   [btrieve]

   options=/m:64 /p:4096 /b:16 /f:20 /l:40 /n:12 /t:C:\ACCESS\BTRIEVE.TRN

MORE INFORMATION

Although these are the recommended option settings, you can change

these options in your WIN.INI file using the following table as a

guide. If the option you want to set is not on the line, add the

option and desired setting at the end of the line.

Option   Description                 Required Value

----------------------------------------------------------------------

/m       Memory Size                 At least 38

/p       Page Size                   4096

/b       Pre-Image Buffer Size       16

/f       Open Files                  At least 4

/l       Multiple Locks              At least double the setting for

                                     the Open Files option (/f)

/n       Files in a Transaction      At least 4

/t       Transaction Filename        Valid path to a .TRN file;

                                     in a multiuser environment, the

                                     network path to the .TRN file is

                                     shared by all users

/u       Compression Buffer Size     If your Btrieve data files are

                                     compressed, at least the length

                                     (in kilobytes) of the longest

                                     record in your data files

/i       Pre-image File Drive

/c       Index Compaction

/a       Activate Logging

/s       Discard Unneeded Segments

REFERENCES

==========

For more information on these options, see Novell's Btrieve for Windows

"Installation and Operation" manual.

In Microsoft Access version 2.0, see the Readme Help file (ACREADME.HLP).

Additional reference words: 1.00 1.10 2.00 arguments


PRB: Empty Table List When Attaching Btrieve Table

 Article Number: Q94828

 CREATED: 19-JAN-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you attach a Btrieve table, you select the Xtrieve dictionary

file (FILE.DDF) in the Select File box. When you choose OK, Microsoft

Access opens the dictionary file and displays a list of tables you can

import or attach. However, the list is empty. In Microsoft Access version

2.0, you may receive the error message:

   Btrieve: Can't find file FIELD.DDF

CAUSE

You do not have the FIELD.DDF file that Microsoft Access requires to

attach a Btrieve table.

RESOLUTION

Microsoft Access requires the following three .DDF files in order to

attach a Btrieve table: FILE.DDF, INDEX.DDF, and FIELD.DDF. Make sure

that you have all three .DDF files before you try to attach a Btrieve

table.

MORE INFORMATION

When Microsoft Access cannot find the FIELD.DDF file, it creates a

6144-byte dummy FIELD.DDF file in the same directory in which FILE.DDF

appears. If you find this dummy file, you know that you are missing

the required FIELD.DDF file. Use Xtrieve or another third-party

utility to create the required .DDF files.

Btrieve and Xtrieve are manufactured by Novell, Inc., a vendor

independent of Microsoft; we make no warranty, implied or otherwise,

regarding these products' performance or reliability.

Additional reference words: 1.00 1.10 2.00 Xtrieve Btrieve index


PRB: Btrieve Files Created with Btrieve 6.0 NLM Not Supported

 Article Number: Q94829

 CREATED: 19-JAN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you attempt to attach to a Btrieve FILE.DDF file, the

following error message is displayed:

   Disk or Network error

RESOLUTION

This error message appears when you attempt to attach to a Btrieve file

created with the Btrieve 6.0 NLM version. Microsoft Access does not support

Btrieve files created with this networked version of Btrieve. Microsoft

Access only supports Btrieve files created with Btrieve 5.x.

Additional reference words: 1.00 1.10 2.00 xtrieve errmsg


INF: Creating Result Equivalent to SQL UNION Operator Result

 Article Number: Q94830

 CREATED: 19-JAN-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

The SQL UNION operator is not supported in Microsoft Access.

However,

you can obtain an equivalent result (a UNION product) by

using the

following two-step process to create two queries, a make-

table query

and an append query.

MORE INFORMATION

The product of a UNION includes all records from two related

tables--

those that match on the related key field and those that do

not match

on the related key field.

For example, say you have two tables, Table A and Table B.

Table A

contains the following fields and records:

   Key1    Field A

   ----------------

   1       Seattle

   2       Portland

   4       Chicago

Table B contains the following fields and records:

   Key2    Field B

   ------------------

   1       Washington

   3       Oregon

   5       Illinois

The UNION product of the two tables would look like this:

   Key     Field A     Field B

   -------------------------------

   1       Seattle      Washington

   2       Portland

   3                    Oregon

   4       Chicago

   5                    Illinois

Use the following two-step process to obtain a UNION product

in Microsoft

Access:

Step One: Collect the Records that Have a Matching Key Value

------------------------------------------------------------

1. Create a query, and add the two tables (Table A and Table

B) to the

   query grid.

2. Join the two tables by using the mouse to connect Key1 in

Table A to

   Key2 in Table B.

3. Double-click the join line between the two tables to

bring up the Join

   Properties dialog box. Select the second option, "Include

ALL records

   from 'Table A' and only those records from 'Table B'

where the joined

   fields are equal."

4. Add three fields to the query grid: Key1 from Table A,

Field A from

   Table A, and Field B from Table B. You can use the mouse

to drag these

   fields onto the query grid.

5. Choose Make Table... from the Query menu. The Query

Properties

   dialog box appears. The default selection is Current

Database under

   Make New Table. Enter an appropriate table name (for

example,

   UNION Result) for the result table, and choose the OK

button.

6. Run the query to create the new table (UNION Result). It

will contain

   the following fields and records:

      Key1       Field A      Field B

      ----------------------------------

      1          Seattle      Washington

      2          Portland

      4          Chicago

Step Two: Add the Rest of the Records to the Result

---------------------------------------------------

To complete the UNION, you need to add the records in Table

B that do not

have a matching key field value in Table A.

1. Create another new query. Add two tables (Table B and

UNION Result) to

   the query grid.

2. Join the two tables by using the mouse to connect Key2 in

Table B to

   Key1 in the UNION Result table.

3. Double-click the join line between the two tables to

bring up the Join

   Properties dialog box. Select the second option, "Include

ALL records

   from 'Table B' and only those records from 'UNION Result'

where the

   joined fields are equal."

4. Add three fields to the query grid: Key2 from Table B,

Field B from

   Table B, and Key1 from UNION Result. You can use the

mouse to drag

   the fields onto the query grid. You do not need Field A

from UNION

   Result because UNION Result already contains all the rows

from Table A.

5. Choose Append... from the Query menu. The Query

Properties dialog box

   appears. Ensure that UNION Result is in the Table Name

field under

   Append To. Then choose the OK button.

6. Verify that the query grid how has a line labeled Append

To. Choose

   Table Names from the View menu to show table names on the

query grid.

   Now the query grid should look something like this:

          Field:   Key2       Field B      Key1

          Table:   Table B    Table B      UNION Result

           Sort:

      Append To:   Key1       Field B

       Criteria:                           Is Null

   Note that the Key1 field from the UNION Result table is

not appended

   to anything and it has an Is Null restriction on it. This

ensures that

   no records from UNION Result are duplicated and appended

to it when you

   run the append query.

7. Run the append query. The UNION Result table looks like

this:

      Key1    Field A         Field B

      ----------------------------------

      1       Seattle         Washington

      2       Portland

      3                       Oregon

      4       Chicago

      5                       Illinois

   As you can see, record 1 has a match on the joined

fields, but all the

   other records are represented only once. This is the

correct UNION

   product. If the Key1 values in UNION Result are not in

ascending order,

   it is because there is no primary key on that column.

Additional reference words: 1.00 1.10 action SQL relational


PRB: Cannot Process Close Action in Report's OnOpen Property

 Article Number: Q94926

 CREATED: 25-JAN-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You receive the following error message when you attempt to process a

Close action in a macro that is assigned to a report's OnOpen property:

   Can't run this action while processing a report event (in Microsoft

   Access version 1.x)

   -or-

   Can't run this action while processing a form or report event (in

   Microsoft Access version 2.0)

RESOLUTION

Do not use a Close action in a macro that is assigned to a report's OnOpen

property.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create the following new macro called CloseForm:

      Macro Name   Action

      -------------------

      CloseForm    Beep

                   Close

      CloseForm Actions

      ---------------------

      Close

         Object Type: Form

         Object Name: Form1

2. Create the following new macro called CloseReport:

      Macro Name    Action

      --------------------

      CloseReport   Beep

                    Close

      CloseReport Actions

      -----------------------

      Close

         Object Type: Report

         Object Name: Report1

3. Create a new form. Assign the CloseForm macro to the form's OnOpen

   property. Save the form as Form1.

4. View the form in Form view.

5. Create a new report. Assign the CloseReport macro to the report's

   OnOpen property. Save the report as Report1.

6. Preview the report. Your computer will beep and you will receive one of

   the error messages stated above. Note that you did not receive an error

   message in step 4, when you opened the form.

Additional reference words: 1.00 1.10 2.00


INF: How to Convert Twips to Pixels

 Article Number: Q94927

 CREATED: 25-JAN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Because Microsoft Access stores dimension/location properties as twips, it

may be necessary to convert to pixels in certain cases, such as when

calling a Windows API function. This article describes how to do this.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

The ConvertTwipsToPixels() function below can be used to convert twips

to pixels. Note that pixels are not always square (the height and

width are not the same), so it is necessary to pass in the desired

"direction" to use (horizontal or vertical).

To add this function to your application, do the following:

1. Create a new module and enter the following Windows API declarations

   and constants into the Declarations section:

   NOTE: In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

      Option Explicit

      Declare Function GetDC% Lib "User" (ByVal hw%)

      Declare Function ReleaseDC% Lib "User" (ByVal hw%, ByVal hDC%)

      Declare Function GetDeviceCaps% Lib "GDI" (ByVal hDC%, _

                                                 ByVal iCapability%)

      Const WU_LOGPIXELSX = 88

      Const WU_LOGPIXELSY = 90

2. Add the following function:

      Function ConvertTwipsToPixels (nTwips%, nDirection%) As Integer

         Dim hDC%                        'Handle to device

         Dim nPixelsPerInch%

         Const nTwipsPerInch = 1440

         hDC% = GetDC(0)

         If (nDirection% = 0) Then       'Horizontal

            nPixelsPerInch% = GetDeviceCaps(hDC%, WU_LOGPIXELSX)

         Else                            'Vertical

            nPixelsPerInch% = GetDeviceCaps(hDC%, WU_LOGPIXELSY)

         End If

         hDC% = ReleaseDC(0, hDC%)

         ConvertTwipsToPixels = (nTwips% / nTwipsPerInch%) * nPixelsPerInch

      End Function

3. To call this function, pass the number of twips you want to convert,

   and another parameter indicating whether the horizontal or vertical

   measurement (0 for horizontal, non-zero for vertical). The following

   is a sample call:

      OldTwips = 2377

      NewPixels = ConvertTwipsToPixels(OldTwips, 0)

Additional reference words: 1.00 1.10 2.00


PRB: "Not Enough Memory to Run SETUP.EXE" Error Message

 Article Number: Q94928

 CREATED: 25-JAN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

An attempt to run the Microsoft Access Setup program fails and

Setup displays one of the following out-of-memory error messages:

   Insufficient Memory

    -or-

   Not enough memory to run SETUP.EXE

When this error occurs, sufficient space is available on the disk

you are installing Microsoft Access to and your AUTOEXEC.BAT file

contains a valid SET TEMP statement that specifies a directory that

has free disk space.

CAUSE

One cause of this error relates to an incorrect CMOS setting for

the floppy disk drive from which Microsoft Access is installed.

RESOLUTION

Modify the CMOS setting to correctly configure the disk drive. If

you need assistance to change the settings appropriately, contact

your dealer or hardware manufacturer.

MORE INFORMATION

The error messages above can occur when you install Microsoft Access

from a 1.2 MB disk drive and the CMOS setting for that drive indicates

that it is a 360 KB disk drive.

Additional reference words: 1.00 1.10 2.00 errmsg


INF: Exporting Queries to ASCII

 Article Number: Q94929

 CREATED: 25-JAN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access does not have a documented feature to export the

results of a query to ASCII text files. However, this feature is

available through the use of the TransferText macro action.

MORE INFORMATION

The TransferText macro action does not specify the use of query names

in the TableName parameter of the action. The parameter does not use a

combo box for table name choices, so the user is not limited to using

table names. By using the name of a query in the TableName parameter

of a TransferText action, the results of a query can be exported to

text files. This feature is undocumented. For specific instructions on

using the TransferText macro action, search for TransferText using the

Help menu.

Additional reference words: 1.00 1.10 2.00


PRB: Apply Default Does Not Change Height or Width of Labels

 Article Number: Q95003

 CREATED: 28-JAN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

An existing label control's Height and Width property settings are

not affected when you select the control in the Form or Report window's

Design view and choose Apply Default from the Layout menu. Instead, the

size of the label adjusts to fit the text in that control.

STATUS

This behavior is by design. The default height and width only affects

the size of a box created for a new label. Labels that already contain

text are not affected.

MORE INFORMATION

When you are creating a new report or form or modifying an existing one,

you can change the default properties for any type of control. Default

properties are the ones that determine the general appearance and behavior

of a control.

To display the default properties for a particular control type in a form

or report, switch to Design view and display the toolbox and property

sheet. To display the toolbox, choose Toolbox from the View menu. To

display the property sheet, click the Properties button on the toolbar,

or choose Properties from the View menu. Select any tool in the toolbox

to see the default properties for that type of control.

Once you change the default properties for a particular control type, you

can choose Apply Default from the Layout menu to apply the new defaults to

existing controls of that type on a form or report. For most control types,

all properties listed in the default property box will be applied to the

selected control. However, for Label controls, the Width and Height

settings are not reset to match the defaults. Instead, the size of the

label adjusts to fit the existing text in that control.

Steps to Reproduce Behavior:

----------------------------

1. Create a new form.

2. Add a label to the form that says "Label 1."

3. Display the property sheet and the toolbox.

4. Select the label control on the toolbox.

5. Enter the following properties for the default label:

      Width: 1 in

      Height: 1 in

      BackColor: 255

6. Add another label to the form that says "Label 2".

7. Select the label that you created in step 2 and choose Apply Default

   from the Layout menu.

   The BackColor of Label 1 is set to Red, but the height and width do not

   change.

8. Select the label that you created in step 6 and choose Apply Default

   from the Layout menu.

   The height and width of Label 2 shrinks to fit the number of characters

   that you typed in.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 12, "Using Special

Design Effects on Forms and Reports," page 312, and Chapter 18, "Designing

Reports," page 430

For more information, search for "default properties" then "Changing

Default Property Settings for Controls" using the Microsoft Access Help

menu.

For more information, search for "label properties" then "Label Control

Properties" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


PRB: Referential Integrity Error Message with Shared Databases

 Article Number: Q95004

 CREATED: 28-JAN-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you share databases in Microsoft Access and try to update a

record that another user has already updated, your update fails and

Microsoft Access generates the following message:

   Data has changed; Operation stopped.

When you choose OK, Microsoft Access generates the following write-

conflict error message:

   This record has been changed by another user since you started

   editing it. If you save the record, you will overwrite the

   changes the other user made.

You can choose one of three option buttons:

 - Save Record

 - Copy To Clipboard

 - Drop Changes

Copying your changes to the Clipboard allows you to look at the values

the other user has entered and paste your own changes back into the

table. However, when you choose Paste, your attempt fails and

Microsoft Access generates the following referential integrity error

message:

   Can't delete or change record. Since related records exist in table

   "<Table Name>", referential integrity rules would be violated.

CAUSE

Your table is on the "one" side of a one-to-many relationship and

the Enforce Referential Integrity check box is selected. These

symptoms occur regardless of the field being edited.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open two instances of Microsoft Access. In each instance, open the

   sample database NWIND.MDB. Make sure that the database is not opened

   with exclusive access.

2. In each instance, open the Categories table.

3. In the first instance, change the Category Name field in the first

   record. Do not commit the change.

4. In the second instance, change the Category Name field in the first

   record. Commit the change by moving the indicator to a field in

   another record.

5. Restore the first instance and try to commit the change. Microsoft

   Access generates the first of the two error messages listed above.

   When the second error message appears, choose Copy To Clipboard.

6. Select the first record from the first instance of Microsoft

   Access. From the Edit menu, choose Paste.

7. Try to close the table. Microsoft Access generates the referential

   integrity error message listed above.

Additional reference words: 1.00 1.10 errmsg multiuser


PRB: Query Toolbar and Menus Are Not Updated Concurrently

 Article Number: Q95006

 CREATED: 28-JAN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you are viewing a query in Design view, the Datasheet View and Run

buttons on the toolbar remain unavailable until tables or queries are

added to the query. The Datasheet command on the View menu and the Run

command on the Query menu are made available as soon as any cell on the

query grid is modified (even if a table or query has not been added).

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new, unbound query. Note that the toolbar and menu items

   mentioned above are unavailable.

2. Select the first cell in the query grid, press SPACEBAR, and then

   press ENTER. Note that the menu items are now available. (The toolbar

   buttons are still unavailable.)

3. Add any table or query to the new query. Note that the toolbar buttons

   mentioned above become available.

Additional reference words: 1.00 1.10 grayed out greyed tool bar


INF: How to Reference Controls or Fields on a Subform

 Article Number: Q95007

 CREATED: 28-JAN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access enables a developer to create subform controls that

display embedded forms on a form or report or display embedded reports

on a report. You can reference a control or field that resides on a

subform by using the Form property of the parent form. This article

describes several techniques you can use to reference a control or

field that resides on a subform or nested subform.

MORE INFORMATION

In Microsoft Access, a parent form can have many subforms, but a top-level

parent form is limited to three levels of nesting for nested subforms.

To reference a control or field on the subform, use the Form property. For

more information on the Form property, search for "Form," then "Form,

Report Properties" using the Microsoft Access Help menu.

The following step-by-step example shows by example how to reference a

field or control on a subform or nested subform:

1. Create three tables giving them each two fields as shown below:

      Table: Main Table

      -----------------

      ID:     Counter

      Field1: Text

      Table: Sub Form Table

      ---------------------

      ID:     Counter

      Field2: Text

      Table: Nested SubForm Table

      ---------------------------

      ID:     Counter

      Field3: Text

2. Create three forms based on the three tables and set the form properties

   as shown below. Note that forms have RecordSources--these become

   ControlSources when you make each form a subform.

      Form: Nested Sub

      ----------------

      ControlSource: Nested Subfrom Table

      Field: ID

      Field: Field3

      Form: Sub

      ---------

      ControlSource: Sub Form Table

      Field: ID

      Field: Field2

      Control: Nested Sub

      Form: Main

      ----------

      ControlSource: Main Table

      Field: ID

      Field: Field1

      Control: Sub

3. Create a new module, and add the following code to it:

      Function DoIt ()

         Dim MyForm As Form

         Dim MySubForm As Form

         Dim MyControl As Control

         '===============================================================

         'SUBFORM - The next four examples show how to set the value of

         'Field2 on the Sub subform. This example shows four ways to

         'reference the control:

         '

         ' 1. Straight reference using the Forms object.

         ' 2. Setting the Forms object to a form variable.

         ' 3. Setting the subform to a form variable.

         ' 4. Setting the field on the subform to a control variable.

         '

         'NOTE: Each example below is based on the previous example.

         'Some require that the object on the right side of the

         'equation be already initialized. Although variables are

         'used, you can substitute this with the proper Forms object.

         'The example of nested forms uses the Forms object in all the

         'examples.

         '============================================================

         'straight reference

         '------------------

         Forms![Main]![Sub].Form!Field2 = "Hello"

         'referenced using form property

         '-----------------------------

         Set MyForm = Forms![Main]

         MyForm.[Sub].Form.Field2 = "Hello"

            'setting subform to a form object

            '--------------------------------

            Set MySubForm = MyForm.[Sub].Form

            MySubForm.Field2 = "Hello"

            'reference item on subform through control object

            '------------------------------------------------

            Set MyControl = MySubForm.Field2

            MyControl = "Hello"

            '============================================================

            'NESTED SUBFORM - The next four examples show the same ideas

            'as shown above but for nested subforms.

            '============================================================

            'straight reference

            '------------------

            Forms![Main]![Sub].Form![Nested Sub].Form!Field3 = "Hello"

            'referenced using form property

            '-----------------------------

            Set MyForm = Forms![Main]![Sub].Form

            MyForm.[Nested Sub].Form.Field3 = "Hello"

            'setting subform to a form object

            '--------------------------------

            Set MySubForm = Forms![Main]![Sub].Form.[Nested Sub].Form

            MySubForm.Field3 = "Hello"

            'reference item on subform through control object

            '------------------------------------------------

            Set MyControl =

               Forms![Main]![Sub].Form![Nested Sub].Form!Field3

            MyControl = "Hello"

         End Function

Additional reference words: 1.00 1.10 2.00


PRB: Troubleshooting Out of Memory Errors in Queries

 Article Number: Q95008

 CREATED: 28-JAN-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you run a query, you receive the following error message even though

your system has sufficient memory and system resources:

   Out of Memory

CAUSE

Microsoft Access allocates specific memory segments for compiling a query.

If your query requires more memory than is stored in the segment, you will

receive the error message stated above.

RESOLUTION

The following tips may help you to avoid an "Out of Memory" error message:

 - Reduce the number of columns in the table's design.

 - Reduce the size of the column names in the table's design.

 - Reduce the number of columns selected by the query.

 - Do not base a query on another query; run only a singe query at a time.

 - If a query that causes an "Out of Memory" error message includes another

   query, convert that query to a make-table query. Then, use the resultant

   table in the initial query, instead of the included query.

Additional reference words: 1.00 1.10 tshoot errmsg


PRB: Trailing Spaces Automatically Truncated During Data Entry

 Article Number: Q95009

 CREATED: 28-JAN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Form controls receiving input with one or more trailing spaces will ignore

the trailing space(s), so the data entered may not be valid as a means of

comparison. Also, variables in Access Basic that have been assigned a value

containing a space character at the end of the text string will

automatically be ignored when used in a conditional statement.

CAUSE

Microsoft Access automatically truncates (or strips) trailing spaces on

data you enter into form controls to prevent the creation of a record that

cannot be referenced because of accidental space character(s) being

appended to the end of the text.

RESOLUTION

Do not use text strings that contain trailing spaces. If trailing

spaces are necessary, insert your data in Datasheet view of the

form.

STATUS

This behavior is by design.

MORE INFORMATION

Although both "a" or "a " are acceptable input in the example below,

the data stored in the underlying table will always contain the value

"a". The space following the "a" is truncated.

Steps to Reproduce Behavior

---------------------------

In a form:

1. Open a database.

2. Create a form with a single text field.

3. Enter the following for the field's Validation Rule property:

      ="a "

4. View the form in Form view.

5. Enter "a" in the field (with no space at the end).

In Access Basic:

1. Open a database.

2. Open a new module and choose Immediate window from the View

   menu.

3. Enter this syntax in the Immediate window (press ENTER after

   each statement):

      ?"a"="a "

       -or-

      ?chr(97)=chr(97)+chr(32)

4. Either statement will return a non-zero number indicating the

   statement is true, which means the values are equal.

Additional reference words: 1.00 1.10 2.00 validation


PRB: Cannot Scroll Query Grid with ARROW Key or Mouse

 Article Number: Q95010

 CREATED: 28-JAN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you design a query and the Query Design window is sized so that the

right side of the query grid is cut off (that is, only part of the

right-most field is displayed), you cannot use the RIGHT ARROW key or

drag with the mouse to scroll that part of the query grid.

RESOLUTION

Resize the Query window so that all of it is displayed.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. In the sample Northwind Traders database (NWIND.MDB), open the

   Category List query in Design view.

2. Resize the Query window so that the right-most column in the QBE

   grid with a field name in it is truncated on the screen.

3. Click in the start of the field cell and press the RIGHT ARROW key.

   The cursor leaves the screen but the right-most portion of the

   grid does not appear. The same thing happen if you try to drag

   with the mouse.

Additional reference words: 1.00 1.10 2.00


PRB: Troubleshooting 'ODBC - couldn't find ODBC.DLL' Error

 Article Number: Q95011

 CREATED: 28-JAN-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00

----------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

----------------------------------------------------------------------

SYMPTOMS

You receive the following error message:

   ODBC - couldn't find ODBC.DLL

CAUSES

Here are three possible causes:

 - The ODBC.DLL file you are using may be old.

 - You may have duplicate ODBC.DLL files on your system, and you are

   using the wrong one.

 - The ODBC.DLL file you are using may be damaged or corrupted.

RESOLUTION

The ODBC.DLL file installed by Microsoft Access version 1.0 is dated

10-16-92, has a size of 44736 bytes, and should be installed in the

\WINDOWS\SYSTEM directory.

MORE INFORMATION

There are other situations that may indirectly cause this error message. To

troubleshoot for these possibilities:

1. Use File Manager to search for multiple, corrupted, or outdated

   copies of these files:

      File          Correct Dates and Sizes

      ---------------------------------------------------

      DBNMP3.DLL    dated 9-15-92(8241 bytes) or later

      SQLSRVR.DLL   dated 10-16-92(135792 bytes) or later

      NETAPI.DLL    depends on the network being used

      COMMDLG.DLL   dated 10-25-92(89248 bytes) or later

      NOTE: The sizes and dates referenced are correct if the files are

      installed by Microsoft Access version 1.0.

2. Make sure the files listed in step 1 are in their appropriate locations.

   All files except NETAPI.DLL are usually installed in the \WINDOWS\SYSTEM

   directory. The NETAPI.DLL file is a network specific driver; it is

   usually located in the network's program directory, which should be in

   the path.

3. Use another application, such as Q+E, SAF, or PowerBuilder, on the

   same machine to attempt to attach to the same data source. If you

   cannot access the data source from another application, you probably

   have a network problem with the NETAPI.DLL file or with the server, not

   with Microsoft Access or ODBC.

4. Attempt to attach another data source, if available, such as another

   SQL server. If you can attach to another server, the original server may

   be down, or you may need to reconfigure the entry for that server using

   the ODBC Administration Utility.

5. Attempt to attach the same data source from a different machine. If you

   cannot gain access to the SQL server from a different machine, you may

   have a network-wide problem, or the SQL server may be down or not

   communicating.

6. Try increasing your ODBC timeout settings in the ODBC section of the

   MSACCESS.INI file.

7. Check with the system administrator to see if the SQL server is up,

   available for transactions, and operating properly.

8. Reinstall ODBC after performing a clean boot and renaming the

   ODBC.DLL, DBNMP3.DLL, and SQLSRVR.DLL files.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Appendix D, "Setting up

Microsoft Access on a Network," pages 660-662

Additional reference words: 1.00 ODBC tshoot errmsg


PRB: Error Message "Unable to Connect to Data Source"

 Article Number: Q95012

 CREATED: 28-JAN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

----------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

----------------------------------------------------------------------

SYMPTOMS

You receive the following error message when you are trying to access

a SQL Server:

   Unable to connect to data source

CAUSE

The SQL Server you are trying to access does not have a correct entry

in the [SQLSERVER] section of the WIN.INI file, or the SQL server is down,

overloaded, or otherwise unavailable.

RESOLUTION

To correct this situation, verify that the SQL Server is up and

available and that the entry in the [SQLSERVER] section of the WIN.INI

file looks like this:

   [SQLSERVER]

   MY_SERVER=DBNMP3,\\MY_SERVER\PIPE\SQL\QUERY

If there are any spaces in this entry or if the server name in the

\\MY_SERVER\PIPE\SQL\QUERY part of the statement is misspelled, you

will receive the error message.

MORE INFORMATION

It is possible that there are other situations which may indirectly

cause this error message. Here are several other things you can check to

troubleshoot this problem:

1. Use File Manager to search for multiple, corrupted, or outdated

   copies of these files:

      ODBC.DLL - 44736 bytes, dated 10-16-92 or later

      DBNMP3.DLL - 8241 bytes, dated 9-15-92 or later

      SQLSRVR.DLL - 135792 bytes, dated 10-16-92 or later

      NETAPI.DLL - depends on the network being used

      COMMDLG.DLL - 89248 bytes, dated 10-25-92 or later

   NOTE: The sizes and dates referenced are correct if the files were

   installed by Microsoft Access version 1.0.

2. Make sure the files listed above are in appropriate locations. All files

   except NETAPI.DLL are usually installed in the Windows System directory.

   The NETAPI.DLL file is a network specific driver, so it's usually

   located in the network's program directory, which should be in the path.

3. Use another application, such as Q+E, SAF, or PowerBuilder, on the same

   computer to attempt to attach to the same data source. If you cannot

   access the data source from another application, there is probably a

   problem with the network (NETAPI.DLL) or with the server, not with

   Microsoft Access or ODBC.

4. Attempt to attach to another data source, if available, such as

   another SQL server. If you can attach to another server, then the

   original server may be down or you may need to reconfigure the entry

   for that server using the ODBC Administration Utility.

5. Attempt to attach to the same data source from another computer. If

   you cannot access the SQL server from another computer, there may be a

   network wide problem or the server may be down or not communicating.

6. Try increasing the ODBC timeout settings in the ODBC section of the

   MSACCESS.INI file.

7. Check with the system administrator to see if the SQL server is up,

   available for transactions, and operating correctly.

8. Reinstall ODBC after performing a clean boot and renaming the ODBC.DLL,

   DBNMP3.DLL, and SQLSRVR.DLL files.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Appendix D, "Setting Up

Microsoft Access on a Network," pages 660-662

Additional reference words: 1.00 1.10 2.00 ODBC errmsg


PRB: SQL Data Sources Dialog Box Lists No Servers

 Article Number: Q95013

 CREATED: 28-JAN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you are trying to attach, import from, or export to a Microsoft SQL

Server table, the SQL Data Sources dialog box is displayed, but no

data sources (SQL Server computers) are listed.

CAUSE

The following causes are most likely:

 - You did not use the Microsoft Open Database Connectivity (ODBC)

   Administration application to set up connections to SQL Server

   machines.

 - The [ODBC Data Sources] section of your ODBC.INI file is missing

   or blank, or you have multiple copies of the ODBC.INI file and

   Microsoft Access is using a file in which the [ODBC Data Sources]

   section is missing.

RESOLUTION

Verify that you have a single copy of the ODBC.INI file on your

computer, located in your Windows directory. Also, make sure there is

an [ODBC Data Sources] section in your ODBC.INI file containing correct

entries for the SQL Server computers you want to use.

MORE INFORMATION

To correct the problem, rename your ODBC.INI file and use the ODBC

Administration application to complete the following tasks:

 - Connect to the SQL Server computers you want to use.

 - Create a new ODBC.INI file.

The contents of your new ODBC.INI file should resemble the following

example:

   [ODBC Data Sources]

   MYSERVER=SQL Server

   YOURSRVR=SQL Server

   [MYSERVER]

   Driver=C:\WINDOWS\SYSTEM\SQLSRVR.DLL

   Description=SQL Server on server MYSERVER

   OemToAnsi=No

   Network=dbnmp3

   Address=\\MYSERVER\PIPE\SQL\QUERY

   [YOURSRVR]

   Driver=C:\WINDOWS\SYSTEM\SQLSRVR.DLL

   Description=SQL Server on server YOURSRVR

   OemToAnsi=No

   Network=dbnmp3

   Address=\\YOURSRVR\PIPE\SQL\QUERY

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 660-662

Additional reference words: 1.00 1.10 2.00 tshoot checkpages ODBC


INF: Set Focus to a Subform Control Using GoToControl Action

 Article Number: Q95014

 CREATED: 28-JAN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

You can create a macro to move the focus to a control on a subform by

using the GoToControl macro action to move first to the subform, which

is a type of a control. Use the GoToControl action again to move to a

particular control on the subform.

MORE INFORMATION

The macro action GoToControl does not allow you to enter the full

syntax for the ControlName argument as:

   Forms![orders]![orders subform].form![Product ID]

If you enter this syntax, you will receive the following error:

   There is no control named 'Forms![orders]![orders

   subform].Form!Product id'.

To get around this, you need to set up a macro that first sets the

focus to the subform control, followed by a second action that sets

the focus to a specific control.

In the sample database Northwind Traders (NWIND.MDB), the Orders and

Orders Subform forms can be used as an example where you can have a

macro set the focus to the Product Id on the Orders Subform.

Create a new macro with two separate GoToControl actions, then attach

the macro to a button on the Orders form.

   Actions

   -------------------------------

   GoToControl

      Control Name: Orders Subform

   GoToControl

      Control Name: Product Id

When the button is clicked, the focus will move to the Product Id

control.

Additional reference words: 1.00 1.10 2.00


INF: Attaching Clipper Tables to Microsoft Access Databases

 Article Number: Q95044

 CREATED: 31-JAN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

It is possible to attach Clipper .DBF files to a Microsoft Access

database. To do so, attach it as a dBASE IV file. Note, however, the

index may or may not be updateable.

Clipper provides an alternative indexing method (.NTX) to the dBASE

standard (.NDX). The Clipper index format is not recognized by

Microsoft Access, so Microsoft Access cannot update it correctly.

However, if the Clipper application was developed using the dBASE .NDX

format, Microsoft Access updates the index correctly.

Additional reference words: 1.00 1.10 2.00 indexes


INF: Using SHARE.EXE and VSHARE.EXE with Microsoft Access

 Article Number: Q95047

 CREATED: 31-JAN-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

MS-DOS, Microsoft Windows, and Windows-based applications use

SHARE.EXE to provide a file locking mechanism so that Windows-based

tasks can communicate with each other. The tasks use SHARE.EXE to sort

out file read/write conflicts. Therefore, it is important that you

load SHARE.EXE before starting Windows. Without SHARE.EXE loaded, you

may experience data corruption in applications.

Using SHARE.EXE with Microsoft Access allows multiple users to access a

database at the same time while protecting them from updating the same

record at the same time. If a database is opened exclusively by one

user, no other users will be able to use the database until the first

user releases it. However, if all users open the database in a shared

mode, SHARE.EXE allows all users to read and write to the database

simultaneously, with the exception of locked records. For example, if

a user has record 100 open on a particular database, that record is

considered locked, and no other users will be able to change any data

in record 100 until the first user finishes changing it.

For this reason, while it is possible to run Microsoft Access without

first loading SHARE.EXE, Microsoft does not recommend it. If you choose

not to use SHARE.EXE, you must ensure that only one Windows-based task

writes to a database record at any given moment.

MORE INFORMATION

MS-DOS uses SHARE.EXE to lock files as requested by applications.

SHARE.EXE controls updates and prevents data corruption in files.

An application can request a deny-read lock (exclusive), a deny-write

lock, or both. Deny-write locks allow other applications to read data,

but prevent two different applications from updating the same file at

the same time.

SHARE.EXE also provides byte-range locks. When a range of bytes is

locked, other applications cannot read, write, or lock those bytes.

Other, unlocked bytes, in the file are not affected. An application

can use byte-range locks to place exclusive locks on records for

record-level locking.

In single-user environments, SHARE.EXE prevents file contention

accidents when multiple instances of a program attempt to write to the

same database or database record at the same time. In multiple-user

environments such as networks, SHARE.EXE prevents possible database

corruption when several different network users attempt to write to

the same database or database record at the same time.

Microsoft Windows for Workgroups

--------------------------------

The only time you do not have to use SHARE.EXE is when you run

Microsoft Windows for Workgroups in Enhanced mode. Microsoft Windows

for Workgroups in Enhanced mode loads and uses a file-sharing program

called VSHARE.386, which is a replacement for SHARE.EXE. There is an

entry for VSHARE.386 in the SYSTEM.INI file.

If you plan on running Windows for Workgroups exclusively in Enhanced

mode and do not run other applications that require SHARE.EXE, you can

save approximately 5K of conventional memory by not loading SHARE.EXE. To

do this, remove the SHARE.EXE line from your AUTOEXEC.BAT file and

restart your computer.

SHARE.EXE is likely to be in your AUTOEXEC.BAT file because during the

Microsoft Access installation process, the SETUP.EXE program

automatically inserts the following MS-DOS command in your AUTOEXEC.BAT

file:

   <MS-DOS directory>\SHARE.EXE /L:500

If SHARE.EXE is already present before running Microsoft Windows for

Workgroups in Enhanced mode, VSHARE.386 loads in addition to SHARE.EXE,

temporarily disabling SHARE.EXE. Then VSHARE.386 takes over file sharing

tasks until you exit Microsoft Windows for Workgroups. After you exit

Windows for Workgroups, VSHARE.EXE passes file-sharing control back to

SHARE.EXE for use by MS-DOS applications that require it.

Microsoft Access runs correctly with either SHARE.EXE or VSHARE.386,

but SHARE.EXE limits the number of available locks to the number

specified when SHARE.EXE was loaded. The /L parameter specifies the

number of share locks; the default is 20. VSHARE.386, on the other

hand, dynamically allocates the number of locks available based on the

demand for locks. The number of locks available is especially

important if the computer running Microsoft Windows for Workgroups

acts as a server in a client-server environment.

Additional reference words: 1.00 1.10 WinIss


INF: Use AutoLookup Technique to Look Up Info Automatically

 Article Number: Q95048

 CREATED: 31-JAN-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

You can create a query or form that automatically looks up information

in the one-side table of a one-to-many relationship based on an entry

in a many-side field. This process is sometimes called AutoLookup.

You can use AutoLookup to have a query automatically look up

information in other tables and display it on a form or report.

You can look up information by using any one of the following three

techniques:

1. Use AutoLookup. For more information on AutoLookup, see the "More

   Information" section below.

2. Use multiple DLookup() functions in forms and reports. For more

   information on the DLookup() function, query on the following

   words here in the Microsoft Knowledge Base:

      DLookup and forms and reports

3. Use the Column property of a multiple-column combo box to update a

   text box control with new information as focus moves from row to

   row in the combo box. For more information on this, query on the

   following words here in the Microsoft Knowledge Base:

      Column and property and combo and Update

MORE INFORMATION

Use AutoLookup when you want Microsoft Access to automatically look up

information in the one-side table based on an entry in a many-side field.

The AutoLookup technique works in a query or in a form. AutoLookup also

works with tables that have a one-to-one relationship if you use a left

outer join. For more information on what data is updatable, search for

"Underlying table or query," then "When is a query updatable?" using the

Microsoft Access Help menu.

For example, the Categories and Products tables in the sample database

NWIND.MDB have a one-to-many relationship. Each category may appear

several times in the Products table. The Products table contains the

Category ID field, which is the foreign key that identifies the

category for a product.

When AutoLookup updates records, Microsoft Access automatically

recalculates any totals or expressions that are dependent on the

updated information.

Microsoft Access version 1.1 has additional online Help topics for

AutoLookup issues. In this context, the term "AutoLookup" is synonymous

with the term "dynamic lookup." For more information, search for "dynamic

lookup", then "Displaying Fields from Another Table or Query (Common

Question)" using the Help menu. In Microsoft Access version 2.0, search for

"AutoLookup."

The following two examples demonstrate how AutoLookup works:

Example 1: Create a Query That Uses AutoLookup

----------------------------------------------

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. Create a new query. Add the Products and Categories tables.

   Products is the many-side table and Categories is the one-side

   table. The two tables have a many-to-one relationship based on the

   Category ID field (meaning there are many identical Category ID

   values in Products for each unique Category ID value in

   Categories).

3. Add the following fields from the Products table:

      Product ID

      Product Name

      Category ID

4. Add the following fields from the Categories table:

      Category Name

      Description

5. Save the query as AutoLookup Example.

6. View the results of the query. To verify that the query performs

   AutoLookup, move to the end of the query and create a new record.

   Enter a valid Category ID value in the Category ID field. Microsoft

   Access will automatically look up the values associated with that

   Category ID value in the Categories table.

This process works because the Category ID field located in the query

comes from the many-side table (Products). Microsoft Access performs

AutoLookup on one-side tables when you enter identifying data in the

many-side table. When you enter a valid value in the Products table's

Category ID field, Microsoft Access knows that Category ID is the key

field for the one-side table (Categories), so it looks up the

information from Categories based on the Category ID value and

automatically displays it in the query.

Example 2: Create a Form That Uses AutoLookup

---------------------------------------------

1. Create a new form based on the query that you created in Example 1.

2. Locate the fields from the Products table on "one" side of the form

   and those from the Categories table on the "many" side of the form.

3. Create a combo box bound to the Category ID field. Set the

   RowSource property to the Categories table. Display a single

   column, [Category ID], in the combo box.

4. Switch to Form view. When you enter new records and select a

   category from the Category ID combo box, all related information

   about that Category is displayed.

Note that if you had included the primary key value from the one-side

table (Categories), you would not have been allowed to add new records

to the query or to change the Category ID value. For this reason, you

must drag the Category ID field from the Products table, rather than

from the Categories table.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 10, "Creating

Forms Based on More than One Table," page 282

Microsoft Access "User's Guide", version 2.0, Chapter 11, "Designing Select

Queries"

Additional reference words: 1.00 1.10 2.00


PRB: Err: "Data Source Not Found, No Default Driver Specified"

 Article Number: Q95050

 CREATED: 31-JAN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you are trying to attach a SQL Server table, or use a table that has

already been attached, you receive the following error message:

   Data source not found and no default driver specified.

CAUSE

You may have a missing, damaged, or incorrect ODBC.INI file.

Other situations may indirectly cause this error message. For more

information, query on the following words here in the Microsoft

Knowledge Base:

   debugging and troubleshooting and tips and Q102437

RESOLUTION

Verify the following:

 - There is an ODBC.INI file in your WINDOWS subdirectory.

 - There is only one copy of the ODBC.INI file available on the computer

   you are using.

 - The entries in the ODBC.INI file are correct for the SQL database

   server to which you want to connect.

MORE INFORMATION

The contents of your ODBC.INI file should resemble the following:

   [ODBC Data Sources]

   MYSERVER=SQL Server

   YOURSRVR=SQL Server

   [MYSERVER]

   Driver=C:\WINDOWS\SYSTEM\SQLSRVR.DLL

   Description=SQL Server on server MYSERVER

   OemToAnsi=No

   Network=dbnmp3

   Address=\\MYSERVER\PIPE\SQL\QUERY

   [YOURSRVR]

   Driver=C:\WINDOWS\SYSTEM\SQLSRVR.DLL

   Description=SQL Server on server YOURSRVR

   OemToAnsi=No

   Network=dbnmp3

   Address=\\YOURSRVR\PIPE\SQL\QUERY

You will receive the error message if there is no section that refers

to the SQL database server to which you are trying to attach or if any

of the following are true:

 - The [MYSERVER] section is missing.

 - The Driver= line is missing.

 - The .DLL file on the Driver= line is missing its .DLL extension.

 - The .DLL file is missing, damaged, or outdated.

Additional reference words: 1.00 1.10 2.00 tshoot errmsg


PRB: Unable to Connect to Attached SQL Server Table, Error Msg

 Article Number: Q95051

 CREATED: 31-JAN-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you try to use an attached SQL Server table, you receive the

error message:

   Unable to connect to data source.

CAUSE

The following two conditions are most likely to cause this error

message:

 - There is an incorrect entry in the [SQLSERVER] section of your

   WIN.INI file.

   The [SQLSERVER] section of your WIN.INI file should look like the

   following example:

      [SQLSERVER]

      MYSERVER=dbnmp3,\\MYSERVER\PIPE\SQL\QUERY

      YOURSRVR=dbnmp3,\\YOURSRVR\PIPE\SQL\QUERY

   This error is caused by an incorrect server name (MYSERVER or

   YOURSERVR) or extra spaces in the path.

 - The SQL database server is overloaded or unavailable.

Other situations may indirectly cause this error message. For more

information, query on the following words here in the Microsoft

Knowledge Base:

   debugging and troubleshooting and tips and Q102437

RESOLUTION

Verify that the [SQLSERVER] section of your WIN.INI file has the

correct entry for the server you are attempting to attach. Then check

with the system administrator to see if the SQL database server is

available for transactions, operating properly, and not overloaded.

Additional reference words: 1.00 1.10 tshoot errmsg ODBC SQL Server


PRA: Running Delete Query Gives Misleading Error Msg

 Article Number: Q95052

 CREATED: 31-JAN-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

- Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SYMPTOMS

If you attempt to run a Delete query that would violate

referential

integrity, Microsoft Access displays the following

misleading error

message:

   Errors were encountered: The contents of fields in 0

record(s)

   were deleted, XXX record(s) were lost due to key

violations, and 0

   record(s) were locked and couldn't be modified. Proceed

anyway?

CAUSE

Microsoft Access uses the same error message for all action

queries.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

versions 1.0 and 1.1. We are researching this problem and

will post new

information here in the Microsoft Knowledge Base as it

becomes available.

MORE INFORMATION

Microsoft Access enforces referential integrity if

relationships were

defined between tables with this option. You will receive an

error

message if you attempt to breach the rules of referential

integrity

when running a Delete Query or when you delete fields that

would effect

the one-side of a one-to-many relationship.

However, as you can see in the SYMPTOMS section above, when

you run the

Delete query, the error message displayed is misleading.

When you try to run a Delete query on the one-side of a one-

to-many

relationship that has Referential Integrity enforced, after

you choose the

OK button in response to this message: "XXX row(s) will be

deleted,"

Microsoft Access gives you the following error message:

   Errors were encountered: The contents of fields in 0

record(s)

   were deleted, XXX record(s) were lost due to key

violations, and 0

   record(s) were locked and couldn't be modified. Proceed

anyway?

If you proceed by choosing OK, nothing happens.

If you attempt to delete a field from a form or table that

is on the

one-side of a one-to-many relationship, Microsoft Access

gives you

the following error message:

   Can't delete or change record. Since related records

exist in

   table 'The table that is on the many side', referential

integrity

   rules would be violated.

In this case, the two preceding error messages mean the same

thing.

Additional reference words: 1.00 1.10 ErrMsg


PRB: Query Fails When Linked SQL Server Table Cannot Be Found

 Article Number: Q95053

 CREATED: 31-JAN-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When attempting to use an attached SQL Server table, you receive the

following error message:

   Couldn't execute query; couldn't find linked table.

   Invalid object name <TABLE_NAME>.

CAUSE

The most likely cause of this error is an incorrect entry in the

[SQLSERVER] section of your WIN.INI file.

The [SQLSERVER] section of your WIN.INI file should look like the

following:

   [SQLSERVER]

   MYSERVER=dbnmp3,\\MYSERVER\PIPE\SQL\QUERY

   YOURSRVR=dbnmp3,\\YOURSRVR\PIPE\SQL\QUERY

The error is caused by an incorrect server name (MYSERVER or YOURSERVR)

or additional spaces in the entry.

Other situations may indirectly cause this error message. For more

information, query on the following words here in the Microsoft

Knowledge Base:

   debugging and troubleshooting and tips and Q102437

RESOLUTION

Verify that the [SQLSERVER] section of your WIN.INI file contains

the correct entry for the server you are attempting to attach.

Additional reference words: 1.00 1.10 tshoot errmsg


PRB: Driver Cannot Be Found When Attaching to SQL Server

 Article Number: Q95054

 CREATED: 31-JAN-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When trying to attach a SQL Server table, or open a previously

attached table, you receive the following error message:

   Driver specified by data source could not be loaded.

CAUSE

The most likely cause of this error message is a missing, damaged, or

incorrect version of the SQLSRVR.DLL file.

Other situations may indirectly cause this error message. For more

information, query on the following words here in the Microsoft

Knowledge Base:

   debugging and troubleshooting and tips and Q102437

RESOLUTION

To correct this problem, verify the following:

 - There is a single copy of the SQLSRVR.DLL file in your Windows

   SYSTEM subdirectory.

 - You have the correct version of the SQLSRVR.DLL file. The version

   installed by Microsoft Access version 1.0 is dated 10-16-92 and has

   a size of 135792 bytes. You need either this file or a more recent

   version.

Additional reference words: 1.00 1.10 tshoot errmsg


INF: Changing the Relationship Between Two Existing Tables

 Article Number: Q95058

 CREATED: 31-JAN-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

You can change an ID field from a Long Integer or other data type to a

Counter data type in the table on the one-side of a one-to-many

relationship and change the ID values in the corresponding records in the

many-side table while still maintaining the links between the two tables.

MORE INFORMATION

The following example uses the sample database NWIND.MDB to show you how to

change the ID values in the Customers table (the one-side table) and update

the values in the Orders table (the many-side table) so that the records in

the two tables are still linked:

1. Add the following fields to the Customers and Orders tables:

      Table: Customers

      ---------------------

      Field name: New ID

         Data Type: Counter

      Table: Orders

      ---------------------------

      Field name: New ID

         Data Type: Number

         Field Size: Long Integer

2. Create a new query. Add the Customers and Orders tables to the query.

   Make sure the tables are joined on Customer ID.

3. From the Query menu, choose Update.

4. Add the following field and properties to the query grid:

      Update Query: Query1

      ----------------------------------

      Field name: Orders.New ID

         Update To: [Customers].[New ID]

   When you type Orders.New ID into the Field name cell, the Orders

   table name disappears. From the View menu, choose Table Names to

   see all the table names displayed on the grid.

6. To run the query, click the Run button on the tool bar.

7. Close the query. You do not need to save it.

If there is a relationship already defined for the two tables, you need

to remove it. For example, the NWIND database has a defined relationship,

so you need to remove it.

To remove the original relationship between tables:

1. Press F11 to give the Database window the focus. From the Edit

   menu, choose Relationships.

2. Select Customers for the Primary Table and Orders for the Related Table.

   Customer ID automatically appears in Select Matching Fields.

3. Choose the Delete button to remove the relationship. Then close the

   dialog box.

Next, remove the original ID field and rename the new one in the Customers

table:

1. Open the Customers table in Design view.

2. Delete the Customer ID field.

3. Change the name of New ID to Customer ID and make it the primary key.

4. Close the table, and save the changes.

Then remove the original ID field and rename the new one in the Orders

table:

1. Open the Orders table in Design view.

2. Delete the Customer ID field.

3. Change the name of New ID to Customer ID.

4. Close the table, and save the changes.

Now you can redefine the relationship between the tables. From the Edit

menu, choose Relationships.

Additional reference words: 1.00 1.10


PRB: Connection Not Open Error Message

 Article Number: Q95060

 CREATED: 31-JAN-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You receive the following error message:

   Connection not open.

CAUSE

The most likely cause of this error message are missing, damaged, or

incorrect versions of the SQLSRVR.DLL or ODBC.DLL files.

Other situations may indirectly cause this error message. For more

information, query on the following words here in the Microsoft

Knowledge Base:

   debugging and troubleshooting and tips and Q102437

RESOLUTION

To solve this problem, verify the following:

 - Single copies of SQLSRVR.DLL and ODBC.DLL both exist in your Windows

   SYSTEM directory.

 - You have the correct versions of these two files. The SQLSRVR.DLL

   file installed by Microsoft Access version 1.0 is dated 10-16-92

   and has a size of 135792 bytes. The ODBC.DLL file installed by

   Microsoft Access version 1.0 is dated 10-16-92 and has a size of

   44736 bytes.

Additional reference words: 1.00 1.10 tshoot errmsg


PRB: Stored procedure 'PROCEDURE' not found -- Error Message

 Article Number: Q95061

 CREATED: 31-JAN-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

----------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

----------------------------------------------------------------------

SYMPTOMS

You receive the error message:

   Stored procedure 'PROCEDURE' not found

The 'PROCEDURE' noted in the error message is the name of a  stored

procedure that cannot be found but is necessary to gain access to the

SQL Server.

CAUSE

The SQL Server you are attempting to access is not set up correctly.

It is missing the required stored procedures.

RESOLUTION

To correct this situation, install the necessary stored procedures on

the SQL Server by using the INSTCAT.SQL SQL script file supplied with

the Microsoft Access disk set.

MORE INFORMATION

Run INSTCAT.SQL to configure Microsoft SQL Server for use with ODBC,

the open database connectivity protocol used by Microsoft Access to

attach SQL Server tables. INSTCAT.SQL is the SQL script file that

ships with with ODBC. You need to run it to set up the stored

procedures that provide catalog information used by ODBC.

To install the catalog stored procedures using INSTCAT.SQL, run

INSTCAT.SQL using the SQL Server facility ISQL (Interactive SQL) from

the MS-DOS command line.

Following is the syntax for this procedure. Note that you need to

enter the two lines as one continuous line, and do not include the

angle braces <> in the command:

   ISQL /U <sa login name> /n /P <password> /S <SQL server name>

   /i <drive:\path\INSTCAT.SQL> /o <drive:\path\output file name>

   Following is a description for each switch:

   /U    Gives the system administrator's login name

   /n    Eliminates line numbering and prompting for user input.

   /P    Gives the system administrator's Password -- case sensitive

   /S    Gives the name of the server to set up.

   /i    Gives the drive and fully qualified path for INSTCAT.SQL

   /o    Provides the output file destination for results of the

         process including errors.

Here is a sample ISQL command line:

   ISQL /U sa /n /P SA_Password /S SQL_SERVER /i d:\SQL\INSTCAT.SQL

   /o d:\SQL\output.txt

After running INSTCAT.SQL, run the RECONFIGURE command against the

MASTER database by using the SQL Administration Facility (SAF) from an

MS-DOS client or the server, or run the SQL Administrator program

from a Microsoft Windows client.

Other Possible Causes for this Error Message

--------------------------------------------

It is possible that other situations can indirectly cause this error

message. Use the following steps to troubleshoot the problem:

1. Use File Manager to search for multiple, corrupted, or outdated

   copies of these files:

      ODBC.DLL - dated on or after 10-16-92 containing 44736 bytes

      DBNMP3.DLL - dated on or after 9-15-92 containing 8241 bytes

      SQLSRVR.DLL - dated on or after 10-16-92 containing 135792 bytes

      NETAPI.DLL - depends on the network being used

      COMMDLG.DLL - dated on or after 10-25-92 containing 89248 bytes

      NOTE: The sizes and dates referenced are correct if the files are

      installed by Microsoft Access version 1.0.

2. Make sure the files listed above are in appropriate locations. All

   the files except NETAPI.DLL are usually installed in the Windows

   System directory. The NETAPI.DLL file is a network specific driver

   that is usually located in the network's program directory, which

   should be in the path.

3. Use another application, such as Q+E, SAF, or PowerBuilder, on the

   same machine to attempt to attach the same data source. If you

   cannot access the data source from another application, there is

   probably a problem with the network. That is there may be a problem

   with the NETAPI.DLL file or a problem with the SQL database server,

   not with Microsoft Access or ODBC.

4. Attempt to attach another data source such as another SQL server.

   If you are successful, the original server may be down or you may

   need to reconfigure the entry for that server by using the ODBC

   Administration Utility.

5. Attempt to attach to the same data source from another machine. If

   you cannot gain access to the SQL database server from another machine,

   there could be a network wide problem or the server may be down or not

   communicating.

6. Try increasing your ODBC timeout settings in the ODBC section of

   the MSACCESS.INI file.

7. Check with the system administrator to see if the SQL database server

   is up, available for transactions, and operating correctly.

8. Reinstall ODBC after restarting the server and renaming the ODBC.DLL,

   DBNMP3.DLL, and SQLSRVR.DLL files.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Appendix D, "Setting up

Microsoft Access on a Network," pages 660-662

Microsoft SQL Server "Administrator's Guide," version 4.2, pages 205-

212

Additional reference words: 1.00 1.10 2.00 ODBC tshoot errsg


PRB: Paste Unavailable After Record Is Copied to Clipboard

 Article Number: Q95323

 CREATED: 07-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If two users are simultaneously modifying the same record in the same

table, the user who attempts to save the record last receives the

following error message:

   Data has changed; Operation Stopped

When you choose the OK button to close this message, you receive the

following error message:

   This record has been changed by another user since you started

   editing it. If you save the record you will overwrite the changes

   the other user made. Copying the changes to the Clipboard will let

   you look at the values the other user entered, and then paste your

   changes back in if you decide to make changes.

You are given the option to copy the changes the other user made to

the Clipboard and then view the contents in the Clipboard; however,

the Paste command is unavailable in Microsoft Access.

CAUSE

Microsoft Access does not support pasting records when the focus is

in a control.

RESOLUTION

You can choose Paste Append to append the record to the table; or, if

you select the record you want to paste to, you can then use the Paste

command (or CTRL+V).

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10 2.00 errmsg


PRB: Current Record Not Immediately Updated with Replace All

 Article Number: Q95324

 CREATED: 07-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you choose the Replace All button and the focus is on a particular

field in a record, that record is not changed until all other records are

replaced.

STATUS

This behavior is by design.

MORE INFORMATION

The record that has the focus is refreshed only after all other records in

the dynaset have been updated.

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create a query based on the Orders table, as follows:

      Query: QueryTest

      ---------------------

      Field Name: Ship City

      Criteria: ="seattle"

3. Execute the query.

4. Place the indicator in the first row, between the "e" and "a" in

   "Seattle."

5. From the Edit menu, choose Replace. Type "LE" (without quotation marks)

   in the Find What box. Type "LEFOO" (without quotation marks) in the

   Replace With box. Choose the Current Field button and clear the Match

   Case and Match Whole Field check boxes.

6. From the Edit menu, choose Replace All. Note that the first field

   does not immediately display the change, but does as soon as all

   other records are updated.

Additional reference words: 1.00 1.10 2.00 update Replace All refresh


PRB: Error in Column Property Help Menu Topic

 Article Number: Q95325

 CREATED: 07-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you search for "Column," then "Column Property" using the

Microsoft Access Help menu, some of the remarks are not correct.

RESOLUTION

When you use the Column property to reference a specific column in a

combo box or list box, use Column(0) to refer to the first column,

Column(1) to refer to the second column, and so on. In other words, the

numbering begins with 0, not 1.

Incorrect Statement in the Column Property Help Topic

-----------------------------------------------------

You can use the Column property to refer to a particular column in

a multiple-column combo box or list box. Use 1 to refer to the

first column, 2 to refer to the second column, and so on.

Corrected Version

-----------------

You can use the Column property to refer to a particular column in

a multiple-column combo box or list box. Use 0 to refer to the

first column, 1 to refer to the second column, and so on.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

To create a multiple-column combo box, set the RowSource property to

include more than one column, and set the ColumnCount property to a number

greater than one. To refer to each column in the combo box, use the Column

property and include a reference number. Here is the syntax:

   Forms![Form Name]![Control Name].Column(#)

Replace the pound sign (#) with the reference number. The reference number

is 0 for first column in the control, 1 for the second column, 2 for the

third, and so on.

Here is a step-by-step example that demonstrates how to use the Column

property reference number correctly:

1. Open the NWIND.MDB sample database, and create a new, blank (unbound)

   form.

2. Add a combo box and a text box to the new form. Use the following as

   a guide to set the properties for each control:

      Object: Combo Box

      -----------------

         ControlName:   My Combo Box

         RowSource:     Employees (a table)

         ColumnCount:   3

         ColumnWidth:   0,1,1

         BoundColumn:   1

      Object: Text Box

      ----------------

         ControlName:   My Text Box

         ControlSource: =[Forms]![Column Example]![My Combo Box].Column(2)

   Because you set ColumnCount to 3 and RowSource to the Employees table,

   Microsoft Access loads the combo box with values from the first three

   fields in the Employees table: Employee ID, Last Name, and First Name.

   Because you set the width of the first column to 0 in the ColumnWidth

   property, the first column (Employee ID) does not show up in the combo

   box. The 2 in the Column(2) in the ControlSource setting for the text

   box, refers to the third column (First Name), not the second (Last

   Name).

3. Save the form, and name it Column Example.

4. Switch to Form view, and select a name from the combo box list.

The combo box list displays the Last Name and First Name fields for each

employee in the Employees table. When you select a name from the list,

Microsoft Access displays the last name in the combo box and the first name

in the text box.

Additional reference words: 1.00 1.10 DocBug properties controls


INF: Using a Subtract Query to Find Unmatched Records

 Article Number: Q95326

 CREATED: 07-FEB-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article describes how to create a Subtract query to compare two

tables and return a dynaset that includes only those records from the

first table that do not have matching records in the second table.

MORE INFORMATION

The following example demonstrates how to create a query on two joined

tables that subtracts the matching records, returning only those records

that do not match on the joined field:

NOTE: The following example assumes that you have two tables in your

database called Table1 and Table2 that can be joined on at least one

field.

1. Create a new query based on Table1 and Table2.

2. Join the two tables on the appropriate field. Microsoft Access will

   join the tables automatically if there is an underlying relationship

   between them.

3. Double-click the join line between the tables. In the Join Properties

   dialog box, select either type 2 or type 3, whichever is most

   appropriate for your data. For this example, you want all the records

   from Table1 and only those that match from Table2--a type 2 join.

4. Drag the joined field from Table2 to the query grid. Clear the Show

   check box. Set the Criteria field to "Is Null" (without quotation

   marks).

5. Drag any other needed fields from Table1, such as the primary key

   field, to the query grid. These are the columns that identify

   unmatched records.

6. Run the query. The Is Null condition in the first column ensures that

   only those records from Table1 that do not have a match in Table2

   will be returned.

The following is a sample SQL SELECT statement that uses the sample

database NWIND.MDB. It returns all the customers who have not placed an

order:

   SELECT DISTINCTROW Customers.[Company Name]

   FROM Orders, Customers,

   Customers LEFT JOIN Orders

   ON Customers.[Customer ID] = Orders.[Customer ID]

   WHERE ((Orders.[Customer ID] Is Null));


PRA: Error When Import dBASE, FoxPro, or Paradox Table

 Article Number: Q95327

 CREATED: 07-FEB-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you import a dBASE, FoxPro, or Paradox table in Microsoft Access

version 1.x, or a Paradox table in Microsoft Access version 2.0, without

including the file extension, you receive the following error message:

   Couldn't find object '<filename>'

RESOLUTION

Rename the file so that it has an extension. It does not have to have

the correct extension, such as .DBF for a dBASE table, but it must have

some sort of extension.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0

for dBase and FoxPro, but does still occur for Paradox. We are researching

this problem and will post new information here in the Microsoft Knowledge

Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Rename a dBASE, Paradox, or FoxPro file so that it has no

   extension. For example, rename CUSTOMER.DBF to CUSTOMER.

2. Open a Microsoft Access 1.x database.

3. From the File menu, choose Import.

4. In the Import dialog box, select the appropriate data source. For

   example, select dBASE III or IV to import a dBASE file.

5. Under List Files of Type, select All Files (*.*).

6. Locate and select the import file created in step 1 without an

   extension.

7. Choose the Import button.

You will see the following error message:

   Couldn't find object '<filename>'.

Additional reference words: 1.00 1.10 2.00 ErrMsg


PRB: User with Full Permissions Cannot Change a Query

 Article Number: Q95328

 CREATED: 07-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

After changing a query definition, you try to save the query but cannot,

even though you have full permissions on the query and are a member of the

Admins group.

CAUSE

Queries have a property called Run With Owner's Permissions. You can see

it in the Query Properties dialog box. If it is selected, only the owner

of the query can save it. Allowing someone else to make changes would

be a security violation.

RESOLUTION

Nobody other than the query owner (the person who created it) can save

the query as long as this property is set. To allow anyone with Modify

Definition permissions to save changes to a query, you need to clear

the Run With Owner's Permissions check box.

REFERENCES

==========

Microsoft Access "User's Guide," version 2.0, Chapter 14

Microsoft Access "User's Guide," version 1.0, Chapter 25, "Administering a

Database System," pages 625-629

Additional reference words: 1.00 1.10 2.00 permissions adk checkpage


INF: How to Determine Whether a Form Is Minimized

 Article Number: Q95329

 CREATED: 07-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access does not include an intrinsic function to indicate

that a form is minimized. Use the IsIconic() function in the Microsoft

Windows Application Programming Interface (API) to determine that a

form is minimized.

MORE INFORMATION

The following code example demonstrates declaring and calling the

IsIconic() function from Access Basic. The argument to IsIconic() is

the handle of the form the state of which you would like to know.

IsIconic() returns 1 if the form is minimized or 0 (zero) if the form

is not minimized.

   '=================================================

   'GLOBAL DECLARATION SECTION

   '=================================================

   Option Explicit

   Declare Function IsIconic% Lib "User" (ByVal hwnd%)

   '======================================================

   ' w_IsIconic()

   '

   ' This function returns the window state of a form.

   '

   ' Return value:

   '   1 - Form is minimized.

   '   0 - Form is not minimized.

   '======================================================

   Function w_IsIconic ()

      w_IsIconic = IsIconic(Forms!Form1.hwnd)

   End Function

REFERENCES

==========

Microsoft Windows Software Development Kit "Programmer's Reference,

Volume 2: Functions," version 3.1, pages 555-556

Additional reference words: 1.00 1.10 2.00 API checkpage


PRB: CTRL+HOME in List Box Moves to First Item in List

 Article Number: Q95387

 CREATED: 08-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you press CTRL+HOME in a list box, the cursor moves to the first item

in the list box, not the first field in the first record.

However, when you search for "navigation keys," then "Navigation

Keys -- Datasheets and Grids" using the Microsoft Access Help menu,

you see that Help says CTRL+HOME has two purposes. You can press it to

move to the first field in the first record, or in a multiple-line text

box, you can press it to move to the beginning of the first line.

CAUSE

The key combination CTRL+HOME is an edit key combination, so in a list

box, the first use (moving to the beginning of the field) has precedence

over the second use (moving to the first field in the first record).

Because of this, the focus remains in the list box rather than moving to

other fields or controls.

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10 2.00


INF: dBASE SET DELETED Characteristic in Microsoft Access

 Article Number: Q95388

 CREATED: 08-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you delete a record in a dBASE or Microsoft FoxPro database, the

record is actually only marked for deletion. It is not permanently

removed until the database is packed in dBASE or FoxPro.

This characteristic can produce confusing effects when you open a

table in Datasheet view.

MORE INFORMATION

In dBASE or FoxPro, records that are marked for deletion still appear

in any output form, such as a table in Datasheet view or a report in

Print Preview, unless you SET DELETED to ON. Because of this,

Microsoft Access displays such records in an attached dBASE or FoxPro

table, even if the records are marked for deletion.

To reproduce this characteristic in Microsoft Access, use the

following steps:

1. Attach the dBASE table called NEWCUST.DBF. This table should be

   present in your Access program directory if you installed the

   sample databases with Microsoft Access.

2. Open the NEWCUST table in Datasheet view. Note that there are 13

   records in this table.

3. Select the last record in the table by clicking on the record

   selector on the leftmost side of the datasheet.

4. Press the DEL key. Note that the record disappears from the

   datasheet, leaving 12 records in this table.

5. Close the Datasheet window and reopen it. Note that all 13 records

   reappear.

It may seem that Microsoft Access deleted the record, then undeleted

it when you reopened the table. In reality, Microsoft Access marked

the record for deletion, but because the marked record still existed

in the table, Microsoft Access continued to display it in datasheet.

To prevent this problem from occurring, Microsoft Access provides

functionality identical to the dBASE and FoxPro SET DELETED command. To

take advantage of this functionality, be sure that you set Deleted to On

if you do not want records that have been marked for deletion to show. Use

the following procedure to do this:

1. Open MSACCESS.INI in Windows Notepad.

2. Find the section called [dBASE ISAM].

3. Change the setting...

   Deleted=Off

   -to-

   Deleted=On

4. Save the MSACCESS.INI file and restart Microsoft Access.

   When you view the dBASE data, records marked for deletion will no

   longer appear. To permanently remove records marked for deletion,

   you must open the dBASE table in dBASE format and run the PACK

   command.

dBASE is manufactured by Borland International, Inc., a vendor

independent of Microsoft; we make no warranty, implied or otherwise,

regarding this product's performance or reliability.

Additional reference words: 1.00 1.10 2.00


PRB: Error Using Edit Find with Yes/No Data Type

 Article Number: Q95389

 CREATED: 08-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you are using the Find command from the Edit menu on a form with

a check box control bound to a field with a Yes/No data type, the

Find will not work correctly. When you enter Yes or No in the Find

What box and execute the Find, the following message is displayed:

   Microsoft Access has reached the end of the dynaset.

CAUSE

Although it appears that the check box is receiving the focus, the

actual focus is on the label for the check box. The check box will

never receive the focus, so you cannot use the Find command on the

check box. The Find command will work correctly if the control is

not a check box.

RESOLUTION

Do not use a check box if you want the ability to search on this

field. You can search on a Yes/No data type if it is a text box.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a form with a check box control using the Yes/No data type.

2. Switch to Form view, and click in the new check box.

3. From the Edit menu, choose Find.

4. Enter Yes or No in the Find What box. Choose the Find Next button.

The above error message will be displayed without any values being

located.

Additional reference words: 1.00 1.10 2.00 boolean errmsg


INF: Eliminating White Space in Reports with CanShrink and

 Article Number: Q95390

 CREATED: 08-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Before printing a form or report, you can save space by conditionally

reducing the sizes of the controls on the form or report. For example,

you might want to reduce the size of text boxes that contain varied-length

text or reduce the size of text boxes bound to fields that could be empty.

Note the following information before you try to reduce the size of

controls in reports:

 - Overlapping controls will not shrink, even when the CanShrink property

   is set to Yes.

 - Controls shrink line by line (vertically). This means, for example, that

   if there are a group of controls placed on the left side of the page and

   a large control (for example, an OLE picture) on the right side of the

   page, the controls on the left side of the page will not shrink, unless

   the picture is blank and hidden.

 - Space between controls is not affected by the CanShrink or CanGrow

   properties.

 - Controls located in the Page Header or Page Footer will not shrink

   or grow.

MORE INFORMATION

A control containing null information automatically shrinks to nothing and

disappears when its CanShrink property is set to Yes, but the space

between the controls is not affected by the CanShrink property.

For example, say you have 11 controls in a column of a report, and there is

.1 inch of space between each control. Even if all 11 controls contain null

information and all 11 have their CanShrink property set to Yes, the space

between the controls adds up to 1 inch. When you print the report, even

though the 11 controls do not print, the first control that does contain

text will print 1 inch lower than you might expect because of all the

accumulated space.

A good way to manage the size of your controls is to have as few as

possible. This will minimize the white space between the controls.

The following example demonstrates how to print mailing labels by using

an Access Basic function to minimize the number of controls and give you

nice, even spacing. Say you want to create mailing labels containing a

name, business name, address, city, state, and zip code. You could use

several different fields, but it would be better to use a single text box,

as in the following step-by-step example:

1. Create a single text box control with the CanGrow property set to Yes,

   and the Height property set to the height of one line of data then set

   its ControlSource property to this expression:

   =AddressBlock([Name],[Business Name],[Address],[City],[State],[ZipCode])

2. Create a new Access Basic module, and type the following code into it:

      Option Explicit

      Function AddressBlock$ (AName, Addr1, Addr2, City, State, Zip)

         Dim A1$, A2$, A3$, A4$, CR$

         CR$ = Chr(13) & Chr(10)  'Carriage return and line feed.

         A1$ = IIf(ISB(AName),"",AName & CR$)

         A2$ = IIf(ISB(Addr1),"",Addr1 & CR$)

         A3$ = IIf(ISB(Addr2),"",Addr2 & CR$)

         A4$ = City & ", " & State & " " & Zip

         AddressBlock = A1$ & A2$ & A3$ & A4$   'Concatenate the strings.

      End Function

      Function ISB (V) As Integer

         If IsNull(V) or V = "" Then ISB = True Else ISB = False

      End Function

Now you can run the module to print the labels and keep wasted space to

a minimum.

Additional reference words: 1.00 1.10 2.00 shrinking functions


PRB: Bound SubReport Does Not Show DDE Data

 Article Number: Q95441

 CREATED: 09-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The result of a DDE expression in a subreport does not display in

Print Preview or when a report is printed.

CAUSE

If the subreport is bound, there must be at least one row of data

in the underlying table or dynaset before the subreport's DDE data

will display.

RESOLUTION

There are three possible resolutions:

 - Hide the DDE expression if the dynaset for the subreport is

   empty.

 - Place the DDE expression in an unbound subreport.

 - Place the control that contains the DDE expression in the main

   report.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

 1. Start Microsoft Excel and create a new worksheet. Place the text "This

    is a test" (without quotation marks) in row 1, column 1. Save this

    worksheet as DDETEST.XLS, and leave this worksheet open.

 2. In Microsoft Access, create a new table:

       Table: Table1

       -------------

       Field Name: TXT

       DataType:   Text

 3. Create a new report bound to Table1.

 4. Add a text box bound to the field TXT by dragging TXT from the

    field list to the report.

 5. To add an unbound text box, select the text box tool from the

    toolbox and click the report. Put the following expression in

    the ControlSource property of this unbound text box:

       =DDE("Excel","DDEtest.xls","R1C1")

 6. Save this report as "SubRep" (without the quotation marks).

 7. View SubRep in Print Preview. "This is a test" displays

    correctly.

 8. Close SubRep and create a new report. Drag the report, SubRep,

    from the Database window onto this new report. Save this report as

    MainRep.

 9. View MainRep in Print Preview. "This is a test" is not visible

    on the report. Close MainRep.

10. Open Table1 and add some data to it. View MainRep in Print

    Preview. Notice that "This is a test" is now visible.

Additional reference words: 1.00 1.10 2.00


PRB: Valid Sum Function Returns '#Name?' in Calculated Control

 Article Number: Q95442

 CREATED: 09-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you open a form in Form view and have two or more calculated

controls, you may get "#Name?" in each of the calculated controls

on the form, even if the expression for that control is valid.

CAUSE

All of the domain functions are based on the same query (over the

underlying dynaset). If any of the bound functions on the form has

a binding error, all of the functions on the form return an error.

RESOLUTION

Find the control(s) that uses an invalid expression. Either remove

the control or correct the expression being used for the control.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new form based on the Orders table from the sample

   database NWIND.MDB.

2. Create a text box bound to the Freight field of this table. Set the

   following properties:

      Text Box

      ----------------------

      ControlName: Freight

      ControlSource: Freight

3. Create an unbound text box on the form. Set the following properties:

      Text Box

      -----------------------------

      ControlName: Test1.

      ControlSource: =Sum([Freight]

4. Create another text box on the form. Set the following properties:

      Text Box

      ----------------------------

      ControlName: Test2.

      ControlSource: =Sum([Test1])

5. View the form in Form view.

#Name? will appear in the second and third text boxes (Test1 and Test2).

Because you cannot use the Sum() function on a calculated expression, Test2

is invalid. This causes all calculated expressions on the form to return

"#Name?."

If you remove Test2 from the form, Test1 will display the correct value.

Additional reference words: 1.00 1.10 2.00 poundname


PRB: Focus Returns to Control After OnDblClick

 Article Number: Q95443

 CREATED: 09-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If you assign an event (such as a function or macro) to the OnDblClick

property of a control, the event is processed and the focus is returned

to the control when you double-click the control. Even if the event

contains a GoToControl action, the focus will still be returned to the

control that you double-clicked.

RESOLUTION

To move the focus to another control, use the CancelEvent action after the

GoToControl action in the macro or function.

The following sample macro demonstrates how to move the focus from Field1

to Field2 when you double-click Field1:

   Macro Name   Action        Argument

   -----------------------------------------

   Test1        GoToControl   Field2

                CancelEvent   (no arguments)

The GoToControl action moves the focus to Field2, and the CancelEvent

action cancels the double-click action, keeping the focus on Field2.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10


INF: Creating Floating Popup Menus

 Article Number: Q95444

 CREATED: 09-FEB-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article describes how to create "floating" pop-up menus using a

combination of Microsoft Windows application programming interface (API)

calls and Access Basic code.

In Microsoft Access version 2.0, pop-up menus can be created using the

Menu Builder Wizard. For more information on pop-up menus, search for

"Menu Builder" using the Microsoft Access 2.0 Help menu.

MORE INFORMATION

To create a floating pop-up menu, perform the following eight steps.

1. Create a new form called "Pop-up Menu Form."

2. Add a List Box control called "Menu" to the form. Make the control

   large enough to display each of the strings it contains without

   displaying a scroll bar. Give the control the following properties:

      List Box Properties

      ----------------------------------------------

      ControlName:   Menu

      RowSourceType: Value List

      RowSource:     String1;String2;String3;String4

      AfterUpdate:   =ItemSelected([Menu])

      Left:          0 in

      Top:           0 in

      FontName:      System

      FontSize:      8

      FontWeight:    Bold

   NOTE: Specify the menu strings in the RowSource property. Separate

   succeeding string values with a semicolon (;) character.

3. Change the properties of the "Pop-up Menu Form" as indicated below.

      Form Properties

      ------------------------------------------------

      ScrollBars:      Neither

      Popup:           Yes

      RecordSelectors: No

      Width:           <Width of the list box control>

      Section Properties

      -------------------------------------------------

      Height:          <Height of the list box control>

4. Save the form and close it.

5. Create a new module and place the following code into the

   Declarations section for the module.

      'NOTE: Some of the following Windows API functions may be

      'defined in an existing Microsoft Access library. If so, the new

      'declarations would cause a duplication procedure name error. If

      'this error occurs, remove the offending declare statement from

      'your code or convert the declaration to a comment.

      'NOTE: In the following sample code, an underscore (_) is used

      'as a line continuation character. Remove the underscore when

      're-creating this code in Access Basic.

      Option Explicit

      Type POINTAPI

         x As Integer

         y As Integer

      End Type

      Global Const GWL_STYLE = (-16)

      Global Const WS_DLGFRAME = &H400000

      Declare Sub GetCursorPos Lib "User" (lpPoint As POINTAPI)

      Declare Function GetWindowLong& Lib "User" (ByVal hWnd%,_

                          ByVal nIndex%)

      Declare Function SetWindowLong& Lib "User" (ByVal hWnd%,_

                          ByVal nIndex%, ByVal dwNewLong&)

6. Add the following functions to the module.

      Function ShowPopup ()

         Dim coord As POINTAPI

         Dim attr&

         GetCursorPos coord

         DoCmd OpenForm "Pop-up Menu Form"

         attr& = GetWindowLong(Forms![Pop-up Menu Form].hWnd, GWL_STYLE)

         attr& = SetWindowLong(Forms![Pop-up Menu Form].hWnd, GWL_STYLE, _

                    attr& And Not WS_DLGFRAME)

         DoCmd MoveSize (coord.x * 14), (coord.y * 14), , 1100

      End Function

      Function ItemSelected (WhichItem As String)

         DoCmd Close

         MsgBox "The selected item was " & Trim(WhichItem)

      End Function

7. Choose the form in which you want the pop-up menu to appear. Open

   the form in Design view.

8. Select the event property that you want to use to activate the

   pop-up menu and specify the following function call:

      =ShowPopup()

When you open your form and cause the event assigned in Step 8 above,

the pop-up menu appears at the current mouse position. The menu remains

on the screen until you select an item from the pop-up menu.

Additional reference words: 1.00 1.10


INF: Updating a Separate Table When a Value Changes on a Form

 Article Number: Q95445

 CREATED: 09-FEB-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article shows by example how to have Microsoft Access automatically

update a field in a table when you use a form to change a related field

in a different table. In other words, you can have Microsoft Access post

your changes to a separate table that is not bound to the form.

To set this up, you need to:

 - Add a text box control to the form.

 - Create a new macro group (UpdateOther) that contains two macros

   (SaveValue and ChgValue) to run the update query.

 - Create an update query (IDChgQuery in this example).

 - Change several properties to execute the macros.

MORE INFORMATION

This example uses the Products form in the sample database NWIND.MDB. Here

is the step-by-step procedure:

1. Open the NWIND.MDB database, and make a few modifications to set it up

   for this example. First, delete the relationship between the Products

   and Order Detail tables. Then, because you cannot update fields that

   have a Counter data type, change the following properties of the Product

   ID field in the Products table:

      Table: Products

      ---------------

      Field Name: Product ID

         DataType: Number

         FieldSize: Long Integer

2. Open the Products form in Design view, and display the property sheet.

   Set the following form and control properties:

      Form: Products

      --------------

      OnCurrent: UpdateOther.SaveValue

      Field: Product ID

      -----------------

      AfterUpdate: UpdateOther.ChgValue

      Locked: No

   These actions activate the macros, which in turn run the update query.

3. Add an unbound text box control to the form, and give it the following

   properties:

      Control: Text box

      -----------------

      ControlName: Previous ID

      Visible: No

4. Create a new macro group (UpdateOther) to hold two macros (SaveValue and

   ChgValue) by first choosing to create a new macro. Next, choose Macro

   Names from the View menu or click the Macro Names button on the toolbar.

   Microsoft Access displays the Macro Name column.

5. Enter the two macro names along with their actions and action arguments.

   Each macro in the macro group begins on the line that contains that

   macro's name. Use the following table as a guide:

      Macro Name   Action and Action Arguments

      ----------------------------------------

      SaveValue    SetValue

                      Item:        [Previous ID]

                      Expression:  [Product ID]

      ChgValue     SetWarnings

                      Warnings On: No

                   OpenQuery

                      Query Name:  IDChgQuery

                      View:        Datasheet

                      Data Mode:   Edit

                   SetValue

                      Item:        [Previous ID]

                      Expression:  [Product ID]

6. Save the macro group, and name it UpdateOther. Now UpdateOther appears

   in the list of macros in the Database window. You can use the following

   syntax to specify each macro in the macro group:

      macrogroupname.macroname

   For example, UpdateOther.SaveValue specifies the save value macro.

7. Create a new update query called IDChgQuery. Add the table Order Details

   to the query. In the Field cell, enter Product ID. In the Update To

   cell, enter Forms![Products]![Product ID]. In the Criteria cell, enter

   Forms![Products]![Previous ID]. Here is a SUMMARY

      Query: IDChgQuery

      -----------------

      Tables: Orders Detail

         Field:     Product ID

         Update To: Forms![Products]![Product ID]

         Criteria:  Forms![Products]![Previous ID]

Now, when using the Products form, which is bound to the Products table, if

you enter a new value in the Product ID field, Microsoft Access updates the

Product ID column in the Orders Detail table automatically. It does it by

running the UpdateOther.SaveValue macro to save the previous value to use

as criteria and then the UpdateOther.ChgValue macro to run the IDChgQuery

update query. The IDChgQuery query updates the Product ID column in the

Orders Detail table overwriting the previous old value with the new value.


PRA: Importing Delimited Text Files Strips Off Decimals

 Article Number: Q95446

 CREATED: 09-FEB-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

You import a delimited text file that contains numbers with

decimal

places, and the resulting table does not show the decimal

places.

CAUSE

When Microsoft Access creates the table, it looks at the

first record

in the file to decide which data type to assign to the

field. If the

first record contains a .00 decimal value in a field,

Microsoft Access

gives the field a Number, Long Integer data type. Then it

strips all

the decimal values when importing the file because the

Number, Long

Integer data type does not support decimal values.

RESOLUTION

There are two workarounds. The first is to create a

destination table

that already has the fields defined. Choose Number, Double

as the data

type. It supports decimal places. When you import the text

file, append

it to the existing destination table rather than allowing

Microsoft

Access to create a new table.

Alternatively, you can work around the problem by making

sure the number

fields in the first record do not contain .00 as decimal

values.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access version

1.0. This problem was corrected in Microsoft Access version

1.1.

MORE INFORMATION

If any of the fields in the first record contain numbers

that have decimal

values of .00, Microsoft Access strips the decimal places

from all the

records for the corresponding fields in the resulting table.

Steps to Reproduce Behavior

---------------------------

1. Use a text editor such as Notepad or MS-DOS Edit to

create two text

   files (FILE1.TXT and FILE2.TXT) using the following as a

guide:

      FILE1.TXT

      ---------

      234.50

      350.75

      FILE2.TXT

      ---------

      100.00

      276.93

2. Import the first file as a delimited text file and have

Microsoft

   Access create a new table. Notice that the resulting

table has the

   numbers in the correct format. The data type for this

field was

   defined as Number, Double.

3. Import the second file as a delimited text file and have

Microsoft

   Access create a new table. Notice that the resulting

table imports the

   numbers as follows:

      100

      276

Microsoft Access stripped the decimal places from the second

file because

the data type for the field was defined as Number, Long

Integer -- a data

type that does not support decimal values.

REFERENCES


PRB: '|' Isn't A Valid Path Error Message on Start

 Article Number: Q95447

 CREATED: 09-FEB-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SYMPTOMS

When trying to start Microsoft Access, you receive the following error

message:

   '|' Isn't a Valid Path

CAUSE

The drive that contains your TEMP directory does not have enough disk

space, or there is no valid SET TEMP statement in the AUTOEXEC.BAT file.

RESOLUTION

Exit from Windows. At the MS-DOS prompt, type SET and press ENTER.

This gives you a listing of the MS-DOS environment settings. Confirm

that one of the settings is TEMP= followed by a valid path.

If you find the TEMP= setting, then check the amount of disk space

available on the drive where your temporary directory resides. If you

do not have enough disk space, delete unnecessary files from the

drive or move the TEMP directory to a partition that has enough disk

space and change the SET TEMP= line in the AUTOEXEC.BAT file.

STATUS

This problem does not occur in Microsoft Access version 1.1.

Additional reference words: 1.00 WinIss


PRB: Bitmap May Not Display Correctly

 Article Number: Q95448

 CREATED: 09-FEB-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

A bitmap that displays correctly in another application does not display

correctly in Microsoft Access.

CAUSE

When Microsoft Access starts, it loads a fixed 256-color palette. This

color palette supports the most common colors used in bitmaps and

metafiles. All pictures and OLE Objects displayed in Microsoft Access

are mapped to this color palette.

STATUS

This behavior is by design.

MORE INFORMATION

By using a fixed color palette, Microsoft Access can display multiple

pictures and OLE objects on the screen at one time without each new object

affecting the screen colors.

However, Microsoft Access can display multiple bitmaps at one time.

Therefore, Because Windows can use only one palette at a time, Microsoft

Access uses a common palette that hopefully will be common to all the

bitmaps Microsoft Access might display.

This is why bitmaps and metafiles displayed in Microsoft Access may be

colored differently than they were in the application in which they were

created. Because Windows can use only one palette at a time, each object

Microsoft Access displays must be mapped to the fixed color palette loaded

by Microsoft Access. Microsoft Windows determines this mapping. You cannot

modify it.

Steps To Reproduce Behavior

---------------------------

1. Start Microsoft Paintbrush (PBRUSH.EXE).

2. Choose Image Attributes and select Black And White under the

   Color option.

3. Create a simple picture using several different shades of gray.

4. Choose Save from the File menu.

5. Under the Save File As Type option, select 256 Color Bitmap.

6. Start Microsoft Access, and open the sample database NWIND.MDB.

7. Open the Categories form in Form view.

8. Select the Picture Control.

9. Choose Insert Object from the Edit menu, and click the File button.

10. Choose the file you just created in Microsoft Paintbrush, and click the

    OK button.

Result: the file loads as a solid black picture. Microsoft Paintbrush uses

a custom palette to offer a variety of shades of gray. But Microsoft Access

does not have the ability to load or reproduce this custom color palette,

so it requests that Windows map each of the colors in the bitmap to the

custom palette that was loaded when Microsoft Access started.

This example is extreme. In most cases the color change will be slight.

Additional reference words: 1.00 1.10 appearance


PRB: Wait Argument in SendKeys May Not Stop Macro Processing

 Article Number: Q95449

 CREATED: 09-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When a macro calls the SendKeys action with the Wait parameter set

to Yes, the macro will continue before the program that processed

the keystrokes has finished performing the action that it was

called to do.

RESOLUTION

To work around this issue, have the macro call an Access Basic

function or procedure that checks to see if the other application

is finished. To correct the situation described above, you can do

the following:

   Macro Action

   ------------

   RunApp                - Start Microsoft Excel

   SendKeys              - Start the macro

   RunCode               - Call a module that continues checking until

                           the file exists

   TransferSpreadsheet   - Import the spreadsheet

MORE INFORMATION

For example, suppose you want to create a macro that will call Microsoft

Excel to make a file and then process that file once Microsoft Excel has

created it. The Microsoft Access macro calls RunApp to start Microsoft

Excel, then calls SendKeys to start a Microsoft Excel macro with the Wait

parameter set to Yes. Microsoft Access will wait until the key strokes are

processed, then continue if the Microsoft Excel macro has not finished

creating the file. Microsoft Access will not wait for Microsoft Excel, and

will fail when it tries to use the file.

The SendKeys action in Microsoft Access has two arguments: the first

argument indicates which keystrokes to send; the second argument causes

Microsoft Access to pause until the keystrokes are processed.

The description of the Wait argument on page 432 of the Microsoft Access

"Language Reference" manual is misleading. If Wait is Yes, Microsoft Access

will only wait until the keystrokes are processed. It will not wait until

the application that the keystrokes were sent to is finished.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 433-435

Additional reference words: 1.00 1.10 2.00 checkpage


PRB: Cannot Change Combo Box Value If ControlSource Is Counter

 Article Number: Q95450

 CREATED: 09-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

After setting the ControlSource property of a combo box to a field that

has a Counter data type, you try to change the value in the combo box

and receive the following status bar message:

   Control bound to counter column '<Field name>'

CAUSE

The ControlSource of a combo box is a table field where Microsoft Access

writes your combo box selection. By design, modifications to a Counter

field are not allowed. Therefore, if the ControlSource property of a

combo box is set to a Counter field, Microsoft Access cannot update the

value in the Counter field, so you cannot change the combo box value.

Microsoft Access gives you the message to tell you why it cannot update

the combo box control.

RESOLUTION

Either change the data type of the field now in the ControlSource

property of the combo box, or set the ControlSource property to a

field that does not have a Counter data type.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access, open the NWIND.MDB sample database, and create

   a new table called MyTest.

2. Add the following three fields to the MyTest table:

      Field Name     Data Type

      ------------------------

      MyCounter      Counter

      MyData         Number

      MyBucket       Number

3. Enter a few random numeric values in the MyData field. Notice that

   Microsoft Access automatically fills in the MyCounter field and puts

   zeroes in the MyBucket field as you enter values in the MyData field.

4. Create a new blank form.

5. In Design view, place a combo box on the form. Set its ControlSource

   property to the MyCounter field, and its RowSource property to the

   MyTest table.

6. Switch to Form view. Notice that the combo box values are the sequential

   numbers coming from the MyCounter field.

7. Drop down the combo box list and attempt to select a new value from

   it. You receive the following message on the status bar:

      Control bound to counter column 'The Counter'.

   The value in the combo box does not change.

8. Switch back to Design view and change the combo box ControlSource

   property from MyCounter to MyBucket.

9. Switch back to Form view and repeat step 7. Now you can select items

   from the combo box. If you look at the contents of the table, you can

   see the values you select come from the MyBucket field.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 9, "Designing

Forms," pages 235-238

Additional reference words: 1.00 1.10 2.00 errmsg


PRB: Property List Boxes Show Two-Word Options on Two Lines

 Article Number: Q95452

 CREATED: 09-FEB-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

All the list boxes that show properties use two lines to display

two-word options instead of putting each two-word option on a

single line.

CAUSE

There is an incorrect List Separator in the International section of

your WIN.INI file.

RESOLUTION

From the Main group in Program Manager, choose Control Panel. From there,

choose the International icon. Change the List Separator to a comma (,).

Now the Property list boxes in Microsoft Access will list two-word

options correctly. Note that different List Separator entries will cause

different results.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. From the Accessories group in Program Manager, choose Notepad.

2. From the File menu, choose Open.

3. In the File Name box, type "C:\WINDOWS\WIN.INI" (without quotation

   marks), and then choose OK. If your Windows directory is in a

   different path than that shown in this example, modify the path

   accordingly.

4. From the Search menu, choose Find.

5. In the Find What box, type "slist" (without quotation marks) and

   then choose Find Next. Choose Cancel.

6. Change the line in the WIN.INI file to look like this:

      sList=" "

7. Save the file, quit Notepad, and restart Windows.

8. Start Microsoft Access and open any form in Design view.

9. Select the form's DefaultView property and look at the list of

   options. The options will look like:

      Default View....Single

                      Form

                      Continuous

                      Forms

                      Datasheet

   The list should look like this:

      Default View....Single Form

                      Continuous Forms

                      Datasheet

Additional reference words: 1.00 1.10 WinIss


PRB: Moving Backward in Report Print Preview Window Is Slow

 Article Number: Q95453

 CREATED: 09-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

In the Print Preview window in reports, you can move forward and

backward page by page to view your report before printing it. When

previewing a large report, you may notice it takes longer to move

backward than it takes to move forward. The further along you are

in the report preview, the longer it takes to move backward.

CAUSE

Microsoft Access must reformat the report pages behind it when

moving backward. In other words it reformats all the pages from

page 1 to the current page minus 1.

As you preview a report in the Print Preview window, Microsoft

Access formats the report pages. It keeps the page formats in

memory until you move to a new page. Once you move past a page,

all the formats constructed to show that page are lost.

Therefore, previous pages must be reconstructed each time you

move backward.

The more pages there are between page 1 and your current page

location, the more time it takes Microsoft Access to reconstruct

them. For example, it takes less time to go from page 3 to page 2

than it takes to go from page 300 to page 299. In the first example,

only two pages need to be reformatted. In the second, 299 pages

need to be reformatted.

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10 2.00 viewing


INF: How to Send the Contents of a Control with SendKeys

 Article Number: Q95455

 CREATED: 09-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

To specify the contents of a control or field in the SendKeys action

argument, you must precede the control or field name with an equal

sign (=) in the Keystrokes argument.

MORE INFORMATION

The following example will perform a SendKeys action and send the

contents of Field0 as the argument to the action.

   Action      Keystrokes

   -------------------------------

   SendKeys    =Forms!Form1!Field0

Additional reference words: 1.00 1.10 2.00


PRB: Clicking Mouse in Wizard Background Changes Focus

 Article Number: Q95565

 CREATED: 17-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When use you the Form Wizard or the Report Wizard, you can change

the input focus by clicking the mouse in different portions of the

background in the Form Wizard or Report Wizard window. For example,

if you click the mouse at the bottom of the Form Wizard (in the

area that contains the "Cancel," "Back," and "Next" buttons),

Microsoft Access gives the input focus to a control in that colored

area.

CAUSE

The input focus changed because the Form Wizard and Report Wizard

are forms that contain a Detail section and a Footer section.

Clicking the mouse in the Footer section (that contains the

buttons) moves the input focus to the first enabled control in this

section (the tab order determines which control is first). However,

the input focus does not move if you click the mouse in the section

that contains a control that already has the input focus.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the NWIND.MDB sample database.

2. Choose Tables from the View menu.

3. Select the Categories table from the Database window.

4. From the File menu, choose New then choose Form.

5. Choose the FormWizards button. (If the FormWizard is not installed,

   the button is dimmed and unavailable.)

6. Select Single-column and then choose OK.

7. Note that the Next button does not have the focus.

8. Click the in the area at the bottom of the form (not on any of the

   buttons) and the focus shifts to the Next button.

Additional reference words: 1.00 1.10 2.00


PRB: No Field List When Form Is Based on SQL Statement

 Article Number: Q95566

 CREATED: 17-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You cannot set the RecordSource for a form to a valid SQL statement. When

you try to do so, no fields appear in the Field List dialog box.

CAUSE

When you use a SQL statement as the RecordSource for a form, Microsoft

Access cannot determine which fields will be in the resulting dynaset.

RESOLUTION

Create a query based on the SQL statement, and then set the RecordSource

for the form to the query.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Open the Category List query in Design view.

3. From the View menu, choose SQL.

4. Select the contents of the SQL window. Copy the SQL statement to

   the Clipboard by pressing CTRL+C.

5. Choose Cancel to close the SQL dialog box, then close the Category

   List query.

6. Open a new unbound form. Paste the SQL statement into the form's

   RecordSource property by pressing CTRL+V.

7. From the View menu, choose Field List. Note that no fields are

   listed.

Additional reference words: 1.00 1.10


INF: Recent File List Displays Deleted .MDB Files

 Article Number: Q95569

 CREATED: 17-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you open a database, Microsoft Access remembers that database

name and will display the name in the Recent File List under the File

menu. However, if you delete that database, the Recent File List will

continue to show it as a valid database even though it does not

actually exist. When you open other databases the list will be

updated, and the deleted file will eventually disappear from the list.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new database.

2. Close the database.

3. Delete the database using File Manager.

4. Open the File menu in Microsoft Access.

   Notice the database you just deleted is still in the File menu

   list.

Additional reference words: 1.00 1.10 2.00 Databases Misc


PRB: Error Message: Query Must Have at Least One Output Field

 Article Number: Q95573

 CREATED: 17-FEB-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SYMPTOMS

When you try to execute a query, you receive the following error

message even though the query clearly has fields in the query grid:

   Query must have at least one output field

CAUSE

One of the fields in the query grid has a colon as the right-most

character in its name (for example, LastName:). The query parser

looks for colons in a name to denote calculated fields and

misinterprets the field name as a result.

This happens only if the field name with the colon is the only field

or if all fields have colons.

RESOLUTION

Open the source table in Design view and remove the colon from the

field name. Changing the field name does not affect the data stored in

the field.

 -or-

Place square brackets around the field name in the query grid.

STATUS

This problem does not occur in Microsoft Access version 1.1.


INF: Returning Case-Sensitive Match in Queries

 Article Number: Q95605

 CREATED: 17-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access can differentiate between case sensitive text strings

using the Asc() function. Using this function in a select query,

Microsoft Access can locate an exact case sensitive match.

MORE INFORMATION

This technique is useful in a situation where the user needs to find

all the records in a field that contain lowercase text rather than

uppercase text for the first character. An example of this might be in

the Employees table of the NWIND.MDB sample database. Please note that

the example below will find only the first character. If you need

something more complex, you must call an Access Basic function to

return the results.

Suppose the text field called First Name contains values such as the

following:

   First Name

   ----------

   andrew

   Andrew

   Nancy

If you need to find all the records that contain the lower case

"andrew" as compared to "Andrew," use the Asc() function. To do this,

create a new select query:

   Query: QueryTest

   -----------------------

   Field name: First Name

      Show: True

   Field name: Asc([First name])

      Show: True

      First Criteria Line:  Asc("a")

This query will return only the record for "andrew," not "Andrew."

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, page 40

Microsoft Access "User's Guide," version 1.0, Chapter 6, "Designing Select

Queries"

Additional reference words: 1.00 1.10 2.00 chr chr$


INF: Enforcing Transactions on Attached SQL Server Tables

 Article Number: Q95607

 CREATED: 17-FEB-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access will automatically support transaction processing on

attached SQL Server tables using queries. However, explicit

transactions in Access Basic require the use of dynasets on attached

tables and further require a specific order in the creation of the

dynasets and the implementation of transaction processing.

MORE INFORMATION

Microsoft Access will enforce transaction processing on an attached

SQL Server table through the use of a dynaset created on that table.

To get more information on how to create a dynaset on an attached SQL

Server table, search for "CreateDynaset" using the Help menu. The key

to making transaction processing work for attached SQL Server tables

is to create and close the dynaset on the attached SQL Server table

outside the transaction. Below are pseudo-code examples of the

incorrect and correct methods of coding this process:

   ***INCORRECT***

   Dim MyDyna As Dynaset

   BeginTrans

      MyDyna = CreateDynaset("Table1")

      <misc.code such as Inserts/Updates/Deletes.>

      MyDyna.Close

   CommitTrans/Rollback

   ***CORRECT***

   Dim MyDyna As Dynaset

   MyDyna = CreateDynaset("Table1")

   BeginTrans

      <misc.code such as Inserts/Updates/Deletes.>

   CommitTrans/Rollback

   MyDyna.close

Additional reference words: 1.00 1.10 2.00


INF: Use a Query to Parse a Full Name into Two Fields

 Article Number: Q95608

 CREATED: 17-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

The following query parses a field containing a full name in which the

last and first names are separated by commas. For example a name could

be entered as: Smith, John. The query would return two columns named

Last: and First:. The query uses the Left$ and Right$ functions and

searches for the comma using the InStr function.

   Query: QueryTest

   ----------------

   Field: Last: Left$([Name],InStr(1,[Name],",")-1)

      Show: True

   Field: First: Right$([Name],Len([name])-InStr(1,[Name],",")-1)

      Show: True

You can modify the query to account for spaces in the name field. For

example if the name field contained Smith,John with no spaces, you

would remove the -1 for the first name field.

Additional reference words: 1.00 1.10 2.00 expressions


PRB: 'Unable to Load Communication Module'

 Article Number: Q95612

 CREATED: 17-FEB-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The following error message is displayed:

   Unable to load communication module.

   Driver has not been properly installed.

   Unable to connect to data source.

CAUSE

The error occurs because the DBNMP3.DLL file you are using may be

old, you may have duplicate DBNMP3.DLL files on your system and the

wrong one is being used, or the DBNMP3.DLL file you are using may

be damaged or corrupted.

This error can also be caused by an incorrect [SQLSERVER] entry in

your WIN.INI file. This entry should look like:

   [SQLSERVER]

   MY_SERVER=DBNMP3,\\MY_SERVER\PIPE\SQL\QUERY

If there are any spaces in the above entry, or if DBNMP3 is

misspelled, you will receive the error.

RESOLUTION

In Microsoft Access version 1.0, the DBNMP3.DLL file installed by

Microsoft Access version 1.0 is dated 9/15/92, has a size of 8241 bytes.

In Microsoft Access version 1.1, the DBNMP3.DLL file is dated 5/26/93

with a file size of 9941 bytes. In both versions, this file should be

installed in the \WINDOWS\SYSTEM directory.

MORE INFORMATION

It is possible that there are other situations that may indirectly

cause the above error message to display. To  troubleshoot this

problem, do the following:

 - Use File Manager to search for multiple, corrupted, or outdated

   copies of these files:

      Filename     Date              Size

      -----------------------------------

      ODBC.DLL     10/16/92 or later (44736 bytes)

      SQLSRVR.DLL  10/16/92 or later (135792 bytes)

      NETAPI.DLL   depends on the network being used

      COMMDLG.DLL  10/25/92 or later (89248 bytes)

      Note: The sizes and dates referenced are correct if the files

      are installed by Access version 1.0.

 - Make sure the files listed above are in their appropriate

   locations. All of the files except NETAPI.DLL are usually installed

   in the Windows \SYSTEM subdirectory. The NETAPI.DLL file is a

   network specific driver and is usually located in the network's

   program directory, which should be in the path.

 - Use another application, such as Q+E, SAF, or PowerBuilder, on the

   same machine to attempt to attach to the same data source. If you

   cannot access the data source from another application, then it is

   probably a problem with the network, such as NETAPI.DLL, or a

   problem with the server, not with Microsoft Access or ODBC.

 - Attempt to attach to another data source, if available, such as

   another SQL server. If you can attach to another server, then the

   original server may be down or you may need to reconfigure the entry

   for that server using the ODBC Administration Utility.

 - Attempt to attach to the same data source from another machine. If

   you cannot access the SQL server from another machine, it may

   indicate a network-wide problem or that the server is down or not

   communicating.

 - Try increasing your ODBC timeout settings in the ODBC section of

   the MSACCESS.INI file.

 - Check with the system administrator to see if the SQL server is up,

   available for transactions, and operating properly.

 - Reinstall ODBC after performing a clean boot and renaming the

   ODBC.DLL, DBNMP3.DLL, and SQLSRVR.DLL files.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 660-662

Additional reference words: 1.00 1.10 2.00 tshoot


PRB: Open Object Can Be Deleted by Another User

 Article Number: Q95638

 CREATED: 18-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

While one user has a form or report object open another user can

delete the object with no warning.

CAUSE

Microsoft Access does not have a record-level locking mechanism for

objects, therefore there is no way to prevent a user on one

workstation from deleting an open object on another workstation.

This problem does not occur with tables that have been opened

exclusively.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

Use a shared database on two computers (A and B).

1. On computer A, open Formx in Design view.

2. On computer B, delete Formx.

Formx is deleted with no warning.

Additional reference words: 1.00 1.10 2.00


PRB: Edit Menu Commands Unavailable in Design View

 Article Number: Q95639

 CREATED: 18-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you press CTRL and click the mouse button in Design view, all

Clipboard commands on the Edit menu are unavailable.

CAUSE

Dragging the mouse creates a contiguous selection. However, pressing

CTRL and clicking the mouse button creates a discontiguous selection.

The Cut, Copy, and Delete commands are unavailable for discontiguous

selections, even if the objects you select are contiguous.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open a table in Design view.

2. Select several fields by dragging the mouse on the row selectors.

3. Open the Edit menu. Note that the Cut, Copy, and Delete commands

   are available.

4. Close the Edit menu.

5. Select the same fields again by clicking the row selectors while

   holding down the CTRL key.

6. Open the Edit menu again. All the Clipboard commands are

   now unavailable.

Additional reference words: 1.00 1.10 2.00 gray greyed out dimmed


INF: How to Convert Currency or Numbers into English Words

 Article Number: Q95640

 CREATED: 18-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

By using four functions you can convert a currency or other numeric value

into its equivalent in English words. For example, you can change 24.50

into the following text: Twenty Four DOLLARS and Fifty CENTS.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

Note that none of the words in the result are hyphenated. That is, the

result shows Twenty Four, not Twenty-Four. Revise the code if hyphenation

is important to you.

MORE INFORMATION

The following code creates four functions: NumToWord(), GetWord(),

GetTens(), and GetDigit():

' Note: Enter each command on a single line. The underscore (_) on

' the end of some lines is a line continuation character. It's there

' to improve readability. When you enter the line, omit the underscore

' and combine all continued lines into a single line.

'****************************************************************

'Declarations section of the module

'****************************************************************

   Option Explicit

'================================================================

'*** This is the main function call

'================================================================

   Function NumToWord(NumVal)

      Dim NTW, NText, Dollars, Cents, NWord, TotalCents As String

      DIM DecPlace, TotalSets, Cnt, LDollHold As Integer

      ReDim NumParts(9) As String   'Array for Amount (sets of three)

      ReDim Place(9) As String      'Array containing place holders

      Dim LDoll As Integer          'Length of the Dollars Text Amount

      Place(2) = " Thousand "       '

      Place(3) = " Million "        'Place holder names for money

      Place(4) = " Billion "        'amounts

      Place(5) = " Trillion "       '

      NTW = ""                      'Temp value for the function

      NText = Trim(Str(NumVal))     'String representation of amount

      DecPlace = InStr(Trim(NText), ".")'Position of decimal 0 if none

      Dollars = Trim(Left(NText, IIf(DecPlace = 0, Len(NumVal),_

                                     DecPlace - 1)))

      LDoll = Len(Dollars)

      Cents = Trim(Right(NText, IIf(DecPlace = 0, 0, Abs(DecPlace - _

                                    Len(NText)))))

      If Len(Cents) = 1 Then

         Cents = Cents & "0"

      End If

      If (LDoll Mod 3) = 0 Then

         TotalSets = (LDoll \ 3)

      Else

         TotalSets = (LDoll \ 3) + 1

      End If

      cnt = 1

      LDollHold = LDoll

      Do While LDoll > 0

         NumParts(cnt) = IIf(LDoll > 3, Right(Dollars, 3),_

                                              Trim(Dollars))

         Dollars = IIf(LDoll > 3, Left(Dollars, (IIf(LDoll < 3, 3,_

                                       LDoll)) - 3), "")

         LDoll = Len(Dollars)

         cnt = cnt + 1

      Loop

      For cnt = TotalSets To 1 Step -1     'step through NumParts array

         NWord = GetWord(NumParts(cnt))    'convert 1 element of NumParts

         NTW = NTW & NWord                 'concatenate it to temp variable

         If NWord <> "" Then NTW = NTW & Place(cnt)

      Next cnt                             'loop through

      If LDollHold > 0 Then

         NTW = NTW & " DOLLARS and "       'concatenate text

      Else

         NTW = NTW & " NO DOLLARS and "    'concatenate text

      End If

      TotalCents = gettens(Cents)          'Convert cents part to word

      If TotalCents = "" Then TotalCents = "NO"  'Concat NO if cents=0

      NTW = NTW & TotalCents & " CENTS"    'Concat Dollars and Cents

      NumToWord = NTW                      'Assign word value to function

   End Function    'End NumToWord function, Return to calling program

'=================================================================

' The following function converts a number from 0 to 999 to text

'=================================================================

   Function GetWord (NumText)

      Dim GW As String, x As Integer

      GW = ""                       'null out temporary function value

      If Val(NumText) > 0 Then

         For x = 1 To Len(NumText)  'loop the length of NumText times

            Select Case Len(NumText)

               Case 3:

                  If Val(NumText) > 99 Then

                     GW = GetDigit(Left(NumText, 1)) & " Hundred "

                  End If

                  NumText = Right(NumText, 2)

               Case 2:

                  GW = GW & GetTens(NumText)

                  NumText = ""

               Case 1:

                  GW = GetDigit(NumText)

               Case Else

            End Select

         Next x

      End If

      GetWord = GW  'assign function return value

   End Function     'End function GetWord - Return to calling program

 '================================================================

 ' The following function converts a number from 10 to 99 to text

 '================================================================

   Function GetTens (TensText)

      Dim GT As String

      GT = ""           'null out the temporary function value

      If Val(Left(TensText, 1)) = 1 Then   ' If value between 10-19

         Select Case Val(TensText)

            Case 10: GT = "Ten"            '

            Case 11: GT = "Eleven"         '

            Case 12: GT = "Twelve"         '

            Case 13: GT = "Thirteen"       ' Retrieve numeric word

            Case 14: GT = "Fourteen"       ' value if between ten and

            Case 15: GT = "Fifteen"        ' nineteen inclusive.

            Case 16: GT = "Sixteen"        '

            Case 17: GT = "Seventeen"      '

            Case 18: GT = "Eighteen"       '

            Case 19: GT = "Nineteen"       '

            Case Else

         End Select

      Else                                 ' If value between 20-99

         Select Case Val(Left(TensText, 1))

            Case 2: GT = "Twenty "         '

            Case 3: GT = "Thirty "         '

            Case 4: GT = "Forty "          '

            Case 5: GT = "Fifty "          ' Retrieve value if it is

            Case 6: GT = "Sixty "          ' divisible by ten

            Case 7: GT = "Seventy "        ' excluding the value ten.

            Case 8: GT = "Eighty "         '

            Case 9: GT = "Ninety "         '

            Case Else

         End Select

         GT = GT & GetDigit(Right(TensText, 1))  'Retrieve ones place

      End If

      GetTens = GT                     ' Assign function return value.

   End Function   'End function GetTens - return to calling program

 '================================================================

 ' The following function converts a number from 1 to 9 to text

 '================================================================

   Function GetDigit (Digit)

      Select Case Val(Digit)

         Case 1: GetDigit = "One"      '

         Case 2: GetDigit = "Two"      '

         Case 3: GetDigit = "Three"    '

         Case 4: GetDigit = "Four"     ' Assign a numeric word value

         Case 5: GetDigit = "Five"     ' based on a single digit.

         Case 6: GetDigit = "Six"      '

         Case 7: GetDigit = "Seven"    '

         Case 8: GetDigit = "Eight"    '

         Case 9: GetDigit = "Nine"     '

         Case Else: GetDigit = ""      '

      End Select

   End Function  'End function GetDigit - return to calling program

How to Use the Sample Code

--------------------------

To change a currency value into English words, call the NumToWord()

function giving the number as the argument. NumToWord() calls the other

functions as needed and returns the result in English words.

There are two ways to call the NumToWord function. You can call it in

Access Basic code as follows:

   Amount = 24.50

   WordValue = NumToWord(Amount)

Or you can call NumToWord() as a parameter in a SetValue action in a macro.

For example, set Amount to 24.50 and use the following in a SetValue

action in a macro:

   NumToWord(Amount)

Additional reference words: 1.00 1.10 2.00 AB functions macros programs


PRB: Toolbox Selection Lost When Toolbox Is Closed

 Article Number: Q95641

 CREATED: 18-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The toolbox will not retain your selection when it is closed and

then reopened.

RESOLUTION

The toolbox will always be reset to the Pointer when you reopen it.

If you want your selection to be saved, choose the Lock button at

the bottom of the toolbox.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open a form in Design view.

2. From the View menu, choose Toolbox.

3. Select an item on the toolbox other than the Pointer.

4. From the View menu, choose Toolbox (this will close the toolbox).

   Note that the cursor still reflects the current tool selection as

   expected.

5. From the View menu, choose Toolbox to reopen the toolbox. The Pointer

   will be selected.

Additional reference words: 1.00 1.10


INF: SHIFT+ENTER Key Combination vs. CTRL+ENTER

 Article Number: Q95642

 CREATED: 18-FEB-1993

 MODIFIED: 03-AUG-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

To insert more than one line in a label, field, or zoom box, use the

CTRL+ENTER key combination.

The Microsoft Access "User's Guide" states on page 222 that in order

to add more lines to a label, you should use the SHIFT+ENTER key

combination. You can use this; however, CTRL+ENTER will also work  and

can be used to add more lines to text boxes and zoom boxes as well.

The SHIFT+ENTER key combination will not work with zoom boxes or text

boxes to add more lines. The SHIFT+ENTER key combination also has

other uses with Microsoft Access. For example, if you are performing

data entry, SHIFT+ENTER saves changes to the current record. The

CTRL+ENTER key combination is consistent throughout the program.

You can design a memo or text field so that the ENTER key alone

creates a new line. For more information, query on the following words

in the Microsoft Knowledge Base:

   enter and getkeystate

References:

Microsoft Access "User's Guide," version 1.0, page 222

Additional reference words: 1.00 1.10 checkpage


INF: Row Fix-up in the NWIND.MDB Order Form

 Article Number: Q95643

 CREATED: 18-FEB-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access provides an automatic "row fix-up" feature that uses

links between tables to update (fix up) records in queries and forms.

You can use this feature to enter a single value, and Microsoft Access

automatically looks up and displays other values for that record.

Row fix-up allows you to update forms and queries without using macros

or Access Basic code. This article uses the Orders form in the sample

database NWIND.MDB to demonstrate how to set up and use row fix-up.

MORE INFORMATION

To see an example of the row fix-up technique, follow these steps:

1. Open the NWIND.MDB database.

2. Open the Orders form in Form view.

3. Open the Order Information query in Design view.

Note the following about the Orders form:

1. The RecordSource property of the Orders form is set to the Order

   Information query.

2. In Microsoft Access version 1.x, the Order Information query is based on

   three tables: Orders, Customers, and Employees. In version 2.0, the

   query is based on the Orders and Customers tables.

3. The Join property between Customers and Orders tables is:

         One                          Many

      -------------------------------------------------

      CUSTOMERS.[customer id] ==>  ORDERS.[customer id]

4. The Order ID field in the query grid comes from the Orders table,

   which is on the many side of the relationship, and not from the

   Customers table, which is on the one side of the relationship. (See

   point 3, above.)

5. The Bill To combo box is based on the Customer List query. Customer

   List has the following characteristics:

   a. The query is based on the Customers table.

   b. The query returns two columns: Company Name and Company ID.

   c. The bound column is Customer ID.

   d. The visible column is Company Name.

6. Microsoft Access select queries are updatable. This means that when

   you make a change to a query's dynaset, Microsoft Access can update

   the source tables with your changes. For more information on this,

   search for "updating underlying tables," then "When is Query

   Updatable" using the Microsoft Access Help menu.

The Bill To combo box presents you with a list of company names from

the visible column of the Customer List query.

When you make a selection, the combo box stores the bound column--

the Customer ID field from the Customer List query--in the Customer ID

field in the Orders table. (See points 4 and 5d, above.) It is

important to note that the selection was stored in the many-side

table. (See point 3a, above.)

After the combo box updates the Customer ID field in the Orders table

(the many-side table), the field is changed so it no longer points to

the same record in the Customers table (the one-side table). (See point

6, above.) Note that the Orders table is updated because the query's

dynaset was changed.

Microsoft Access recognizes that the relationship no longer matches,

so it automatically updates the relationship by linking the changed

record in the Orders table with the appropriate record in the

Customers table.

All the fields in the Orders form that come from the Customers table

(the one-side table) are updated to show the values in the record for the

newly formed link.

Example

-------

When you make a change to the Bill To combo box, Microsoft Access uses

row fix-up to update the following list of fields on the Orders form:

 - [Address]

 - [City]

 - [Region]

 - [Postal Code]

 - [Country]

The following list of fields on the Orders form are not updated by Row

fix-up. However they are updated by the Orders Fill In Ship To macro

on the AfterUpdate property of the Bill To combo box:

 - [Ship Name]

 - [Ship Address]

 - [Ship City]

 - [Ship Region]

 - [Ship Postal]

 - [Ship Country]

REFERENCES

==========

The row fix-up technique is referred to as AutoLookup in Microsoft

Access version 2.0 and as  dynamic lookup in previous versions. For

more information on row fix-up, search for "dynamic lookup" using the Help

menu in Microsoft Access version 1.x or 2.0.

For more information, query on the following words here in the Microsoft

Knowledge Base:

   row and fix-up

Additional reference words: 1.00 1.10 2.00 dynamic lookup checkpage


PRB: Form Handle Not Released When Closed with Basic Code

 Article Number: Q95644

 CREATED: 18-FEB-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

After closing a form (using the Close macro action) that was opened

through Access Basic code, the file handle for the table that the

form is based on is not released. Because the file handle is not

released, no functions that require exclusive use on that table can

be executed (for example, deleting the table). When a function that

needs exclusive use of that table is executed, the following error

will occur:

   Couldn't lock table '<tablename>'; currently in use.

CAUSE

You are not guaranteed that the user interface (UI) will be synchronized

with the underlying Microsoft Access code in all cases. In this case, the

record locking is done behind the scenes. Microsoft Access releases the

table when it hits its idle loop (that is, the UI optimization).

RESOLUTION

After the form is opened in Access Basic code, insert a DoEvents

command before the function that needs exclusive use of the table,

to cause Microsoft Access to yield execution to the operating

system, so that it can process events. When the DoEvents command

occurs it allows Microsoft Access to process the pending unlock sequence.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

The following steps provide example code that reproduces this error. There

is a comment in the Access Basic code identifying where to insert a

DoEvents command to resolve this error.

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB. Create a module and enter the

   following code:

      '*************************************************************

      'Declarations section of the module.

      '*************************************************************

      Option Explicit

      '================================================================

      ' Create and save the following TempCust() function in the Module

      '================================================================

      Function TempCust()

         DoCmd SelectObject a_table, "Customers", True

         DoCmd CopyObject , "Cust2"

         DoCmd OpenForm "Customers 2", a_normal, "", "", a_edit, a_dialog

         '**** This is where the DoEvents should be inserted to fix ****

         DoCmd SelectObject a_table, "Cust2", True

         DoCmd DoMenuItem 1, 1, 4

      End Function

2. Open the Customers form in Design view, and change the RecordSource

   property to Cust2.

3. Create a command button on this form with the following  properties:

      Object: Command Button

      -----------------------

      ControlName: Close Form

         Caption: Close Form

         OnPush: ExitForm

4. Save the modified Customers form as Customers 2.

5. Create and save the following macro:

      Macro Name   Action

      -------------------

      ExitForm     Close

6. Create and save the following macro:

      Macro Name     Action     Argument

      ------------------------------------

      OpenCustForm   RunCode    TempCust()

7. From the Database window, run the OpenCustForm macro that you just

   created. The Customers 2 form will open.

8. Click the Close Form macro button on this form. You will receive a

   dialog box that asks:

      Delete Table 'Cust2'?

9. Choose OK. You will receive the following error message:

      Couldn't lock table 'Cust2'; currently in use.

Additional reference words: 1.00 1.10


PRB: No AutoRepeat with GoToRecord/Next and DoMenuItem

 Article Number: Q95645

 CREATED: 18-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The AutoRepeat property for command buttons does not work in

conjunction with the GoToRecord/Next macro action for moving to

successive records on a form. In other words, if your form uses

command buttons instead of the record selector buttons to move

from record to record, the AutoRepeat property does not repeatedly

execute a macro that performs a GoToRecord/Next action.

Also, the AutoRepeat property fails under the same circumstances

when using the DoMenuItem/Form/Records/GoTo/Next macro action. To

re-execute the macro, you must click the command button again.

CAUSE

This is correct behavior for these macro actions. Here are two

points that need clarification before the cause can be explained:

1. OnPush property: The macro under the OnPush property of a

   command button normally will not execute until you push and let up

   the command button with the mouse pointer in the Command

   Button's region. The exception is when the command button's

   AutoRepeat property is set to Yes. In this case, the macro under

   the OnPush property of the command button executes when the

   button is pushed and the mouse pointer is in the Command

   Button's region.

2. Focus: Several macro actions change the focus. For example,

   GoToControl, GoToRecord, OpenForm, OpenTable, and ApplyFilter all

   change the focus.

Therefore, if a command button's OnPush property macro changes

the focus to, for example, the next record, then the command

button has lost the focus. That is, when you click the command

button, the click does not apply to that command button anymore

because the focus changed. It's as if you had moved the mouse

pointer off the command button while pressing the mouse button,

as if the command button moved out from under the mouse pointer

right before you pressed the mouse button.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

 1. Start Microsoft Access.

 2. Open the sample NWIND.MDB database.

 3. Create a new macro with two actions (OpenTable and GoToRecord). Use

    the following as a guide to assign action arguments to each action:

       OpenTable

       ------------------------

       Table Name:   Categories

       View:         Datasheet

       Data Mode:    Edit

       GoToRecord

       ------------------------

       Object Type:  Table

       Object Name:  Categories

       Record:       Next

 4. Close, save, and name the macro.

 5. Open a new form and click the Blank Form button.

 6. Drag the macro you just created onto the blank form to create a

    command button.

 7. Set the AutoRepeat property of the command button to Yes. Notice

    the command button's OnPush property is set to the name of the

    macro.

 8. Change to Form view to browse the form. As a result, you should see

    a single command button on the form.

 9. Click the command button. Now you should see the Categories table.

10. Size the Categories table so that both the form and the table fit on

    the screen and you can see the VCR button on the table.

Each time you click the command button, the record selector moves to

the next record. When you click and hold down the command button, you

would expect Microsoft Access to scroll rapidly to the last record in

the table, but this does not happen. Instead, the record selector moves

to the next record only, regardless of the AutoRepeat property setting

of the command button.

However, if you place a macro that uses a different macro action such as

Beep on the form, the AutoRepeat action works as expected. This is because

Beep does not change the focus.

Additional reference words: 1.00 1.10 2.00


PRB: Setup Program STFSETUP.EXE Causes GP Fault

 Article Number: Q95646

 CREATED: 18-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The Microsoft Access Setup program displays the following error

message immediately after trying to update an old version of the

Windows Help file (WINHELP.HLP):

   General Protection Fault (GPF) in STFSETUP.EXE

CAUSE

The current WINHELP.HLP or WINHELP.EXE files in the Windows directory

are corrupt. These corrupt files cause a general protection (GP) fault

when you run the Microsoft Access Setup program to update the Help file.

RESOLUTION

Rename the WINHELP.EXE and WINHELP.HLP files in the Windows directory to

some other names. Then reinstall Microsoft Access. The Setup program will

place new Help files in the Windows directory.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10 UAE unrecoverable application


INF: How to Play .WAV Sounds on Events in Microsoft Access

 Article Number: Q95647

 CREATED: 18-FEB-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access does not have a built-in function to play sound files

on events, such as when a form is opened or closed. However, you can

use the Microsoft Windows 3.1 application program interface (API)

through Access Basic code to create a user-defined function to play

sound files.

This article assumes you are familiar with Access Basic and Windows

APIs. In this article, the use of error trapping has been omitted to

keep the information as clear and concise as possible.

MORE INFORMATION

Follow these steps to create a user-defined function to play sound

files:

1. Create a new module with a single function named PlaySound().

   Note: In the following sample code, an underscore (_) is used as

   a line-continuation character. Remove the underscore when

   re-creating this code in Access Basic.

   '*****************************************************************

   'Declarations section of the module.

   '*****************************************************************

   Option Explicit

   Declare Function sndplaysound% Lib "mmsystem" (ByVal filename$,_

                                                  ByVal snd_async%)

   '==================================================================

   ' The following function PlaySound calls the Windows API function

   '==================================================================

      Function PlaySound (msound)

         Dim XX%

         XX% = sndplaysound(msound, 1)' play mmwave sound

         If XX% = 0 Then MsgBox "The Sound Did Not Play!"

      End Function

2. Save the module as Play It Sam.

   The following steps use a command button to trigger the sound, but

   you can use other events to trigger the sound.

3. Add a command button to a form you want to play the sound from.

   Object: Command Button

   -------------------------------------------

   ControlName: Push_Button_1

   Caption: Play Chimes

   OnPush: =PlaySound("C:\WINDOWS\CHIMES.WAV")

   (Where C:\WINDOWS\ is the location of the sound file and CHIMES.WAV

   is the sound file.)

When the form is open in Form view, the sound is ready to play by

clicking the command button. You can assign this function to the

form's OnOpen event if you want chimes to play when you open a form.

NOTE: This example does not have error trapping. Unexpected results

may occur if the sound file is not in the location specified or does

not exist.

If the sound (.WAV file) is in the table as an OLE field, the sound can be

added to the form out of the field list. You can then use a macro that

does a GoToControl [olefield], DoMenuItem form-edit-object-<verb>. You can

run this from a button on the form. It will go to the OLE field and edit

the object (the default edit is play for a sound).

REFERENCES

==========

Microsoft Access "Introduction to Programming," Chapters 1-5

"Microsoft Windows Software Development Kit," Microsoft Press, 1992

"Programming Windows: the Microsoft Guide to Writing Applications for

Windows 3", Charles Petzold. Microsoft Press, 1990

"Programmer's Reference Library: Microsoft Windows 3.1 Guide to

Programming Reference," Volumes 1 - 6, Microsoft Press, 1992

Additional reference words: 1.00 1.10 2.00 sound


INF: Explanation of the KeepTogether Property for Sections

 Article Number: Q95648

 CREATED: 18-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Form and report sections have a KeepTogether property that you can set

to Yes or No. The KeepTogether property setting for sections determines

whether Microsoft Access prints the controls located in that section on a

single page or on more than one page.

The section's KeepTogether property affects the controls located in

that section, for a single record.

MORE INFORMATION

If the KeepTogether property is set to yes, Microsoft Access begins

printing the controls located in that section at the top of the next

page if it cannot print all of the controls on the current page. If it

is set to no, Microsoft Access prints as many controls as it can on

the current page and continues printing them on the next page.

If all the controls in a section require more than one page for a

single record, Microsoft Access continues printing on a second page

regardless of the KeepTogether setting.

For example, say the detail section of a report has its KeepTogether

property set to Yes and all the controls in that section will not fit on

the current printed page. In this case, Microsoft Access prints none

of the controls on the current page. Instead, it begins printing the

controls at the top of the next page. If it turns out the section

requires more than a single page, Microsoft Access ignores the

KeepTogether property value and continues printing the controls at the

top of the next page.

The KeepTogether property affects the controls in a form or report

section for a single record -- not groups of records. The KeepTogether

property will not keep all the grouped records together, and it will not

avoid the problem of abandoned group headers left on the bottom of a

printed page.

Several other articles can help you learn how to create a label that

will print at the top of each report page when a group of records span

more than one page. To find these articles, query on the following

words here in the Microsoft Knowledge Base:

   access and continued and new and page

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 313-314

Additional reference words: 1.00 1.10 2.00 checkpage


PRB: Short Label Autosizes to Cursor Size

 Article Number: Q95649

 CREATED: 18-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When in Design view you create a new label on a form and the label

height is shorter than the cursor size, the control will autosize

to the height of the cursor.

STATUS

The autosizing of the cursor in a label to a default height is by

design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new database.

2. Create a new form.

3. Open the form in Design view.

4. Place a label on the form and size it to a height smaller than the

   height of the cursor.

5. Place the cursor in the text box to enter text.

   The control will resize larger to the height of the cursor.

Additional reference words: 1.00 1.10 2.00


PRB: Edit Find Dialog Box Is Modal in Form View

 Article Number: Q95651

 CREATED: 18-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you are in the Edit Find dialog box in Microsoft Access, you

cannot switch focus back to the form. The Edit Find dialog must be

cleared before you can continue working with the form.

CAUSE

The Edit Find dialog box is modal. When you open a modal form, you

cannot access any other Microsoft Access objects until you close or

hide the form.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access and open a database.

2. Open a form with an editable field (for example, a text box) in

   Form view.

3. From the Edit menu, choose Find.

At this point you will be unable to shift focus back to the form. You

must choose the Close button in the Edit Find dialog box.

Additional reference words: 1.00 1.10 2.00


PRB: Unfreeze All Columns Does Not Restore Column Order

 Article Number: Q95805

 CREATED: 25-FEB-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you open a database, view a form in Datasheet view, and then choose

Freeze Columns from the Layout menu (Format menu in Microsoft Access

version 2.0), the column your cursor is in moves to the far left and is

separated by a bold black bar, as expected. However, if you then choose

Unfreeze All Columns from the Layout menu, the order of the columns will

not be restored.

CAUSE

Frozen columns are moved to the "frozen" area. They are not put

back in their original position because many other things may

have changed since the columns were originally frozen.

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10 2.00


INF: How to Skip Used Mailing Labels and Print Duplicates

 Article Number: Q95806

 CREATED: 25-FEB-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to print multiple copies of the same mailing

label, and how to use a partially used page where only some of the labels

are available.

To make use of this article, you need to be familiar with Access Basic and

know how to design Microsoft Access reports.

MORE INFORMATION

Printing Multiple Copies of the Same Label

------------------------------------------

When you choose Print from the File menu, you can choose to print multiple

copies of the same report. But when you try to print a single mailing

label 20 times, Microsoft Access prints one label on each of 20 pages.

On a dot matrix printer, using single column labels, you can work around

this problem by defining each label as a separate page. However, you

cannot use this method for laser printers or multiple-column labels. To

solve this problem, use the step-by-step procedure described below.

Using Labels that Would Otherwise Be Wasted

-------------------------------------------

After printing labels, you usually end up with a partially used last page.

There is no built-in mechanism in Microsoft Access to use the remaining

labels on a partially used page. Microsoft Access always starts on a new

page. On a dot matrix printer, you can adjust the top of form manually. But

you cannot do that on laser printers. To solve this problem, use the

step-by-step procedure described below.

Step-by-Step Procedure to Solve Both Problems

---------------------------------------------

The Microsoft Access report generator provides powerful hooks that allow

control over the finished product. By calling a function from the OnFormat

property of the report's detail section, you can alter the MoveLayout,

NextRecord, and PrintSection properties to leave blank spaces or print

multiple copies on the same page.

The code listed below is generic. You can attach it to any Mailing Label

report to print multiple copies and to skip used labels if needed. To use

the example, you need to have a mailing label report called MyLabels.

1. Create a new module, and place the following lines in the declaration

   section:

   '*********************************************************

      'Declarations section of the module.

   '**********************************************************

   Option Compare Database

   Option Explicit

   Dim LabelBlanks&

   Dim LabelCopies&

   Dim BlankCount&

   Dim CopyCount&

   '==========================================================

      ' The following function will cause an inputbox to

      ' display when the report is run that prompts the user

      ' for the number of used labels to skip and how many

      ' copies of each label should be printed.

   '===========================================================

   Function LabelSetup ()

      LabelBlanks& = Val(InputBox$("Enter Number of blank labels to skip"))

      LabelCopies& = Val(InputBox$("Enter Number of Copies to Print"))

      If LabelBlanks& < 0 Then LabelBlanks& = 0

      If LabelCopies& < 1 Then LabelCopies& = 1

   End Function

   '===========================================================

      ' The following function sets the variables to a zero

   '===========================================================

   Function LabelInitialize ()

      BlankCount& = 0

      CopyCount& = 0

   End Function

   '===========================================================

      ' The following function is the main part of this code

      ' that allows the labels to print as the user desires.

   '===========================================================

   Function LabelLayout (R As Report)

      If BlankCount& < LabelBlanks& Then

         R.NextRecord = False

         R.PrintSection = False

         BlankCount& = BlankCount& + 1

      Else

         If CopyCount& < (LabelCopies& - 1) Then

            R.NextRecord = False

            CopyCount& = CopyCount& + 1

         Else

            CopyCount& = 0

         End If

      End If

   End Function

2. Open the report named MyLabels in Design view and add the following line

   to the OnFormat property of the Detail section:

      OnFormat: =LabelLayout(Reports![MyLabels])

3. Add the following line to the OnOpen property of the MyLabels Report:

      OnOpen: =LabelSetup()

4. Although typically labels do not have a report header, choose Report

   Hdr/Ftr from the Layout menu to add a report header and footer. Then

   Add the following line to the OnFormat property of the report header:

      OnFormat: =LabelInitialize()

5. Set the Height property for both the report header and report footer

   to 0.

When you print the report, the report calls the LabelSetup() function,

which first asks you to enter the number of used labels to skip on the

first page (BlankCount) and then asks how many of each label you want

printed (CopyCount).

When the report header is formatted, it calls the LabelInitialize()

function, so when you switch from preview to print, the BlankCount and

CopyCount fields are set to zero. As each label is formatted, the

LabelLayout() function adjusts the NextRecord and MoveLayout properties

to skip used labels and print the desired duplicates.

Additional reference words: 1.00 1.10 2.00 checkpage


INF: Checking for Last Or First Record in a Macro

 Article Number: Q95807

 CREATED: 25-FEB-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

In a macro, you cannot check the result of an action just performed. As a

result, you can run into a problem when using a macro to move to the next

record or the previous record. There is no record previous to the first

record and no next record following the last record. If you attempt to go

to the previous or last record when there is none, Microsoft Access

displays error messages that may confuse users of a custom application.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools

provided with Microsoft Access. For more information on Access Basic,

please refer to the "Introduction to Programming" manual.

MORE INFORMATION

You can work around this on a form by using Access Basic functions to

move from record to record. For example, use the following custom

MoveToNext() function to move to the next record or previous record on a

form:

   Option Explicit

   Function MoveToNext (DisplayMsg$, MoveForward%)

      Dim MyDyna As Dynaset

      Set MyDyna = Screen.ActiveForm.Dynaset

      MyDyna.Bookmark = Screen.ActiveForm.Bookmark

      If MoveForward% Then

         MyDyna.MoveNext

      Else

         MyDyna.MovePrevious

      End If

      If MyDyna.EOF Or MyDyna.BOF Then

         MsgBox DisplayMsg$

      Else

         Screen.ActiveForm.Bookmark = MyDyna.Bookmark

      End If

   End Function

To use the MoveToNext() function, specify the following:

 - The name of the function.

 - The message you want displayed if the current record is at the end or

   the beginning of the record set.

 - "True" if you want to move to the next record. "False" if you want to

   move to the previous record.

For example:

   OnPush: =MoveToNext("You are at the end of the record set", True)


PRB: Error Occurs in Print Preview Without Driver

 Article Number: Q95901

 CREATED: 01-MAR-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You receive the following error message when you choose Print Preview with

a form selected:

   An error occurred while attempting to retrieve printer

   information for the <printer name> on <printer port>.

CAUSE

The error occurs because the form was created with a specific

printer driver and that printer driver no longer exists in the

system.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new form.

2. Before saving the form, choose Print Setup from the File menu, and

   set Specific Printer to something other than default.

3. Close and save the form as Test Form.

4. Open Windows File Manager.

5. Locate the driver for the specific printer you selected in Print

   Setup (drivers are usually located in the \WINDOWS\SYSTEM

   subdirectory).

6. Select the driver and temporarily rename the file.

7. Select Test Form in the Database window.

8. From the File menu, choose Print Preview.

An error message about the missing printer driver will be displayed.

The problem is that normally COMMDLG.DLL performs a test to determine

if you have an incorrect printer. When you choose Print Preview, you

do not go through COMMDLG.DLL. If, on the other hand, you choose

Print you will get the more descriptive error message produced by

COMMDLG.DLL:

   This document was previously formatted for the printer

   <Previous Printer Name> on <PORT>, but that printer is not available.

   Use the default printer <Default Printer Name> on <PORT>.

Additional reference words: 1.00 1.10 2.00 PtrIss errmsg


PRB: Two Accelerator Keys in Custom Menu Show Only First Key

 Article Number: Q95902

 CREATED: 01-MAR-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SYMPTOMS

When you create a custom menu, if you define two accelerator

keys

in the MacroName grid, the drop-down menu will show the

second one

as the accelerator, but the first one will actually run the

macro

action.

CAUSE

This behavior is a function of Windows. Microsoft Access

does not

do syntax checking on menu strings, so if Windows receives a

menu

string with extra accelerators, the above symptoms will

result.

RESOLUTION

Only define one accelerator key for a menu item.

MORE INFORMATION

Steps to Reproduce Behavior

--------------------------

1. In the sample database NWIND.MDB, create a new macro

called MyMenu with

   the one following action:

      Macro Name      Action    Argument

      ----------------------------------

      D&o &This       MsgBox    Message: Any text message

here

2. Open the Orders macro, and create a new macro name called

OnMenu

   with one action:

      Macro Name      Action

      ----------------------

      OnMenu          AddMenu

      Add Menu Actions

      -------------------

      Menu Name:   &File

      Menu Macro:  MyMenu

3. Open the Orders form. Attach the macro "Orders.OnMenu"

macro to the

   OnMenu property of the form.

4. Close the Orders form, save it, and reopen it.

5. Press ALT+F to drop the custom File menu. Note that the

"T" in "Do

   This" is shown as the accelerator key.

6. Press the T key. Notice that nothing happens.

7. Press the O key.

   The message box will be displayed.

Additional reference words: 1.00 1.10


INF: Filling a Multiple-Column List Box Using Access Basic

 Article Number: Q95903

 CREATED: 01-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

You can use Access Basic to fill in the information for a list box or

a combo box. On pages 82-85 of the Microsoft Access "Introduction to

Programming" manual, an example is given on how to fill in a

single-column list box. You can also use Access Basic to fill in a

multiple-column list box or combo box.

MORE INFORMATION

To create a multiple-column list box, you must set Code 4 in the

Select Case statement to the number of columns that you want in your

list box. In Code 6 of the Select Case statement, define the data that

will display in each column and row of the list box. The following

code is based on the example on page 84 of the Microsoft Access

"Introduction to Programming" manual:

'*********************************************************************

'Declarations section of the module

'*********************************************************************

Option Explicit

'=====================================================================

'The following function uses a select case statement to fill a

'two-column and four-row list box. The function fills the first column

'of the list box with the dates of the next four Mondays. The second

'column is filled with the dates of the next four Tuesdays.

'=====================================================================

Function ListMonTuesdays(fld As Control, id, row, col, code)

   Dim offset

   Select Case Code

     Case 0                          'Initialize.

       ListMonTuesdays=True

     Case 1                          'Open.

       ListMonTuesdays=id            'Unique ID number for control

     Case 3                          'Number of rows.

       ListMonTuesdays=4

     Case 4                          'Number of columns.

       ListMonTuesdays=2

     Case 5                          'Column width.

       ListMonTuesdays=-1            'Use default width.

'===============================================================

'In the next Case statement:

'

' Offset is the formula for finding the next four Mondays.

' If column=0, then fill in with the dates for the next four

' Mondays in column 1. If column=1, then fill in with the dates

' for the next four Tuesdays in column 2.

'===============================================================

     Case 6                          'Get Date

       Offset=abs((9-Weekday(Now))Mod 7)

       If col=0 then

          ListMonTuesdays=Format(Now()+offset+7*row,"mmmm d")

       Else

          Offset=abs((10-Weekday(Now))Mod 7)

          ListMonTuesdays=Format(Now()+offset+7*row,"mmmm d")

       End if

    End Select

End Function

REFERENCES

==========

Microsoft Access "Introduction to Programming," version 1.0, pages 82-85

Additional reference words: 1.00 1.10 2.00 checkpage


PRB: Error Message: Cannot Change Working Directory to Default

 Article Number: Q95904

 CREATED: 01-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you start Microsoft Access, you may receive the following error

message

   Couldn't change working directory to <Default Database Directory>.

   Click OK or press ENTER to continue.

where <Default Database Directory> is the path that appears as the

Default Database Directory property in the Items box when you choose

Options from the View menu.

Choosing OK or pressing ENTER opens Microsoft Access.

CAUSE

You receive this error message if any of the following is true about

the Default Database Directory property:

 - The property is not pointing to a valid path.

 - The path is longer than 64 characters.

 - In version 1.x, if the property is a period (.), there is one space

   before it. This problem does not occur in version 2.0.

RESOLUTION

Make sure that the path shown in the Default Database Directory

property does not exceed 64 characters and that no leading space

precedes a period, if a period is present.

MORE INFORMATION

To check the default directory for Microsoft Access, complete the

following steps:

1. Start Microsoft Access and open any database.

2. From the View menu, choose Options.

3. In the Category box, select General. In the Items box, select

   Default Database Directory.

Normally, during Microsoft Access installation, the default directory

is set to ".", which represents the Microsoft Access Startup

directory.

You can also set a default directory to ".\subdir" and it will set the

default to a subdirectory under the Microsoft Access startup directory

called "subdir." Or you can specify a complete path.

Additional reference words: 1.00 1.10 2.00 errmsg period default


PRA: Form Record Selector Buttons Disabled

 Article Number: Q95905

 CREATED: 01-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You are unable to choose the record selector buttons in the bottom,

left-hand corner of the form.

RESOLUTION

You can design your own record selector buttons such as those used

in the sample database ORDENTRY.MDB that is shipped with Microsoft

Access.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version

2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Create a GotoControl macro that goes to any one of the controls on

   the form.

2. Assign the macro to the OnCurrent property of the form.

3. Open the form in Form view. The control that your macro refers to

   must be on the form.

4. From the Records menu, choose Edit Filter/Sort.

5. Drag any field onto the grid.

6. From the Records menu, choose Apply Filter/Sort.

7. Click the record selector buttons at the bottom of the form to see

   that these buttons are now disabled.

Additional reference words: 1.00 1.10 vcr


PRB: Scroll Bars Displayed for a Subform in Datasheet View

 Article Number: Q95906

 CREATED: 01-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you set the ScrollBars property to Neither on a subform, the

scroll bars may not be disabled in Datasheet view.

CAUSE

This will happen because you have more information than will fit in

the frame created for the subform. Thus, Microsoft Access  creates

scroll bars so you can view all the data. If your frame is larger

than the amount of data that will be shown in your subform, the

scroll bars will be correctly disabled.

RESOLUTION

Make the frame for your subform large enough to hold all the data

that will be displayed within the datasheet.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a subform.

2. Switch the DefaultView property to Datasheet, and set ScrollBars to

   Neither.

3. Add the subform to a main form.

4. Switch to Form view.

Note that the scroll bars still exist.

Additional reference words: 1.00 1.10 2.00


INF: How to Get the Last Two Digits of the Year

 Article Number: Q95907

 CREATED: 01-MAR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to display only the last two digits of the

year. The expression

   =Year(Now())

displays all four digits of the current year (for example, 1993).

In order to display only the last two digits of the year (for example,

93), use one of the following expressions:

   =Format(Now(),"yy")

   -or-

   =Right(Str(Year(Now())),2)

The breakdown of expression 2 is:

 - Now() returns the today's date and time.

 - Year(Now()) returns the current year.

 - Str(...) converts the date to a string data type.

 - Right(...,2) returns the right two characters.

REFERENCES

==========

For more information on the first expression, search for "formatting dates"

then "Format Property-Date/Time Data Types" using the Microsoft Access Help

menu.

For more information about the elements in the second expression, search

for "year," "right," "str," or "now" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


PRA: SHIFT+HOME Does Not Select All the Text

 Article Number: Q95908

 CREATED: 01-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

In the property sheet, when you press SHIFT+HOME, Microsoft Access

should highlight the text to the beginning of the line but does not.

This problem occurs only when there is a large amount of text in the

property. The same problem can occur with SHIFT+END.

CAUSE

The HOME and END keys do not work correctly with more than 20 inches

of text in a text box or property box.

RESOLUTION

To work around the problem, press CTRL+SHIFT+HOME or CTRL+SHIFT+END.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1, and 2.0. We are researching this problem and will post new

information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Type a large amount of text into the ControlSource property of

   a text box control.

2. Press SHIFT+HOME to highlight all the text to the beginning of the line.

3. Press SHIFT+LEFT ARROW, and note that more text can be highlighted.

Additional reference words: 1.00 1.10 2.00


PRB: Error Message "Couldn't Find Input Table or Query"

 Article Number: Q95909

 CREATED: 01-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you run a query, the following error message is displayed:

   Couldn't find input table or query '<Object name>'.

When you open the query in Design view, the field list is empty, but

the query grid still refers to deleted tables or fields.

CAUSE

The query refers to a deleted table or query.

STATUS

This behavior is by design. The query will continue to refer to the

deleted table or fields so that you can determine what was deleted.

Modify your query so that it refers to tables or fields that do exist

after making this determination.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new table with one field. Save the table as Table1.

2. Create a new query based on Table1. Drag the field from the field

   list to the query grid.

3. Save the query as Query1.

4. In the Database window, delete Table1.

5. Open Query1. You will receive the error message listed above. Open

   the query in Design view. Note that although the field list is

   empty, the query grid still refers to the deleted table and field.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.1, Chapter 5, "Query Basics"

Microsoft Access "User's Guide," version 2.0, Chapter 10, "Query Basics"

Additional reference words: 1.00 1.10 2.00 errmsg


PRB: Cursor Position Unchanged in Undo Paste Command

 Article Number: Q95910

 CREATED: 01-MAR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you choose the Edit Undo Paste command in the Module window,

the text is deleted but the cursor does not return to its original

position.

CAUSE

The Undo function in Microsoft Access is very basic. It only

remembers the changes to a line that have not been committed to a

module. It does not maintain information on cursor position.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Open the Introduction to Programming module. In the Procedure box,

   select ActionQuery.

3. Select any line of text within the Module window.

4. From the Edit menu, choose Copy.

5. In the Module window, place the cursor at the end of the line "Set

   db = OpenDatabase(dbName)". Choose Paste from the Edit menu.

   Note the position of the cursor (at the end of the string of text).

6. From the Edit menu, choose Undo. The text will be deleted, but the

   cursor will not return to the end of the line where you started the

   paste. It will return to the beginning of the line on which the

   paste was made.

Additional reference words: 1.00 1.10 2.00 WinIss


INF: Calculated Fields Must Be Shown to Perform Calculations

 Article Number: Q95911

 CREATED: 01-MAR-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

If you have a calculated field named Field1 in a query, and you have

another field that is performing a calculation based on Field1, then

Field1 must be checked to Show in the query grid.

MORE INFORMATION

The following example assumes that you have a table that contains a

field named Field1.

1. Create the following query:

      Query: QueryTest

      --------------------------------

      Field Name: Field1: (1+2)

         Show: False

      Field Name: Field2: (Field1 + 5)

         Show: True

2. Run the query.

You will receive a parameter prompt for Field1. Field1 must be included in

the query's dynaset in order for the calculation in Field2 to be performed

correctly.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 6, "Designing

Select Queries," pages 148-149

Additional reference words: 1.00 1.10 2.00 Queries expression


PRB: DDE App Name for Access Is Incorrect in Manual

 Article Number: Q95912

 CREATED: 01-MAR-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You will not be able to initiate a dynamic data exchange (DDE) link with

Microsoft Access if the application name is incorrectly specified as

"ACCESS". Instead, an error message will be generated. For example, in

Microsoft Word for Windows, the error message generated is:

   The remote nwind (System) is not accessible. Do you want to start

   the application Access?

CAUSE

On page 141 of Microsoft Access "Introduction to Programming," the app name

for Microsoft Access is incorrectly listed as Access. It should be listed

as MSACCESS.

RESOLUTION

The correct app name to use when referring to Microsoft Access in a

DDE conversation is MSACCESS.

REFERENCES


PRB: Graph Object Is Dimmed in Form View

 Article Number: Q95913

 CREATED: 01-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A Microsoft Graph object appears gray, or dimmed, in Form view.

CAUSE

If the RowSource property for a Graph object is invalid, the graph will be

dimmed.

RESOLUTION

To work around the problem, make the RowSource property valid.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new unbound form.

2. From the Edit menu, choose Insert Object. In the Object Type box,

   select Microsoft Graph, then choose OK.

3. Update the graph to Microsoft Access by closing Microsoft Graph and

   choosing Yes to update Microsoft Access.

4. Change the following properties of the object frame:

      Object: Object Frame

      --------------------

      Scaling: Scale

      RowSourceType: Value List

      RowSource: Title;AAA;H1;H2;H3;1;2;3

      ColumnCount: 3

5. From the View menu, choose Form. Note that the graph is gray.

The problem is that the RowSource property contains eight values and the

Column Count is 3. To correct the graph, add another value.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 13, "Using

Pictures, Graphs, and Other Objects," pages 327-330

Additional reference words: 1.00 1.10 2.00 grey checkpage


PRB: No Arrows on Scroll Bars if Window Is Larger than Form

 Article Number: Q95914

 CREATED: 01-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you create a form and set the form property sheet to allow scroll

bars, you may not see the scroll bars when you switch to Form

view.

CAUSE

If the details section of a form is designed so that all the

controls fit within the form, Microsoft Access will not display the

scroll bars. However, the scroll bars will display if the Form

window is sized smaller than the details section.

STATUS

This behavior is by design.

MORE INFORMATION

The purpose of the scroll arrows is to view parts of the form that are

sometimes not visible if the Form window is too small. You cannot

scroll to the next record with scroll bars, only with record

selectors.

Steps to Reproduce Behavior

---------------------------

1. Open a bound form in Design view and display the property sheet.

2. Set the DefaultView property for the form to Single Form.

3. Set the ScrollBars property to Both.

4. View the form in Form view.

5. Size the Form window so that all of the controls and fields are

   visible. The scroll bars should not be visible at this point.

6. Size the form so that you cannot see all of the controls and fields.

   The scroll bars should now be visible.

Additional reference words: 1.00 1.10 2.00


PRB: Error Message: Must Run SETUP /A Before Running SETUP

 Article Number: Q95915

 CREATED: 01-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you attempt to set up a workstation for Microsoft Access using

the SETUP /N command, you receive the following error message:

   You must run SETUP /A before running SETUP /N

CAUSE

When the network server was set up, the command SETUP /A was issued

from a temporary installation directory on the hard disk, rather than

from the installation floppy disks.

RESOLUTION

Run SETUP /A from the installation disks in the floppy disk drive to

set up the network server. Then you can run SETUP /N from the

workstations.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10 errmsg setup


PRB: ErrMsg: CREATE TABLE Permission Denied in Export to SQL

 Article Number: Q95916

 CREATED: 01-MAR-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you export a table from Microsoft Access to Microsoft SQL

Server, the following error message is displayed

   [Microsoft][ODBC SQL Server Driver][SQL Server] CREATE TABLE

   permission denied, database <database>, owner <owner> [#262]

where <database> is the database you were trying to export the table

to and <owner> is the SQL Login ID of the owner of the database.

CAUSE

You do not have permission to use the SQL command CREATE TABLE in

the database you are exporting the table to.

RESOLUTION

To correct this problem, the SQL system administrator or the owner of

the database must grant you CREATE TABLE permission in the database

you were trying to export the table to.

NOTE: Permissions cannot be granted through Microsoft Access versions 1.0

or 1.1.  You can use a SQL pass-through query in Microsoft Access version

2.0 to administer permissions if you have the rights to do so on the SQL

Server.

Additional reference words: 1.00 1.10 2.00 export errmsg


INF: Concatenating Fields in a Text box to Remove Blank Lines

 Article Number: Q95917

 CREATED: 01-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to concatenate multiple fields for use in a

form or report. This is especially useful in a mailing label report

when some fields are null or empty. Null fields can cause blank lines

to be printed on a report. Additionally, from a form, you may want to

be able to copy and paste an entire name and address into another

application like Microsoft Word for Windows.

Using the IIF() and the IsNull() functions, you can determine if a

field is blank. If a field is blank, it returns an "empty" value.

Chr(13) and Chr(10) are used to add a return and a line feed to the

text box.

MORE INFORMATION

The following steps can be used to create a concatenated field

eliminating blank lines. In this example, the Employees Table from

the sample database NWIND.MDB is used.

1. Create a new form or a report. Create your report based on the

   table or query where the information resides.

2. Add a text box control to the form/report.

   NOTE: In the following example, an underscore (_) is used as a

   line-continuation character. Remove the underscore when re-creating

   this expression.

   Object: Text Box

   ----------------

   ControlName:  Full Address

   ControlSource:

      =IIf (IsNull([FIRST NAME]),"",[FIRST NAME] & " ") &_

       IIf (IsNull([LAST NAME]),"",[LAST NAME]&Chr(13)&Chr(10)) &_

       IIf (IsNull([ADDRESS]),"",[ADDRESS] & Chr(13) & Chr(10)) &_

       IIf (IsNull([CITY]),"",[CITY] & ", ") &_

       IIf (IsNull([REGION]) ,"",[REGION] & " ") &_

       IIf (IsNull([POSTAL CODE]),"",[POSTAL CODE])

   Can Grow:   Yes

   Can Shrink: Yes

When the form or report is printed, there will be no blank lines.

For more information, search for "IIF," then "IsNull," then "Chr,"

then "Concatenation" using the Help menu.

Additional reference words: 1.00 1.10 2.00


INF: Using Access Basic to Derive a Statistical Median

 Article Number: Q95918

 CREATED: 01-MAR-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes an Access Basic function that opens a table,

reads the data, and finds the statistical median. The median is a

measure of central tendency, another "middle" of a data set. The data

set consisting of the numbers 1, 2, 3, 6, and 100 has a median of 3,

the middle of the set. The data set consisting of the numbers 1, 2, 6,

and 10 has a median of 4, the middle of the set [(2+6)/2=4].

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

MORE INFORMATION

To create an Access Basic function that determines the statistical

median, open a new or previously created module and enter the

following code:

Note: In the following sample code, an underscore (_) is used as

a line-continuation character. Remove the underscore when

re-creating this code in Access Basic.

   '*************************************************************

   'Declarations section of the module.

   '*************************************************************

   Option Explicit

   '=============================================================

   ' Create the following Median() function in the module

   ' The following function will initialize:

   ' - A variable for the database object.

   ' - A variable for the snapshot.

   ' - Sets the database object to the opened database.

   ' - Creates a snapshot based on the database object.

   ' - A variable for the record count, the for statement,

   '      two field values and an offset. This function requires the

   '      table name and field to be analyzed to be include as argument

   '      strings.

   '=============================================================

   Function Median (tName$, fldName$) As Single

      Dim MedianDB As Database

      Dim ssMedian As Snapshot

      Dim RCount%, i%, x%, y%, OffSet%

      Set MedianDB = CurrentDB()

      Set ssMedian = MedianDB.CreateSnapshot("SELECT [" & fldName$ & _

                     "] FROM [" & tName$ & "] ORDER BY [" & fldName$ _

                     & "];")

      ssMedian.MoveLast

      RCount% = ssMedian.RecordCount

      x% = RCount% Mod 2

      If x% <> 0 Then

         OffSet% = ((RCount% + 1) / 2) - 2

         For i% = 0 To OffSet%

            ssMedian.MovePrevious

         Next i

         Median = ssMedian(fldName$)

      Else

         OffSet% = (RCount% / 2) - 2

         For i% = 0 To OffSet%

            ssMedian.MovePrevious

         Next i

         x% = ssMedian(fldName$)

         ssMedian.MovePrevious

         y% = ssMedian(fldName$)

         Median = (x% + y%) / 2

      End If

      ssMedian.Close

      MedianDB.Close

   End Function

How to Use the Median() Function

--------------------------------

Create a form with text box controls that will reflect all measures of

central tendency of a data set. In the ControlSource property for the

text box control, enter

   =Median("<TableName>", "<FieldName>")

The value of this control will be the median of the data set. Another

way to use this function is to call it from within another function

that compares the median from different data sets. For example,

   Function CompareMedians()

      Dim MyDB as Database

      .

      .

      .

      X = Median("<TableName>", "<FieldName>")

      Y = Median("<TableName>", "<FieldName>")

      If X > Y Then Debug.Print "The median for X is greatest."

   End Function

Additional reference words: 1.00 1.10 2.00 statistics


INF: Size To Fit a Label Without Using Layout Menu

 Article Number: Q95919

 CREATED: 01-MAR-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

One way to resize a label control is to use the Size To Fit command.

This command is available on the Layout menu when you are in Design

view of a form or report. This article explains how to resize a label

control without using the menu.

MORE INFORMATION

To use Size To Fit on a label control without using the Layout menu,

first select the label. When a control is selected, the sizing handles

are visible. Once it is selected, you can execute Size To Fit by double-

clicking any of the sizing handles except the top left handle. This

handle is for moving the label control. If you double-click any of the

other handles, the label control expands or contracts to the correct

size.

REFERENCES


PRB: Every Other Page Blank in Printed Reports

 Article Number: Q95920

 CREATED: 01-MAR-1993

 MODIFIED: 06-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you print a report generated in Microsoft Access, a blank page appears

between every printed page of the report or a blank mailing label appears

between every printed label.

CAUSE

Blank pages or mailing labels are generated when a report or label is

wider or longer than the specified page. This condition can be caused by

one or more of the following problems:

 - The total width of the form or report, plus the widths of the left and

   right margins, exceeds the page width (which is usually 8.5 inches).

 - The page size exceeds the user-defined paper size.

 - You used the Groups/Totals ReportWizard, but did not select the

   Fit All Fields On One Page check box. Because of this, the

   ReportWizard may have located fields or controls off the page.

 - In the Print Setup box under Item Size, the Same As Detail check box

   has been cleared.

RESOLUTION

The following resolutions correspond to each of the four causes described

above:

 - Reduce the width of the form or report, reduce the left or right

   margins, or reduce all three so that the total width of the form or

   report, plus the width of the margins, does not exceed the page width.

   Use the following formula:

      (Form or Report Width)+(Left Margin)+(Right Margin)<=(Page Width)

   Use the form or report's property sheet to view or change the Width

   property. Before you reduce the width of a form or report, move the

   fields and controls on it to match the new size.

   To view the left and right margin values, choose Print Setup from the

   File menu.

   If problems persist, use the following procedure to check the Print

   Setup dimensions:

   1. From the File menu, choose Print Setup.

   2. Choose More.

   3. Under Item Size, verify that the Same As Detail box is

      selected.  If so, the width and height listed will match the

      dimensions of the detail section of the report. If not, these

      settings will override the detail settings of the report and may

      cause blank pages to print.

      NOTE: Item Size is usually used for multiple-column reports. You

      must ensure that all the columns fit on the report form when you set

      these values.

 - If the page size is user-defined, Microsoft Access reads the settings

   that you specified for that printer driver with the Printers utility in

   the Windows Control Panel. If your report page exceeds this user-defined

   paper size, your report will include blank pages.

   A new page size will not be available in Microsoft Access until you

   set one up in the Printers utility in the Control Panel.

   The following steps describe how to change the page size with the

   Printers utility:

   1. Open Control Panel, usually found in the Main program group of

      Microsoft Windows Program Manager.

   2. Double-click the Printers icon to start the Printers utility.

   3. Select the printer driver you want to change and then choose the

      Setup button.

   4. In the Paper Size box, select User-Defined. A dialog box will be

      displayed in which you can adjust the settings.

      NOTE: Only dot-matrix printer drivers have a user-definable page

      option. Laser printer drivers do not.

 - When you are using the Groups/Totals ReportWizard, select the Fit All

   Fields On One Page check box on the last screen before you switch to

   Design view or print or preview the report. Once you select this check

   box, the ReportWizard assumes a page 8.5 inches wide, then sizes the

   fields and controls accordingly. If the check box is cleared, the

   resulting report width may exceed the page size.

 - The Same As Detail option is useful when you create a detailed,

   multiple-column report and want the detail section to be a different

   size than the other sections. Clearing this check box can cause blank

   pages if the width defined for the detail section of the report is

   greater than the page size specified. This box, found under Item Size in

   the Print Setup dialog box, is selected by default. The Width property

   is set to match the report's Width property.

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10 2.00 skipping blank page report


INF: Overview of the ORACLE ODBC Driver (1.x)

 Article Number: Q95921

 CREATED: 01-MAR-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.1

---------------------------------------------------------------------

SUMMARY

This article presents a brief overview of the ORACLE relational

database management system (RDBMS) and the ORACLE Open Database

Connectivity (ODBC) driver.

MORE INFORMATION

ORACLE RDBMS is a multiuser relational database management system that

runs with various workstation and minicomputer operating systems. The

IBM-PC and compatible computers running Microsoft Windows can

communicate with ORACLE database servers over a network. Supported

networks include Microsoft LAN Manager, NetWare, VINES, DECnet, and

any network that supports TCP/IP.

The ORACLE driver enables an application to access data in an ORACLE

database through the ODBC interface. The driver communicates with the

network through SQL*Net. The following diagram details the application

and driver architecture:

                          Application

                               :

                               :

                      ODBC Driver Manager

                           (ODBC.DLL)

                               :

                               :

                         ORACLE Driver

                          (SQORA.DLL)

                               :

                               :

                         SQL*Net Driver

                               :

                               :

                        Network Software

               (LAN Manager, NetWare, and so forth)

                               :

                               :

                        SQL*Net Listener

                               :

                               :

                          ORACLE RDBMS

The ORACLE driver complies with API Conformance Level 1 and SQL

Conformance Level Core. The ORACLE driver also supports some functions

in API Conformance Level 2 and most of the grammar in the Core and

Extended SQL conformance levels.

To access ORACLE data, the following components are required:

 - The ORACLE driver

 - An ORACLE RDBMS database

 - A network that connects the computers that run the driver and the

   database. The network must support SQL*Net connections.

The following section describes the hardware and software that each

component requires.

ORACLE Driver

-------------

The ORACLE driver requires an Industry Standard Architecture (ISA)

computer, such as the IBM PC/AT or compatible, a Micro Channel

Architecture (MCA) computer, such as an IBM PS/2 or compatible, or an

Extended Standard Architecture (EISA) computer.

The computer must have an 80286, 80386, or 80486 microprocessor, at

least eight megabytes of random-access memory (RAM), and a hard disk

with approximately 10 megabytes (MB) of free space.

The ORACLE driver requires MS-DOS version 3.3 or later, Microsoft

Windows version 3.0a or 3.1, and ODBC Driver Manager version 1.0.

ORACLE RDBMS

------------

To access data in an ORACLE database with the ORACLE driver, ORACLE

RDBMS version 6.0 or later is required. For more information on the

hardware and software required to run ORACLE RDBMS, please refer to

the ORACLE RDBMS user documentation.

Network Software

----------------

A network is required to connect the computers on which the ORACLE

RDBMS and the ORACLE driver run. For more information about the

hardware and software that each network requires, please refer to the

user documentation for your particular networking product.

The ORACLE driver and the ORACLE RDBMS use SQL*Net as a common network

interface; it should be possible to use the ORACLE driver on any

SQL*Net connection from Windows to an ORACLE database server. For more

information about SQL*Net, please refer to the SQL*Net user

documentation.

NOTE: SQL*Net components are available only from Oracle Corporation.

Database Error

--------------

When a database error occurs, the ORACLE driver returns the native

error number, the SQLSTATE (an ODBC error code), and an error message.

The driver determines these values from the errors it detects and from

the errors that the ORACLE RDBMS returns.

Native Error

------------

When an error occurs in the data source, the ORACLE driver returns the

native error that the ORACLE RDBMS returns to it. When the driver or

the Driver Manager detects the error, the ORACLE driver returns 0

(zero) for the native error number.

SQLSTATE

--------

When an error occurs in the data source, the ORACLE driver maps the

native error code it receives from the ORACLE RDBMS to the appropriate

SQLSTATE. When the driver or the Driver Manager detects the error, the

ORACLE driver or the Driver Manager generates the appropriate

SQLSTATE.

Error Message

-------------

When an error occurs in the data source, the ORACLE driver returns an

error message based on the message returned from the ORACLE RDBMS.

When an error occurs in the ORACLE driver or in the Driver Manager,

the ORACLE driver returns the error message associated with the

SQLSTATE. The error message is displayed in the following format:

   <vendor><ODBC-component><data-source>error-message

The prefix items in angle brackets (<>) identify the location of the

error. The table below shows the value returned by the ORACLE driver

for each of these prefix items. Note that when an error occurs in the

data source, the <vendor> and <ODBC-component> variables identify the

vendor and name of the ODBC component that received the error.

Error Location           Prefix                  Value

---------------------------------------------------------------------

Driver Manager           vendor                  [Microsoft]

                         ODBC-component          [ODBC DLL]

                         data-source             N/A

ORACLE Driver            vendor                  [Microsoft]

                         ODBC-component          [ODBC Oracle Driver]

                         data-source             N/A

ORACLE RDBMS             vendor                  [Microsoft]

                         ODBC-component          [ODBC Oracle Driver]

                         data-source             [Oracle OCI]

The following products are manufactured by vendors independent of

Microsoft: VINES by Banyan Systems, Inc.; DECnet by Digital Equipment

Corporation; IBM PC/AT and PS/2 by International Business Machines

Corporation; NetWare by Novell, Inc.; ORACLE RDBMS and SQL*Net by

Oracle Corporation. We make no warranty, implied or otherwise,

regarding these products' performance or reliability.

Additional reference words: 1.00 1.10 third-party 3rd-party


INF: How to Change Default Template for Forms and Reports

 Article Number: Q95922

 CREATED: 01-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access uses templates to define the characteristics of new

forms and reports when Access Wizards are not used. The templates

contain information about the default properties for the sections and

controls the new form (or report) will contain.

There are two templates: a Normal Form template and a Normal Report

template. You can change the defaults used in these templates by

defining new templates or modifying the Normal templates.

MORE INFORMATION

The information in the Normal templates used by Microsoft Access

includes the following:

 - Default section dimensions

 - Default control properties

 - Options to include page headers/footers

To change the default settings, either modify a report or form and

save it as Normal, or rename the templates.

Note that the names you enter for the form and report templates must

actually exist in your database. The SYSTEM.MDA file retains the

template names that you define.

To change form or report template names, use the following steps:

1. Open a Microsoft Access database.

2. From the View menu, choose Options.

3. In the Category box, select Form & Report Design.

4. In the Items box, type the name of the form or report you want to use

   in the Form Template or Report Template field.

To use your templates with other databases, you must copy or export

the templates.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 267-268 (forms) and

446-447 (reports)

Additional reference words: 1.00 1.10 2.00 templates checkpage


INF: Making a Subform Uneditable and Unenterable

 Article Number: Q95923

 CREATED: 01-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

If a subform is uneditable, a user cannot make any changes to the

subform. However, a user can give the focus to the subform by clicking

it with the mouse. To prevent this from happening, you must make the

subform unenterable. The text below describes the steps to do this. An

uneditable and unenterable subform appears as a "label" for

information.

MORE INFORMATION

To make a subform uneditable and unenterable, use the following three

steps:

1. Open the main form in Design view.

2. Click the mouse once on the subform object to display the

   Subform/Subreport property sheet.

3. Change the Subform/Subreport properties to the following:

      Subform/Subreport

      -----------------

      Enabled: No

      Locked:  Yes

REFERENCES

==========

For more information, search for "locked," then "Enabled, Locked

Properties" using the Help menu.

Additional reference words: 1.00 1.10 2.00 noneditable nonenterable


INF: How to Implement a Timer

 Article Number: Q95924

 CREATED: 01-MAR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

There is no timer control built into Microsoft Access version 1.x. To

implement a timer, you must create an Access Basic module that creates a

timing sequence in your application.

MORE INFORMATION

To create a timer within your Microsoft Access application, you must

call two functions. One function starts the sequence, and another

function sets a global variable that tells the first function to stop

performing the timing iteration.

This article assumes you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools

provided with Microsoft Access. For more information on Access Basic,

please refer to the "Introduction to Programming" manual.

In the first function, called StartTimer(), you execute an endless

loop that performs the timing update and the DoEvents() function. The

DoEvents() function instructs the Access Basic function to release the

computer's CPU to other tasks, such as your form, other applications

within Microsoft Windows, and most importantly the StopTimer()

function. The StopTimer() function sets the global variable that the

StartTimer() function checks to determine when to stop looping.

To create an example, follow the instructions below. Once these are

done, open the form in Browse mode and press the Start Timer button.

You should see the timing being performed by the updating in the text

box. At any point you can stop the timing sequence by pressing the

Stop Timer button.

1. Create the following controls on a form and set the appropriate

   properties:

      Form: Form1

      ------------------------

      Control: Text Box

         ControlName: Field0

      Control: Command Button

         Caption: Start Timer

         OnPush: =StartTimer()

      Control: Command Button

         Caption: Stop Timer

         OnPush: =StopTimer()

2. Create a new module and add the following code:

      '---------------------------------------

      'GLOBAL DECLARATIONS SECTION

      '---------------------------------------

      Option Explicit

      Dim StopTheTimer     'if set to TRUE, then exit StartTimer()

      Const INTERVAL = 1   'determine how often in seconds to update

                           'the screen

      '---------------------------------------------------

      'This function will start the timer, update

      'the display with the correct time unit,

      'and look to see if the StopTheTimer is

      'set to TRUE so as to determine when to

      'stop the process.

      '---------------------------------------------------

      Function StartTimer ()

         Static InHere  'stop re-entrant code

         Dim iLast, iNow, x%

         'this stops the user from pressing the command button

         'and re-entering this code again if it is already

         'running.

         If InHere = True Then Exit Function

         iLast = Timer

         Do

            'StopTheTimer is set in StopTimer()

            If StopTheTimer = True Then

               StopTheTimer = False

               Exit Function

            End If

            iNow = Timer

            'need to update display only if the interval

            'has been exceeded.

            If (iNow - iLast) > INTERVAL Then

               Forms!Form1!Field0 = iNow

               iLast = iNow

            End If

            'release the CPU to other tasks, namely enable

            'the user to enter the StopTimer() function.

            x% = DoEvents()

         Loop

      End Function

      '---------------------------------------------------

      'This function will set the flag to let StartTimer()

      'stop execution.

      '---------------------------------------------------

      Function StopTimer ()

         StopTheTimer = True

      End Function

Additional reference words: 1.00 1.10


PRB: OpenTable Action Argument Does Not List Attached Tables

 Article Number: Q95925

 CREATED: 01-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

One of the macro action arguments for the OpenTable action is Table

Name. In the Action Arguments section of the Macro window, the list of

arguments for Table Name includes the tables in the current database,

but none of the attached tables are listed.

RESOLUTION

To use an attached table with the OpenTable macro action, you must

manually type the attached table name. Or, you can drag the attached

table from the Database window to the Table Name argument.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 21, "Macro

Basics," pages 513-514

Additional reference words: 1.00 1.10 checkpage


PRA: Screen Redraw Problems When Reordering Groups

 Article Number: Q95926

 CREATED: 01-MAR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

In a report, when you change the order of two group levels

and the

headers or footers have different heights, Microsoft Access

does not

redraw the screen completely, making further editing of the

sections

difficult.

RESOLUTION

Close the report and reopen it to force Microsoft Access to

redraw the

screen correctly.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access version

1.0. This problem no longer occurs in Microsoft Access

version 1.1.

MORE INFORMATION

The following Steps use the Employee Sales by Country Report

from the

NWIND.MDB sample database. In this report, the Salesperson

and Country

footers do not have identical heights.

Steps to Reproduce Problem

--------------------------

In the sample database NWIND.MDB:

1. Open the Employee Sales by Country Report in Design view.

2. Choose Sorting and Grouping... from the View menu to view

the sorting

   and grouping levels.

3. Move Salesperson above Country so that the Report will

group by

   Salesperson first, then Country.

4. Close the Sorting and Grouping box.

Note that while the two group headers and footers changed

places, Microsoft

Access did not redraw the screen completely. As a result,

you cannot click

the page footer because the Salesperson footer remains

highlighted.

REFERENCES


INF: Currency Format Causes Report Alignment Problems

 Article Number: Q95927

 CREATED: 01-MAR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

In a report, if you set the Format property of a number control to

Currency, you may have difficulty aligning the formatted numbers with

numbers that are not formatted to Currency. For example, if you format

totals in a group footer section to Currency but do not format the numbers

above or below the total, the unformatted numbers may not align with the

formatted numbers.

MORE INFORMATION

Currency amounts in the detail section may not always have a currency

prefix ($), but the total amount in the group footer usually will have the

prefix, as in the following example:

   (detail section)

         Doodads      4.50

         Widgets     10.00

   (group footer)

         Total:    $ 14.50

If the Format property of the text box in the group footer is Currency, the

decimal point and numbers may not line up with the decimal point and

numbers in the detail section.

To correct this problem, set the Format property of the number controls to

user-defined format, rather than Currency, for the totals in your report.

You can enter a user-defined format in the Format property of a text box.

You can use "$#,##0.00" (without quotation marks) for the Format property

of a number when you want to display the dollar sign, and use "#,##0.00"

(without quotation marks) for the Format property of a number when the

dollar sign is not required. These examples format the numbers in your

report to use the comma as the thousands separator, and format each number

to have two decimal places. Numbers formatted in this manner align

correctly in the report.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 206 and 215-216

For more information in Microsoft Access version 1.x, search for "Format,

Format$ Functions" using the Help menu.

For more information in Microsoft Access version 2.0, search for

"Formatting Numbers" using the Help menu.

Additional reference words: 1.00 1.10 2.00 format


INF: Microsoft Access Does Not Use Record Numbers

 Article Number: Q95928

 CREATED: 01-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article discusses the reasons why Microsoft Access does not use

record numbers, as do some other database products.

MORE INFORMATION

Many database products, such as Microsoft FoxPro, dBASE IV, and

Paradox, use a record number that is physically associated with the

record. For example, the first record in a table has record number 1,

the second record has record number 2, and so on. The record numbers

remain part of the record as long as the record exists. The first

record entered into a table is always record number 1, even if the

table is sorted and the record appears somewhere other than the first

position in the table.

Microsoft Access does not use this approach. When you open a table in

Datasheet view, a number appears at the bottom of the form. This

number indicates the position of the record in the recordset, not the

record's natural position in the table. For example, if a record with

the key value "Anderson" is the first record in a recordset, the

number 1 appears at the bottom of the form. However, if you sort the

same records on a different key, the record may no longer appear as

the first record and a different number may appear at the bottom of

the form.

When you open a table, form, or report, Microsoft Access creates a

dynaset, a dynamic copy of the appropriate recordset, and assigns

numbers to the records therein. These numbers are used only by the

user interface to provide a visually unique identifier for each

record.

Microsoft Access uses this approach because assigning a physical

record number to each record is not "relationally correct." According

to relational database theory, data may appear in any order at any

time. Therefore, the key value, not a random record number, provides

the only reliable method to identify a record.

Because no record number is available, Microsoft Access provides

another method to identify records in a dynaset. Using the Bookmark

property, you can write a procedure to find a target record, store its

bookmark value in a variable, move to other records, and return to the

original record. For more information about bookmarks, search on

"Bookmark" using the Help menu.

dBASE IV is manufactured by Borland International, Inc. and Paradox is

manufactured by Ansa Software, a Borland company, vendors independent

of Microsoft; we make no warranty, implied or otherwise, regarding

these products' performance or reliability.

Additional reference words: 1.00 1.10 2.00 record selector vcr checkpage


PRB: Error in Database Analyzer: DTSysQuery Already Exists

 Article Number: Q95929

 CREATED: 01-MAR-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you are using the Database Analyzer, you click the Analyze button

and receive the error message:

   DTSysQuery already exists

CAUSE

The Database Analyzer often creates a temporary query called DTSysQuery

to complete certain tasks. When the Database Analyzer finishes using

DTSysQuery or needs to create one, it first deletes the current copy. If

it cannot delete DTSysQuery, it attempts to create DTSysQuery anyway

because it assumes DTSysQuery does not exist. As a result, an error

occurs in the Database Analyzer and the error message you see is the

result of a generic error trap mechanism that forwards the Access Basic

error to the user.

One reason why the Database Analyzer fails to delete the existing copy

of DTSysQuery is because the Database Analyzer is installed on a drive

or directory that has read-only permissions.

RESOLUTION

To prevent the error from occurring, follow these steps:

1. Open the MSACCESS.INI file in Notepad. This file is usually located

   in your Windows directory.

2. Locate the section called [Libraries].

3. Place a semicolon in front of the entry for ANALYZER.MDA.

4. Close and save MSACCESS.INI. Then restart Microsoft Access.

5. Open the database called ANALYZER.MDA.

6. In the database window, delete the DTSysQuery query. Quit Microsoft

   Access.

7. Repeat steps 1 and 2. Then remove the semicolon from the front of

   the entry indicated in step 3.

8. Restart Microsoft Access and try the Database Analyzer again.

If the Database Analyzer is located on a drive or directory that does

not have modify permissions, you may not be able to complete step 6

successfully. Even if you can, the problem will likely recur. If it

does, move the Database Analyzer to a drive or directory that has

modify permissions.


PRB: DateAdd 'w' Option Doesn't Work As Expected

 Article Number: Q95930

 CREATED: 01-MAR-1993

 MODIFIED: 01-JUL-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

- Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When adding days using the "w" weekday option, the DateAdd()

function adds the number of days instead of the number of work

days.

CAUSE

"W" works the same as "d" for DateAdd(). It is provided as an

option for compatibility with the DatePart() function. Using "w"

with DatePart() returns the day of the week (Sunday-Saturday), not

whether the day is a work day.

RESOLUTION

The functionality as described above is by design. You can use the

Access Basic code in this article to return the number of work days

rather than the number of days.

MORE INFORMATION

To understand the following information, you need to be familiar with

Access Basic, how to create and use Access Basic procedures, and how

to use the Immediate window.

To reproduce this behavior, enter

   ? DateAdd("w",#2/2/93#,10)

in the Immediate window. The result is #2/12/93# (10 days), not

#2/16/93# (10 work days).

The following code provides a function, DateAddW(), that will add work

days to another date.

Note: In the following sample code, an underscore (_) is used as a

line continuation character. Remove the underscore when re-creating

this code in Access Basic.

'**********************************************************

'Declarations section of the module

'**********************************************************

   Option Explicit

'==========================================================

' Create the following DateAddW() function in the module.

' This function provides a true work day substitute

'    for DateAdd("w", TheDate, Interval).

' This function performs error checking and ignores fractional

'    Interval values.

'==========================================================

Function DateAddW (ByVal TheDate, ByVal Interval)

  Dim Weeks As Long, OddDays As Long, Temp As String

  If VarType(TheDate) <> 7 Or VarType(Interval) < 2 Or _

             VarType(Interval)  > 5 Then

     DateAddW = TheDate

  ElseIf Interval = 0 Then

     DateAddW = TheDate

  ElseIf Interval > 0 Then

     Interval = Int(Interval)

'    Make sure TheDate is a work day (Round Down)

     Temp = Format(TheDate, "ddd")

     If Temp = "Sun" Then

        TheDate = TheDate - 2

     ElseIf Temp = "Sat" Then

        TheDate = TheDate - 1

     End If

'    Calculate Weeks and Odd Days

     Weeks = Int(Interval / 5)

     OddDays = Interval - (Weeks * 5)

     TheDate = TheDate + (Weeks * 7)

'    Take OddDays week-end into account

     If (DatePart("w", TheDate) + OddDays) > 6 Then

        TheDate = TheDate + OddDays + 2

     Else

        TheDate = TheDate + OddDays

     End If

     DateAddW = TheDate

  Else                        'Interval is < 0

     Interval = Int(-Interval) 'Make positive & subtract later

'    Make sure TheDate is a work day (Round Up)

     Temp = Format(TheDate, "ddd")

     If Temp = "Sun" Then

        TheDate = TheDate + 1

     ElseIf Temp = "Sat" Then

        TheDate = TheDate + 2

     End If

'    Calculate Weeks and Odd Days

     Weeks = Int(Interval / 5)

     OddDays = Interval - (Weeks * 5)

     TheDate = TheDate - (Weeks * 7)

'    Take OddDays week-end into account

     If (DatePart("w", TheDate) - OddDays) < 2 Then

        TheDate = TheDate - OddDays - 2

     Else

        TheDate = TheDate - OddDays

     End If

     DateAddW = TheDate

   End If

End Function

How to Use the DateAddW() Function

----------------------------------

Use the DateAddW() function wherever you would use DateAdd. For

example, instead of

   DateAdd("w",[StartDate],10)

use:

   DateAddW([StartDate],10)

To test the DateAddW() function, enter

   ? DateAddW(#2/2/93#,10)

in the Immediate window. The result is #2/16/93# (10 work days).

References:

Access "Language Reference," version 1.0, pages 102-107 and 492-493

Additional reference words: 1.00 1.10 date ab work day add part


INF: How to Create a Query By Form (QBF)

 Article Number: Q95931

 CREATED: 01-MAR-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to use a form to specify the criteria for a

query in Microsoft Access. This technique is referred to as "Query by

Form," or QBF.

MORE INFORMATION

You use the QBF technique to create a query form in which you enter query

criteria. The query form contains blank text boxes, each representing a

field in a table that you want to query. You make entries in only the

text boxes for which you want to specify search criteria.

The query form is usually very similar to a data entry form, as in the

following sample query form:

   First Name: __________

   Last Name:  __________

   City:       __________

   State:      __________

   Zip Code:   __________

You can enter any combination of search criteria in the form. You can

specify only a City, a City and a State, only a Zip Code, or any other

combination of values. Fields that you leave blank on the form are

ignored (no search criteria are applied to those fields). When you choose

the Search button, a query will be performed using the search criteria

from your form.

The following example demonstrates how to create a query form:

1. Open the sample database NWIND.MDB.

2. Create the following new form, and then save it as QBF:

      Form: QBF

      ---------------------------------

      Text box:

         ControlName: What Customer ID?

      Text box:

         ControlName: What Employee ID?

      Command button:

         Caption: Search

         OnPush: QBF

   NOTE: In Microsoft Access version 2.0, the OnPush property is named

   OnClick.

3. Create the following new macro, and then save it as QBF:

      Macro: QBF

      ------------------

      OpenQuery

         Query Name: QBF

         View: Datasheet

         Data Mode: Edit

4. Create the following new query based on the Orders table, and then save

   it as QBF:

   NOTE: In the following sample query, an underscore (_) is used as a

   line-continuation character. Remove the underscore when re-creating

   this query.

      Query: QBF

      ----------------------------------------------------

      Field: Customer ID

         Sort: Ascending

         Criteria: Forms![QBF]![What Customer ID?] Or _

                   Forms![QBF]![What Customer ID?] Is Null

      Field: Employee ID

         Sort: Ascending

         Criteria: Forms![QBF]![What Employee ID?] Or _

                   Forms![QBF]![What Employee ID?] Is Null

      Field: Order ID

      Field: Order Date

   You may note that if you save, close, and then reopen this query in

   Design view, the criteria appear in multiple rows in the query grid.

   This behavior is a result of Microsoft Access optimizing the query and

   displaying it in an equivalent format.

5. View the QBF form in Form view. Enter the following combinations of

   criteria, choosing the Search button after each combination:

      Customer ID   Employee ID      Result

      ------------------------------------------------------------

      <blank>       <blank>          All 1078 orders

      ALWAO         <blank>          7 orders for ALWAO.

      ALWAO         4                2 ALWAO orders for employee 4

      <blank>       4                209 orders for employee 4

After you view the dynaset, or set of results, for each query, close the

Datasheet window before beginning your next search. Each time you choose

the Search button, the parameters in the QBF query filter the data

according to the search criteria specified on the QBF query form.

Notes on the QBF Parameter Criteria

-----------------------------------

The sample QBF query above implements a criterion in the query as

   Forms!FormName!ControlName Or Forms!FormName!ControlName Is Null

to filter the data. This criterion returns all matching records. If a

criterion is null, all the records are returned for the specified field.

You can specify any of the following alternative criteria to return

slightly different results:

NOTE: In the following sample criteria, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating these

criteria.

 - Like "|Forms!FormName!ControlName|*" Or _

   Forms!FormName!ControlName Is Null

   This criterion is the same as the QBF sample above, except that you

   can query using a wildcard. For example, if you enter "Jo" in a field

   using this criterion, the query will return everything in the field

   that begins with "Jo", including Johnson, Jones, Johanna, and so on,

   instead of returning only items with an exact match of "Jo".

 - Between Forms!FormName!StartDate And Forms!FormName!EndDate Or _

   Forms!FormName!StartDate Is Null

   You can use this criterion to query a date field, using Start Date

   and End Date text boxes on the query form. Records whose start and

   end dates fall between the values you specify on the query form will

   be returned.

 - Like Forms!FormName!ControlName & "*" Or Is Null

   This criterion returns both records that match the criterion and

   records that are null. If the criterion is null, all the records

   are returned. Note that the asterisk (*) is considered a parameter,

   as it is part of a larger Like expression. Since the asterisk is a

   hard-coded criterion value (for example, Like "*") records with null

   values are returned.

 - Like IIf(IsNull(Forms!FormName![ControlName]), _

   "*",[Forms]![FormName]![ControlName])

   This criterion returns all the records that match the criterion. If

   no criterion is specified in the query form, all records that are NOT

   null are returned.

 - IIf(IsNull(Forms!FormName![ControlName]), _

   [FieldName],[Forms]![FormName]![ControlName])

   This criterion returns all the records that match the criterion. If

   no criterion is specified in the query form, all records that are NOT

   null are returned (the same results as the example above).

REFERENCES

==========

For more information on complex criteria optimization and returning nulls

from parameter queries, query on the following words here in the Microsoft

Knowledge Base:

   parameter query and like criteria

Additional reference words: 1.00 1.10 2.00


INF: How to Change the "Microsoft Access" Window Caption

 Article Number: Q95932

 CREATED: 01-MAR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

There is no Microsoft Access property to set the main caption of the

Microsoft Access window. To change the default "Microsoft Access"

caption to your own text, you must call the Windows application

programming interface (API) SetWindowText() function.

MORE INFORMATION

To change the default "Microsoft Access" caption to your own text

string, create a new module in Microsoft Access and add the following

function below with the appropriate declaration section.

Notes:

 - You may have some Microsoft Windows API functions defined in an existing

   Microsoft Access library; therefore, your declarations may be

   duplicates. If you receive a duplicate procedure name error message,

   remove or comment out the declarations statement in your code.

 - In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

   '-----------------------------------------

   ' GLOBAL DECLARATION

   '-----------------------------------------

   Option Compare Database

   Option Explicit

   Declare Function FindWindow% Lib "User" (ByVal lpClassName As Any,_

                       ByVal lpWindowName As Any)

   Declare Sub SetWindowText Lib "User" (ByVal hWnd%, ByVal lpString$)

   '-----------------------------------------

   ' Function: SetCaption ()

   ' This function will set the caption of

   ' Microsoft Access's main window.

   '-----------------------------------------

   Function SetCaption ()

      Dim hWnd%

      hWnd% = FindWindow%("OMain", 0&)

      Call SetWindowText(hWnd%, "This is cool!")

   End Function

To change the caption when Microsoft Access is started, you can

execute the RunCode macro action with SetCaption() as an argument and

save the macro as Autoexec. When you open this database, this macro

will execute and change the "Microsoft Access" caption to "This is

cool!"

REFERENCES

==========

"Microsoft Windows Software Development Kit Programmer's Reference

Volume 2: Functions," version 3.1

Additional reference words: 1.00 1.10 2.00 windows API


INF: Determining the Version of Catalog Stored Procedures

 Article Number: Q95933

 CREATED: 01-MAR-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to find the version of catalog stored

procedures on a Microsoft SQL Server.

MORE INFORMATION

There are situations in which you want to determine the version of a

stored procedure, such as when you are experiencing difficulties

attaching to SQL Server. The first method does not use Microsoft

Access.

Method 1

--------

Using the System Administration Facility (SAF), or a SQL pass-through query

in Microsoft Access 2.0, you need to log onto SQL Server with the user's

login ID and password. (Using the SQL administrator's login id (SA) is

ideal but is not always readily available.) Once logged on, the user needs

to open the query window and issue the command USE MASTER. This tells SQL

Server to use the Master database that contains the system tables. To

determine the version, enter the following SQL command:

   USE MASTER

   GO

   SELECT Attribute_Value FROM MsServer_Info WHERE Attribute_ID = 500

NOTE: If you are using SQL Server for Windows NT 4.2 substitute

spt_server_info for MsServer_Info.

Method 2

--------

In a situation where you can successfully attach SQL Server data,

you can attach the MsServer_Info table from the Master database while

using Microsoft Access, then run a query on it for the record where

the Attribute_ID is equal to 500.

NOTE: If you are using SQL Server for Windows NT 4.2 substitute

spt_server_info for MsServer_Info.

Additional reference words: 1.00 1.10 2.00


INF: How to Position Microsoft Access on the Screen

 Article Number: Q95934

 CREATED: 01-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

To position Microsoft Access on the screen, you need to call the

SetWindowPos() Windows API function. The article gives a brief

demonstration of how to position Microsoft Access on the screen.

MORE INFORMATION

To position Microsoft Access on the screen, you will need to use the

SetWindowPos() application programming interface (API) function included

in the USER.EXE dynamic link library (DLL) included with Windows.

Implement this function as follows:

1. Open or create a new module in Microsoft Access.

2. Within the Declarations section, add the following declares,

   constants, and comments.

   NOTE: In the following sample code, an underscore (_) is used as a

   line continuation character. Remove the underscore when re-creating

   this code in Access Basic.

   '====================================

   ' Global Declarations

   '====================================

   Option Compare Database

   Option Explicit

   Declare Function FindWindow% Lib "user" (ByVal lpClassName As Any,_

                       ByVal lpCaption As Any)

   Declare Sub SetWindowPos Lib "User" (ByVal hWnd%,_

                       ByVal hWndInsertAfter%, ByVal X%, ByVal Y%,_

                       ByVal cx%, ByVal cy%, ByVal wFlags%)

   'Inserts the window to precede the position window in the Z-Order.

   'This parameter must be a window handle or one of the following

   'constants.

   Global Const HWND_TOP = 0

   'values for wFlags%

   Global Const SWP_NOZORDER = &H4      'Ignores the hWndInsertAfter

3. Include the following function:

      Function SizeAccess ()

         Dim cX%, cY%, cHeight%, cWidth%, h%

         'get handle to Microsoft Access

         h% = FindWindow("Omain", 0&)

         cX% = 0

         cY% = 0

         cWidth% = 640

         cHeight% = 480

         'position Microsoft Access

         SetWindowPos h%, HWND_TOP, cX%, cY%, cWidth%, cHeight%,_

         SWP_NOZORDER

      End Function

Additional reference words: 1.00 1.10 2.00


INF: How to Determine Whether a Menu Item Is Checked

 Article Number: Q95935

 CREATED: 01-MAR-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article discusses how you can make application programming

interface (API) calls to determine whether or not a menu item is

checked (selected). This method can be used, for example, when you

want to determine whether a form is in Form view or Datasheet view. If

a form is in Datasheet view, the Datasheet menu item on the View menu

is checked. Thus, determining whether this menu item is checked

allows you to determine whether the form is in Datasheet view.

The program code in this article comes from the ORDENTRY.MDB sample

database and is presented in this article in a condensed version.

MORE INFORMATION

To determine whether a menu item is selected, you can use the

IsMenuChecked() function listed in the code at the end of this

article. IsMenuChecked() accepts two parameters indicating the

position of the desired menu item; IsMenuChecked() returns true if the

item is selected and false if it is not.

To find the position of the menu item you want to select, begin at 0

(zero) and count from the left-most menu item until you reach the item

you want. This determines the first number. Then, from the selected

menu, begin with zero and count down the submenu until you reach the

submenu item you want. This determines the second number. (NOTE: separator

bars are considered submenu items, and always return a True from the

IsMenuChecked() function.)

For example, suppose you have the following menus:

   File   Edit    View

   --------------------------

   Open   Cut     Form Design

   Close  Copy    Form

   Exit   Paste   Datasheet

To determine whether Datasheet is checked, you would call

IsMenuChecked() with the values 2 and 2, because the View menu is in

position 2 and the Datasheet item on the View submenu is in position

2. Note the same menu with numbered rows and columns to illustrate

this further:

         0       1      2

       File     Edit   View

       ---------------------------

    0  Open     Cut    Form Design

    1  Close    Copy   Form

    2  Exit     Paste  Datasheet

When determining the position of a menu command, separator bars count

as commands. For example, to get to the Import menu command on the

File menu in the Database window, use the arguments 0 (for the File

menu) and 7 (for the Import command). Positions 3 and 6 correspond to

the separator bars on the File menu.

For an example of how to use this function, follow these steps in the

sample database NWIND.MDB:

1. Copy the code at the bottom of this article to a new module.

2. Open the Customers form in Design view.

3. Select the Customer ID text box.

4. Specify the following for the OnDblClick property in the property

   sheet:

      OnDblClick: =MsgBox(Str(IsMenuChecked(2,2)))

5. Switch to Form view.

   Note that Datasheet on the View menu is not checked because the form

   is not in Datasheet view.

6. Double-click the Customer ID text box.

   A zero appears indicating that the Datasheet item on the View menu is

   not checked.

7. Switch to Datasheet view.

   Notice that the Datasheet item on the View menu is now checked because

   the form is in Datasheet view.

8. Double-click the Customer ID text box.

   This time, a -1 appears indicating that the Datasheet item on the

   View menu is checked.

The following is the code for the sample function IsMenuChecked():

   Option Compare Database   'Use database order for string comparisons.

   Option Explicit

   Declare Function IsZoomed% Lib "User" (ByVal hWnd%)

   Declare Function GetMenu% Lib "User" (ByVal hWnd%)

   Declare Function GetSubMenu% Lib "User" (ByVal hMenu%, ByVal nPos%)

   Declare Function GetMenuState% Lib "User" (ByVal hMenu%, ByVal idItem%,

                       ByVal fuFlags%)

   Declare Function GetActiveWindow% Lib "User" ()

   Declare Function GetParent% Lib "User" (ByVal hwin%)

   Declare Function GetClassName% Lib "User" (ByVal hwin%, ByVal stBuf$,

                       ByVal cch%)

   Const WU_MF_BYPOSITION = &H400

   Const WU_MF_CHECKED = &H8

   ' OMain is the predefined classname of the

   Global Const WU_WC_ACCESS = "OMain"

   Function IsMenuChecked (iMenu%, iItem%) As Integer

      Dim hMainMenu%

      Dim hMenu%

      Dim Flags%

      '--------------------------------------------------

      'If the window is maximized, there is an additional

      'Control menu added to the MDI window.

      '--------------------------------------------------

      If (IsZoomed(Screen.ActiveForm.hWnd)) Then

         iMenu% = iMenu% + 1

      End If

      '--------------------------------------------------

      ' Get the appropriate handle to the menu item.

      '--------------------------------------------------

      hMainMenu% = GetMenu(GetAccessHwnd())

      hMenu% = GetSubMenu(hMainMenu%, iMenu%)

      Flags% = WU_MF_BYPOSITION Or WU_MF_CHECKED

      '--------------------------------------------------

      ' Call the API that returns the state of the menu.

      '--------------------------------------------------

      IsMenuChecked = (GetMenuState(hMenu%, iItem%, Flags%) <> 0)

   End Function

   Function StWindowClass (hWnd As Integer) As String

      Const cchMax = 255

      Dim cch%

      Dim stBuff As String * cchMax

      '--------------------------------------------------

      ' Get the class name of the window relating to hWnd

      ' and return this as the function.

      '--------------------------------------------------

      cch% = GetClassName(hWnd, stBuff, cchMax)

      If (hWnd% = 0) Then

         StWindowClass = ""

      Else

         StWindowClass = (Left$(stBuff, cch%))

      End If

   End Function

   Function GetAccessHwnd () As Integer

      Dim hWnd%

      '--------------------------------------------------

      ' Keep getting the handle of the parent, until the

      ' ClassName = "OMain", which is the class name of

      ' the Microsoft Access window.

      '--------------------------------------------------

      hWnd% = GetActiveWindow()

      While ((StWindowClass(hWnd%) <> WU_WC_ACCESS) And (hWnd% <> 0))

         hWnd% = GetParent(hWnd%)

      Wend

      GetAccessHwnd = hWnd%

   End Function

REFERENCES

==========

For more information, query on the following word here in the Microsoft

Knowledge Base:

   GetSubMenu

Additional reference words: 1.00 1.10 2.00


PRB: DateDiff "W" Option Does Not Work

 Article Number: Q95977

 CREATED: 03-MAR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When calculating the number of weekdays between two dates using the

"w" Weekday option, DateDiff() returns the number of weeks, not the

number of work days. The "w" option is supposed to function the same as

"d" for DateDiff(). It is provided as an option for compatibility with

the DatePart() function.

RESOLUTION

If you are using the DateDiff() function to return the number of

days, substitute "d" for "w". You can use the Access Basic code in

this article to return the number of work days rather than the number

of days.

The code below shows how to calculate the number of work days in a

date range. To understand the following information, you need to be

familiar with Access Basic, know how to create and use Access Basic

procedures, and know how to use the Immediate window.

The following code provides a function, DateDiffW(), that calculates

the number of work days between two dates.

NOTE: In the following sample code, an underscore (_) is used as a

line continuation character. Remove the underscore when re-creating

this code in Access Basic.

   '**********************************************************

   'Declaration section of the module

   '**********************************************************

   Option Explicit

   Function DateDiffW(BegDate, EndDate)

      Const SUNDAY = 1

      Const SATURDAY = 7

      Dim NumWeeks As Integer

      If BegDate > EndDate Then

         DateDiffW= 0

      Else

         Select Case Weekday(BegDate)

            Case SUNDAY : BegDate = BegDate + 1

            Case SATURDAY : BegDate = BegDate + 2

         End Select

         Select Case Weekday(EndDate)

            Case SUNDAY : EndDate = EndDate - 2

            Case SATURDAY : EndDate = EndDate - 1

         End Select

         NumWeeks = DateDiff("ww", BegDate, EndDate)

         DateDiffW= NumWeeks * 5 + Weekday(EndDate) - Weekday(BegDate)

      End If

   End Function

How to Use the DateDiffW() Function

-----------------------------------

Use the DateDiffW() function wherever you would use DateDiff().

Instead of

   DateDiff("W",[StartDate],[EndDate])

use the following:

   DateDiffW([StartDate],[EndDate])

Steps to Test the DateDiffW() Function

--------------------------------------

In the Immediate window, type:

   ?DateDiffW(#2/2/93#,#2/18/93#)

The result is 12, the number of work days.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

In the Immediate window, type:

   ? DateDiff("W",#2/2/93#,#2/18/93#)

The result is 2 (the number of weeks), not 16 (the number of days) or

12 (the number of work days).

REFERENCES

==========

For more information on the DateDiff() and WeekDay() functions, search for

"DateDiff" and "WeekDay" using the Microsoft Access Help menu

Microsoft Access "Language Reference," version 1.0, pages 102-107 and 492-

493

Additional reference words: 1.00 1.10 2.00 dates work day diff part


INF: Criteria Parameters Require Concatenated References

 Article Number: Q95978

 CREATED: 03-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access has both a SQL interpreter and an Access Basic

interpreter. Because some Access Basic commands and functions require

SQL syntax as a parameter, it may become confusing how the two work

together.

For example, if you need to look up a description in a table called

Categories where [Category ID] is equal to whatever value is currently

in Forms!Form1!Field1, you cannot use:

NOTE: In the following sample code, an underscore _ is used as a

line-continuation character. Remove the underscore when re-creating

this code in Access Basic.

   DLookUp("Description", "Categories",_

         "[Category ID] = Forms!Form1!Field1")

Instead, you must concatenate the value of Forms!Form1!Field1 into the

criteria parameter as shown below:

   DLookUp("Description", "Categories",_

      "[Category ID] = '" & Forms!Form1!Field1 & "'")

This means that if the value of Forms!Form1!Field1 is "BEVR," the

criteria parameter in the expression above would evaluate to:

   [Category ID] = 'BEVR'

MORE INFORMATION

When you make a function call such as:

   DLookUp("Description", "Categories", "[Category ID] = 'BEVR'")

Access Basic internally creates a SQL statement with the parameters

you supply. In this case, the resulting SQL statement is:

   SELECT Description FROM Categories WHERE [Category ID] = 'BEVR'

Access Basic sends this statement to the Access SQL engine, which

returns the result of the SELECT statement back to Access Basic, and,

in turn, back to your DLookUp() expression.

Note that that a DLookUp() coded as follows

   DLookUp("Description", "Categories",_

      "[Category ID] = Forms!Form1!Field1")

would result in a WHERE clause that looks like:

   [Category ID] = Forms!Form1!Field1

The SQL parser is designed to accept SQL syntax, and the

Forms!Form1!Field1 reference is Access Basic syntax, so the form

reference cannot be expected to work. Instead, the resulting evaluated

criteria parameter must be done in such a way as to accommodate the

syntax rules of the SQL parser.

Note that this also applies to other Access Basic methods and

functions that require a criteria parameter. For example, Find methods

use a criteria parameter as shown below:

   Dim D As Database, S As Snapshot

   Set D = CurrentDB()

   Set S = D.CreateSnapshot("Categories")

   myvar = "BEVR"

   S.FindFirst "[Category ID] = '" & myvar & "'"

Additional reference words: 1.00 1.10 2.00


INF: Screen Fonts May Not Match Printer Output Fonts

 Article Number: Q96009

 CREATED: 03-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Screen fonts and printer fonts can be different. When you create a new

form or report, the default font used to format the controls can be

set up to use only printer fonts. Using printer fonts will ensure that

the screen view and printed output are as close as can be to an exact

match. If you use TrueType fonts (supplied with Windows 3.1) the

screen view and printed output will also match. Forms that have been

saved as reports may need to be modified to ensure that you get the

correct output. By default, new reports use printer fonts but forms do

not. You can control which fonts are used by setting the

LayoutForPrint property in the form or report property sheet.

MORE INFORMATION

When you choose a font for a form or report, the characters on the

screen may not look exactly like those that appear on the printed page

because printer fonts and screen fonts can differ. If you select a

scalable font, such as a TrueType font, the screen and printer

characters will be the same.

When you design a form or report, you can set the LayoutForPrint

property to Yes in the form or report property sheet, and you will

only see printer fonts listed in the toolbar. The LayoutForPrint

property determines whether a screen font or printer font is used. If

LayoutForPrint is set to No, the fonts available on the toolbar

include screen fonts.

If LayoutForPrint is set to Yes, the fonts and point sizes on the

toolbar correspond to the fonts and sizes available on the printer you

chose in the Print Setup command from the File menu.

For reports, this property is set to Yes by default. This property must

be changed to Yes for forms.

In Microsoft Access, you can design a form and save it as a report. If

LayoutForPrint is set to No when the form is originally designed, you

may need to change the fonts from a screen font to a TrueType or

printer font in the report design mode.

To convert a form to a report, open the form in Design view and choose

Save As Report from the File menu.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, page 309

Additional reference words: 1.00 1.10 2.00 checkpage


INF: Changing Area Codes Based on a Telephone Number Prefix

 Article Number: Q96010

 CREATED: 03-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Some states are adding new telephone area codes based on a phone

number's prefix. This article describes how to change a phone number's

area code in a table based on the prefix. This is accomplished by

creating a table with the prefix you want to find and the new area

code. An Access Basic function then reads this table into an array and

searches the phone number table and changes the area code in the phone

number table.

IMPORTANT: Before running this function, back up your database and make a

copy of your table.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

1. Create a table that will contain the phone number prefix to search

   and the new area code:

      Table: Area Codes To Change

      ---------------------------

      Field Name: Prefix

         Datatype: Text

      Field Name: Area Codes

         Datatype: Text

2. Enter in the phone number prefixes and area codes in the table Area

   Codes To Change. For example:

      Prefix      Area Codes

      ----------------------

      635            207

      634            208

3. Open a module or create a new one, and enter the following code:

   NOTE: In the following sample code, an underscore (_) is used as a

   line-continuation character. Remove the underscore when re-creating

   this code in Access Basic.

   '*************************************************************

   'Declarations section of the module.

   '*************************************************************

   Option Explicit

   '=============================================================

   ' Create the following ChgAreaCode() function in the Module

   ' The following function will initialize:

   ' - A variable for the database object.

   ' - Variables for the table objects and several other objects.

   ' - Sets the database object to the opened database.

   ' - Opens table "Area Codes To Change" and tPhName.

   ' - The action of this function is to locate the phone number

   '     entries with certain prefixes and then change the

   '     corresponding area code. This function operates on numbers

   '     with the following format "(206) 635-7050". The table name

   '     and field name containing the phone number must be passed

   '     as arguments.

   '=============================================================

   Function ChgAreaCode (tPhName, fldPhone)

      Dim PhoneDB As Database

      Dim tPhone As Table, tPrefix As Table

      Dim PCount%

      Dim i%

      Dim tPrefixName$

      Dim Prefix$

      Dim SpacePos%

      Dim HyphenPos%

      Dim PrefixLen%

      Dim PrefixToFind$

      Dim AreaCode$

      Dim Lastfour$

      tPrefixName$ = "Area Codes To Change"

      If tPhName = "" Or fldPhone = "" Then Exit Function

      Set PhoneDB = CurrentDB()

      Set tPrefix = PhoneDB.OpenTable(tPrefixName$, 1)

      tPrefix.MoveLast

      PCount% = tPrefix.RecordCount

      tPrefix.MoveFirst

      ReDim PrefixArray$((PCount% - 1), 1)

      For i% = 0 To PCount% - 1 Step 1

         PrefixArray$(i%, 0) = tPrefix.Prefix

         PrefixArray$(i%, 1) = tPrefix.[Area Codes]

         tPrefix.MoveNext

      Next i%

      tPrefix.MoveFirst

      tPrefix.Close

      Set tPhone = PhoneDB.OpenTable(tPhName, 1)

      Do Until tPhone.EOF

         SpacePos% = InStr(1, tPhone(fldPhone), " ")

         HyphenPos% = InStr(SpacePos% + 1, tPhone(fldPhone), "-")

         PrefixLen% = (HyphenPos% - SpacePos%) - 1

         PrefixToFind$ = Mid(tPhone(fldPhone), SpacePos% + _

                            1, PrefixLen%)

         For i% = 0 To PCount% - 1 Step 1

            If PrefixArray$(i%, 0) = PrefixToFind$ Then

               AreaCode$ = PrefixArray$(i%, 1)

               Prefix$ = Mid$(tPhone(fldPhone), 7, 3)

               Lastfour$ = Right$(tPhone(fldPhone), 4)

               tPhone.Edit

               tPhone(fldPhone) = "(" & AreaCode & ") "_

                                     & Prefix & "-" & Lastfour

               tPhone.Update

            End If

         Next i%

         tPhone.MoveNext

      Loop

      tPhone.Close

      PhoneDB.Close

   End Function

When using this function, you pass (tPhName), the name of the table

containing the number to change, as a string. Then you pass (fldPhone),

the field name that contains the number to change, as a string.

Example

-------

This function can be called from the Immediate window for one time

execution as follows:

   ?ChgAreaCode("Contacts", "Business Phone")

Where "Contacts" is a table name and "Business Phone" is a field containing

the phone number.

Additional reference words: 1.00 1.10 2.00 checkpage


PRB: No System Table Permissions After Admin User Deleted

 Article Number: Q96011

 CREATED: 03-MAR-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Your attempt to access the system tables MSysACES, MSysColumns, or

MSysIndexes fails.

CAUSE

You deleted the Admin account from the list of valid users.

RESOLUTION

Before you delete the Admin account, you must assign permissions for

the system tables to a new member of the Admins group.

STATUS

This behavior is by design.

MORE INFORMATION

The text below explains how to assign permission to access the system

tables to a new member of the Admins group.

If you create a new Admin account and delete the original Admin

account from the Users group before you assign the new account access

rights, you are unable to access the system tables. The one exception

to this rule applies if the original Admin did not create the

database.

To assign permissions to the system tables, use the following steps:

1. Log on to Microsoft Access as the user Admin. If you do not receive

   a logon screen, you are automatically logged in as Admin.

2. From the Security menu, choose Users.

3. In the Users dialog box, choose New.

4. Enter the name of the new administrator, assign the administrator a

   PIN (personal identification number), and choose OK.

5. In the Group Membership section of the Users dialog box, add the

   new administrator to the group Admins. To do so, select Admins in

   the Available Groups list and choose Add. Then choose Close.

6. From the View menu, choose Options.

7. In the Items box in the General category, set Show System Objects

   to Yes and choose OK.

8. From the Security menu, choose Permissions.

9. In the Object section of the Permissions dialog box, select the

   MSysACES table. In the Permissions section, select the Full

   Permissions check box. Microsoft Access sets all other permissions

   automatically.

Repeat step 9 for the MSysColumns and MSysIndexes tables.

REFERENCES


INF: Security Settings for Modifying Data in a Query Dynaset

 Article Number: Q96012

 CREATED: 03-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

You can affect a user's ability to edit data in a query's dynaset by

altering the settings for the following two permissions:

 - Run With Owner's Permissions, for a query

 - Modify Data, for a query and any underlying tables

MORE INFORMATION

For a user to be able to edit a query's dynaset, one of the following must

be true:

 - The Run With Owner's Permissions check box must be selected. To select

   this check box, choose Query Properties from the View menu when the

   query is open in Design view.

 - The Modify Data check box must be selected for both the query and

   the underlying tables. To select this check box, choose Permissions from

   the Security menu in the Database window. You must repeat this step for

   each object for which you want to assign permissions.

The following table shows the possible combinations of these three

settings and how each affects the user's ability to edit the

query's dynaset:

   Permission       Permission       Run with

   to Modify Data   to Modify Data   Owner's       Edit

   in Table         in Query         Permission    Query?

   ------------------------------------------------------

   Yes              No               No            No

   Yes              Yes              No            Yes

   No               No               No            No

   No               Yes              No            No

   Yes              No               Yes           No

   Yes              Yes              Yes           Yes

   No               No               Yes           No

   No               Yes              Yes           Yes

REFERENCES

==========

Microsoft Access "User's Guide," version 2.0, chapter 25

Microsoft Access "User's Guide," version 1.0, pages 619-626

Additional reference words: 1.00 1.10 2.00 checkpage


PRB: Incorrect Catalog Stored Procedures Error Message

 Article Number: Q96013

 CREATED: 03-MAR-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The following error message may be displayed when you attempt to

attach a SQL table in Microsoft Access:

   [Microsoft][ODBC SQL Server Driver] The ODBC catalog stored

   procedures installed on your server <servername> are version

   xx.xxxx; version xx.xx.xxxx is required to ensure proper

   operation. Please contact your system administrator.

CAUSE

To perform its functions, Microsoft Access requires certain

information from a back-end database. This information is provided by

a series of catalog stored procedures that reside on the back-end

database. You need to use the correct version of the catalog

procedures for the version of Microsoft Access and SQL Server that you

are running.

This error indicates that you have an incorrect version of the catalog

stored procedures installed.

RESOLUTION

Reinstall the stored procedure file. Refer to the following paragraphs

to determine which script file to use with your version of Microsoft

Access and SQL Server.

Microsoft Access Version 1.0

----------------------------

If you run Microsoft Access version 1.0 with Microsoft or Sybase SQL

Server, use the correct script file from the table below:

   SQL Server             Catalog Stored Procedure

   And Version            Script File Requirements

   ------------------------------------------------------------------

   Microsoft SQL Server   Use the INSTCAT.SQL file from the Microsoft

   versions 1.x and 4.2   Access ODBC disk.

   Microsoft SQL Server   INSTCAT.SQL is not required, but some

   version 4.2a           Microsoft Access problems are resolved with

                          it that are not in the Microsoft SQL Server

                          4.2a stored procedures.

   Sybase SQL Server      Use the INSTCAT.SQL file from the Microsoft

   versions before 4.8    Access ODBC disk.

   Sybase SQL Server      Use the INSTCAT.48 file from the MSACCESS

   versions 4.8-4.9x      forum on CompuServe. Go to the ODBC/SQL

                          Server library, and download the SYBASE.ZIP

                          file.

Microsoft Access Versions 1.1 and 2.0

-------------------------------------

In Microsoft Access version 1.1, both the Sybase and Microsoft SQL

servers use the same INSTCAT.SQL file.

To install the catalog stored procedures, use the SQL Server ISQL

(Interactive SQL) tool. You can run the ISQL tool from the MS-DOS or

OS/2 command prompt.

IMPORTANT: Do not use the SAF utility provided with Microsoft SQL

Server. Microsoft SAF for MS-DOS and OS/2 is limited to 511 lines of

code in an SQL script.

The syntax to install INSTCAT.SQL using ISQL is:

   isql /U <sa loginname> /n /P <password> /S <SQL servername>

   /i <drive:\path\INSTCAT.SQL> /o <drive:\path\outputfilename>

NOTE: Enter the preceding two lines as one line at the command

prompt, and do not include the angle brackets < >.

The following are the command line parameters for the ISQL command:

   /U   Login name for the system administrator.

   /n   Eliminates line numbering and prompting for user input.

   /P   Password (case sensitive) used for the system administrator.

   /S   Name of the driver to set up.

   /i   Provides the drive and fully qualified path for INSTCAT.SQL.

   /o   Provides ISQL with an output file destination for results,

        including errors.

Example

-------

   isql /U sa /n /P skier /S DUMMY_SERVER /i D:\SQL\INSTCAT.SQL /o

   D:\SQL\OUTPUT.TXT

Additional reference words: 1.00 1.10 2.00 errmsg


PRB: Text Label Truncated Printing Form on Epson 9-Pin Printer

 Article Number: Q96100

 CREATED: 08-MAR-1993

 MODIFIED: 23-AUG-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When print a form or a report to an Epson 9-pin printer, the last

two characters of the label controls are truncated. The label

controls appear correctly in Print Preview.

CAUSE

This problem is caused by the difference in the sizes of the Epson

printer driver fonts and the screen fonts.

RESOLUTION

Before adding any controls to your form or report, set the Layout

for Print property to Yes.

MORE INFORMATION

Perform the following three steps to layout your form or report

correctly.

1. Open the form or report in Design view.

2. Choose the Properties button or choose Properties from the View

   menu.

3. Change the Layout for Print property to Yes.

4. Place fields into the form or report as desired. The label controls

   display and print correctly.

References:

For more information, query in the Microsoft Knowledge Base on the

following words:

   screen and fonts and printer and true and type

Additional reference words: 1.00 1.10 printing


INF: dBASE's REPORT FORM Command in Access Basic

 Article Number: Q96101

 CREATED: 08-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article discusses how to implement a dBASE-style REPORT FORM

command in an Access Basic application.

MORE INFORMATION

In dBASE, you can create a report with the Report Generator, then print

the report from a program using the REPORT FORM TO PRINT command. In

Microsoft Access, you can print a pre-existing report programmatically

using DoCmd OpenReport.

For example, suppose you have created a report in Microsoft Access

called MyReport, and you want to print the report from an Access Basic

procedure. Use the following command to accomplish this:

   DoCmd OpenReport "MyReport"

If you omit the TO PRINT clause, which is optional in dBASE's REPORT

FORM command, the report will print to the screen. This is equivalent

to showing the report in Print Preview mode rather than sending it to

the printer. This can be done with DoCmd OpenReport by adding the

A_PREVIEW parameter:

   DoCmd OpenReport "MyReport", A_PREVIEW

In Addition, you can open a report in Design view by using the

A_DESIGN parameter:

   DoCmd OpenReport "MyReport", A_DESIGN

Additional reference words: 1.00 1.10 2.00


PRA: User with Full Permissions Cannot Run Query

 Article Number: Q96102

 CREATED: 08-MAR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You receive the following message even though you have full permission

on a table:

   Couldn't read; no read permission for table or query <query name>

You can view the table in Datasheet and Design view, and you can open

the query in Design view.

CAUSE

This occurs when a query has the property Run With Owner's Permissions

checked and the user who created the query (the owner) is no longer on

the system. Either the owner was deleted or the database was opened in a

Microsoft Access session that was started with a different SYSTEM.MDA

where the owner is not a included.

When the property Run with Owner's Permissions is checked, Microsoft

Access checks the owner's permissions. It does not compare the owner's

permissions to those of the user running the query. Therefore, if the

owner is not on the system, other users cannot execute the query as long

as the property Run with Owner's Permissions is checked.

RESOLUTION

To allow users to run the query with their own permissions, clear the

Run With Owner's Permissions check box and save the query.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

 1. Start Microsoft Access. If you have activated security, log in as a

    member of the group Admins.

 2. From the Security menu, choose Users.

 3. Press the New button and add a new user called John. Add another user

    called Jane. Do not assign either to any group other than Users.

 4. If you have already activated security, skip this step. Choose Change

    Password... from the Security menu. Leave the Old Password blank, enter

    Admin for New Password and Verify. Press the OK button.

 5. Exit and restart Microsoft Access. Log in as John leaving the password

    blank.

 7. Create a new query based on any table. If you are in a secure system,

    base the query on a table that the Users group has full permissions to.

    From the View menu, choose Query Properties and select the Run with

    Owner's Permissions check box.

 8. Exit and restart Microsoft Access. Log in as Admin using the password

    Admin.

 9. Choose Users from the Security menu. Delete the user John.

10. Exit and restart Microsoft Access. Log in as Jane leaving the password

    blank.

11. Attempt to run the query.

    At this point, you will see the error message "Couldn't read; no read

    permission for table or query '<query name>'.

12. Verify that Jane can open the query in Design view as well as open the

    table on which the query is based.

To avoid the problem, in Design view, the user Jane can choose Options

from the View menu and clear the Run With Owner's Permissions check box.

Depending on the security, that may have to be done by an Admin. After you

clear the check box, the query will run.

REFERENCES

==========

For more information on query permissions, search for "Run with Owner's

Permissions" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 serial number pin ADK errmsg


INF: Macro to Enter Date Record Was Last Modified

 Article Number: Q96103

 CREATED: 08-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article explains how to write a macro that will place the current

date into a LastModified field in your table each time a record is

modified. This method works when you are editing records from a form.

MORE INFORMATION

When a form is used to edit records, you can date stamp the record by

attaching a macro to the BeforeUpdate property of the form. For this

example, we will use the Customers table in the sample database

NWIND.MDB.

1. Add a new field to the Customers table.

      Table: Customers

   ---------------------------

      Field Name: DateModified

      DataType:   Date/Time

2. Create a macro called LastModified as follows:

      Macro Name            Action

      -------------------------------------------

      LastModified        SetValue

                             Item: [DateModified]

                             Expression: Date()

   NOTE: There is no equal sign (=) in front of the Date() function.

   If you put an equal sign in front of the Date() function, the macro

   will always put the date 12/30/99 into the [DateModified] control

   even though the macro step window shows the correct date in the

   argument section.

3. Create a form called Modify Customers based on the Customers table.

   Place a few of the fields on the form as follows:

      Form Name: Modify Customers

      ---------------------------

      ControlSource: DateModified

      ControlSource: Customer ID

      ControlSource: Company Name

      ControlSource: Address

4. Enter the macro name LastModified into the BeforeUpdate property of

   the Modify Customers form. Switch the form to Form view. Any time

   you modify the record, the current date will be placed in the

   DateModified control.

Additional reference words: 1.00 1.10 2.00 unexpected


INF: Requery, Repaint, and Records Refresh

 Article Number: Q96104

 CREATED: 08-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The Requery, Repaint, and Records Refresh items are different; however,

they are all used to ensure that what you see is updated.

MORE INFORMATION

Requery

-------

The Requery macro action updates controls, such list boxes and combo

boxes. It does not work for the form on which those controls exist.

Repaint

-------

Repaint is not related to data, it merely redraws the object or

control. If there is data that has been updated in the underlying

dynaset but is not reflected on the form, Repaint cannot be used.

Records Refresh

---------------

Records Refresh requeries the form itself, as opposed to any control on the

form.

Additional reference words: 1.00 1.10 2.00


PRB: Leading Space in Property Sheet Entry May Cause Problems

 Article Number: Q96105

 CREATED: 08-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Valid values for properties are not recognized as valid. For

example, you get a "#Name" value for a control that is bound to a

field in the underlying table that definitely exists.

CAUSE

The problem may be caused by having a leading space as part of the

entry for that property. For example, you may have a ControlSource

property for a control that correctly identifies the name of a

field for the control, but includes a leading space. In such a

case, Microsoft Access attempts to include the leading space as

part of the value you specified for ControlSource.

RESOLUTION

Remove the leading space.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new form in the sample database NWIND.MDB bound to the

   Categories table.

2. From the fields list, drag the Description field onto the form.

3. With the Description field in focus, bring up the property sheet

   and put a space in front of the "Description" value that appears

   for the ControlSource property.

4. Switch from Design view to Form view.

Note that "#Name" appears for the Description field even though it is

part of the underlying table.

Additional reference words: 1.00 1.10 2.00


INF: Accessing a Report Dynaset Requires a .Form Reference

 Article Number: Q96106

 CREATED: 08-MAR-1993

 MODIFIED: 03-AUG-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

The text below discusses methods to access a report's dynaset and

explains the apparent discrepancy in the documentation regarding the

use of a form dynaset versus the use of a report dynaset.

MORE INFORMATION

Page 65 of the "Microsoft Access Introduction to Programming" manual

for version 1.0 implies that both forms and reports have associated

dynaset objects that are accessible and that function identically.

This is basically true; once you access a report's dynaset, you can

use the same procedures that you use with a form's dynaset. Any

limitations in functionality relate only to the differences between an

interactive object (the form) and a noninteractive object (the

report).

According to page 162 of the "Microsoft Access Language Reference"

manual for version 1.0, the Dynaset property applies only to forms.

This is actually correct even though you can access a dynaset from a

report in the same manner as you can access a dynaset for a form. The

statement is correct because the Dynaset property is accessible only

through a form reference. For example, if you have a form called

"Form1," you can assess Form1's dynaset with the following reference:

   Set MyDynaset = Forms!Form1.Dynaset

However, to access Report1's dynaset, use the following reference:

   Set MyDynaset = Reports!Report1.Form.Dynaset

Additional reference words: 1.00 1.10 checkpage docbug


PRB: Compile Error When Attempting to Use an AccessWizard

 Article Number: Q96107

 CREATED: 08-MAR-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SYMPTOMS

The following error appears when you try to use an AccessWizard:

   Compile error

CAUSE

This occurs because there is a compile error in the code stored in the

database.

Microsoft Access must compile all code in memory to use any of it. This

includes the code stored in the database and any libraries (.MDA files)

that are loaded. When you attempt to use an AccessWizard, Microsoft

Access must compile the Access Basic code that is in the WIZARD.MDA file

in addition to any code in your database. If there is an error in the

code in your database, Microsoft Access will not be able to run the

AccessWizard because the compilation failed.

RESOLUTION

To resolve this problem, follow these steps:

1. Open your database.

2. Open any module in Design view.

3. Choose Compile All from the Run menu.

Microsoft Access will bring up the module window with the offending

line of code. Upon correcting the error, and assuming there are no

other errors, AccessWizards should now work.

If the Compile error message persists, repeat steps 2 and 3 until all

errors in the code are corrected.

STATUS

This problem does not occur in Microsoft Access version 1.1.


INF: Items in a Module Run Menu Are Unavailable (Grayed Out)

 Article Number: Q96108

 CREATED: 08-MAR-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you have a Module window open and in focus, you may notice that

many commands in the Run menu are unavailable (grayed out):

MORE INFORMATION

The commands that are unavailable are:

   Continue

   Single Step          (version 1.x only)

   Procedure Step       (version 1.x only)

   Step Into            (version 2.0 only)

   Step Over            (version 2.0 only)

   Set Next Statement

   Show Next Statement

These commands are unavailable because you cannot begin stepping through

code until you are in Break mode. Once the code is executed, Break mode

occurs when any of the following take place:

 - A breakpoint that you set is encountered

 - A Stop command is encountered

 - CTRL+BREAK is pressed while the code is running

 - An error occurs in the code

REFERENCES

==========

Microsoft Access "Introduction to Programming," versions 1.0 and 1.1,

Chapter 4, "Debugging Your Access Basic Code," pages 29-42

Microsoft Access "Building Applications," version 2.0, Chapter 9,

"Debugging"

Additional reference words: 1.00 1.10 2.00 grey gray debug


INF: Troubleshooting Setup and Installation Problems

 Article Number: Q96109

 CREATED: 08-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article explains the following troubleshooting techniques that you

can use to resolve Microsoft Access Setup and installation problems:

 - Checking the installation disks

 - Checking the TEMP directory

 - Checking what loads when you start Microsoft Windows

 - Clean booting your system

Note that you can use many of these techniques to troubleshoot problems

that occur after installation.

MORE INFORMATION

Checking the Installation Disks

-------------------------------

The following steps help determine whether your problem is related to

a bad installation disk. To check a specific disk:

1. Exit completely from Microsoft Windows.

2. At the MS-DOS command prompt, type the following:

      md \disktest

3. Put the suspect disk in the floppy disk drive, then type the

   following:

      copy <drive>:*.* c:\disktest

   where <drive> is the appropriate floppy disk drive letter.

4. If the disk is copied successfully, the MS-DOS command prompt will

   return and no error message will appear. This means that this disk

   is not the problem, and you should continue troubleshooting.

   If an error message is displayed, call Microsoft Customer Service

   at (800) 426-9400 and request a replacement disk.

5. Delete the temporary DISKTEST directory and any files in it by

   typing:

      erase c:\disktest\*.*

   Answer "Y" (without quotation marks) when you are asked if you really

   want to erase everything.

   Then type

      rd c:\disktest

   to remove the directory.

Checking the TEMP Directory

---------------------------

1. Exit completely from Windows.

2. At the MS-DOS command prompt, type the following:

      set

3. Change to the directory pointed to by the TEMP variable. For

   example, if you are at the root of your C drive when you type SET

   and "TEMP=C:\WINDOWS\TEMP" is displayed, type the following command:

      cd \windows\temp

   If an "invalid directory" message is displayed when you change to

   the TEMP directory, you must create the TEMP directory using the

   MS-DOS Make Directory (MD) command.

4. There should be no *.TMP files in your TEMP directory when Windows

   is not running. If there are *.TMP files in this directory, you

   should erase them. To see whether there are any .TMP files in your

   TEMP directory, type the following command:

      dir *.tmp

   If there are *.TMP files in the TEMP directory, erase them by typing

      erase *.tmp

   For more information on the TEMP directory, query on the following

   words here in the Microsoft Knowledge Base:

      windows and temporary and files and definition

5. Use the MS-DOS CHKDSK command to check your hard drive. At the

   command prompt, type:

      chkdsk

   NOTE: Refer to your Microsoft MS-DOS "User's Guide and Reference"

   if you have lost allocation units, lost clusters, or cross-linked

   files.

6. Check the amount of free space on your hard drive by looking at the

   line that says "bytes available on disk." If this number is less than

   4000000 bytes (4 MB), free up some additional hard drive space by

   removing unnecessary files.

Checking What Loads When You Start Windows

------------------------------------------

For troubleshooting purposes, it is important that you have a clean

Windows configuration before you boot from a clean, bootable floppy

disk (refer to "Clean Booting Your System" below). The following

steps ensure a clean Windows configuration:

1. Using a text editor, such as the MS-DOS Editor or Windows Notepad,

   open the WIN.INI file. Check the following two lines:

      load=

      run=

   If there is anything to the right of the equal sign (=) on either of

   these two lines, place a semicolon (;) at the beginning of line.

   For example:

      ;load=c:\mydir\myprogram.exe

   The semicolon causes Windows to ignore that line.

2. Save your changes and exit the text editor.

3. When you are clean booting, you do not want anything to load

   automatically from your Startup group. To temporarily disable this

   functionality, hold down the SHIFT key as soon as you see the Windows

   logo screen. Keep the SHIFT key depressed until Windows is completely

   loaded.

4. Make sure that you are using a Windows video driver. To do this,

   exit Windows. At the C:\WINDOWS> prompt, type:

      setup

   Windows displays a System Information screen that indicates the

   type of display that you are using. If the Display field does not

   show EGA or VGA, follow the instructions on your screen to change

   the display to VGA.

   NOTE: If you receive a Welcome To Windows Setup screen, you were not

   at the Windows prompt when you typed SETUP.

Clean Booting Your System

-------------------------

A clean boot eliminates many variables that may be related to your

Setup or installation problem. Follow these steps to clean boot your

system:

1. Create a bootable floppy disk by putting a blank floppy disk in your

   A drive, and then typing the following at the MS-DOS command prompt:

         format a: /s

2. Use a text editor, such as MS-DOS Editor or Windows Notepad, to

   create a CONFIG.SYS file on the bootable floppy disk that you

   created in step 1.

   A simple CONFIG.SYS contains the following:

      files=50

      buffers=20

      device=c:\windows\himem.sys

      <third-party disk partitioner>

      <third-party disk compression driver>

      <Other third-party driver if necessary to boot your computer>

      shell=c:\<valid path>\command.com /p

   NOTE: If you have the following line in your current CONFIG.SYS file,

   you should include it in your clean boot CONFIG.SYS file:

      device=c:\windows\smartdrv.sys /double_buffer

   For more on SMARTDRV.SYS, query on the following words here in the

   Microsoft Knowledge Base:

      SMARTDrive and 4.0 and design and overview

   NOTE: If there is hard disk partitioning, disk compression, or

   other third-party software required to boot your computer, these

   files must be included in your CONFIG.SYS file.

3. Using a text editor, create an AUTOEXEC.BAT file on the bootable

   floppy disk that you created in step 1. A simple AUTOEXEC.BAT

   contains the following:

      prompt $p$g

      path=c:\windows

      set temp=c:\<valid path>

4. Exit from the text editor.

5. With the clean, bootable floppy disk in drive A, reboot your

   system.

6. If you still experience Setup problems, try starting Windows in

   standard mode by typing

      win /s

   at the A prompt. Windows does not try to create any virtual memory

   in standard mode. If running in standard mode resolves your problem,

   contact Windows Product Support for further assistance.

   For more information on the clean booting your system, query on the

   following words in the Microsoft Knowledge Base:

      clean and boot and windows

Additional reference words: 1.00 1.10 2.00 tshoot


INF: Using WIN.INI & ODBC.INI When Attaching SQL Server Table

 Article Number: Q96110

 CREATED: 08-MAR-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article discusses how the ODBC Driver manager and the SQL Server

driver use the WIN.INI and ODBC.INI files during connection time.

MORE INFORMATION

For the purposes of this article, the following is assumed:

 - You set up a data source for the SQL Server driver called mysqlsvr.

 - The data source is located on a server called Unixmc.

 - You are connecting to a Sybase SQL Server table on Unix whose

   address is 11.1.4.40,3180.

 - The net-library you are using is wdbftptc.dll.

Given these assumption, if the setup was done correctly, the ODBC.INI

file will have the following entry in the [ODBC Data Sources] section:

   mysqlsvr=SQL Server

There will be a section called [mysqlsvr] in the ODBC.INI and it will

have entries of the following form:

   DRIVER=c:\windows\system\sqlsrvr.dll

   Description=SQL\Server on server Unixmc

   OemToAnsi=No

   Network=wdbftptc

   Address=11.1.4.40,3180

The DRIVER entry points to the location of the SQL Server driver. It

is located on the System subdirectory of the Windows directory.

The Description entry describes what kind of a data source this is.

This is something that you can change when setting up the data source

by using ODBC Administrator.

The OemToAnsi entry indicates whether conversion needs to be done from

the OEM code page to the ANSI code page. Note that this is not the

same as the translation DLL.

The Network entry indicates the name of the net-library.

The Address entry indicates the network address.

The WIN.INI file will have the following entry in its [SQLSERVER] section:

   mysqlsrvr=wdbftptc,11.1.4.40,3180

When you run a SQLConnect or SQLDriverConnect command and choose to

connect to the mysqlsvr data source, the Driver manager looks in the

ODBC.INI file to find the name and location of the SQL Server driver.

It looks for the DRIVER entry described above and loads it into

memory.

Next, the SQL Server driver looks in the WIN.INI file's [SQLSERVER]

section for mysqlsvr entry where it picks up the name of the

net-library. Then it loads the net-library name (wdbftptc in this

case) into the memory. Next, it looks at the entry again to get the

address of the server which it passes on to the net-library. If there

is no address following the name of the net-library, it passes the

name of the data source to the net-library, as the network address.

Db-library users should note that unlike W3DBLIB.DLL, the SQL Server

driver does not look at the dsquery entry unless dsquery is a data

source in the ODBC.DLL file.

If you are using Microsoft Access, this sequence of operations take

place when you attach a SQL Server table. If you are using Microsoft

Visual Basic version 2.0, it takes place in response to the

OpenDataBase call.

Additional reference words: 1.00 1.10 2.00


INF: Sorting String Values Based on their Numeric Values

 Article Number: Q96112

 CREATED: 08-MAR-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

To preface this article, I have a database that contains a product

code column. It is a text data type but I store numbers from 1 to 999

and each code can have a single letter for a suffix. For instance, I

might have the following codes: 10a, 1d, 100b, 24c, 24a, 1, 89b, and

14. I want to view this data so that it is sorted on the code. It

should appear like this: 1, 1d, 10a, 14, 24a, 24c, 89b, and 100b.

This article discusses one method for doing this. It requires basic

knowledge of Microsoft Access queries and functions.

MORE INFORMATION

You need to use a query to view your data so that it is sorted on the

code. This will work as long as the numbers do not exceed 1000 (if

they do, you can add to this solution to accept larger numbers), there

can be only one character digit after the number (that is, a, b, c;

not aa, bc, cde), and numbers cannot have leading zeros (that is, 01,

02, 03, and so forth).

The query grid appears as follows:

   Query: Query1

   ---------------------------------------------

   Field: ID

      Show: Yes

   Field: PRE: Val([ID])

      Sort: Ascending

   Field: SUF: IIF(Val([ID])<10,Mid([ID],2,1),_

               IIF(Val([ID]) between 10 and 99,_

               MID([ID],3,1),Mid([ID],4,1)))

          Sort: Ascending

This separates the numeric value (PRE) and the string value (SUF) into

two separate (temporary) fields in the query. The query sorts on the

individual pieces but shows only the true ID field (assuming your

field name is ID).

Additional reference words: 1.00 1.10 2.00 alphanumeric sort


PRB: RunCode Macro May Not Evaluate Conditions

 Article Number: Q96113

 CREATED: 08-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If you execute a RunCode macro with a condition that evaluates a

control on a form, it runs the code specified regardless of whether

the condition is met.

CAUSE

This will happen if the function specified in the action argument

is preceded by an equal sign (=).

RESOLUTION

The macro action argument requires only the name of the Access

Basic function procedure to execute and does not require an equal

sign before the function name.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create an unbound form with two unbound text box controls named

   Field1 and Field2. Save the form as Form1.

2. In a new module, create the following sample function:

      '****************************************************

      'Declaration section of the module

      '****************************************************

      Option Explicit

      Function TestFunction()

         MsgBox "Test"

      End Function

3. Create the following new macro, and then save it as Test1:

      Macro Name   Condition                  Action

      -----------------------------------------------

      Test1        Forms![Form1]![Field1]=2   RunCode

      Test1 Actions

      ---------------------------------

      RunCode

         Function Name: =TestFunction()

4. Open Form1 in Design view. Assign the Test1 macro to Field1's OnExit

   property.

5. View the form in Form view. Enter "1" (without quotation marks) in

   Field1 and then press the TAB key. Note that the message box appears

   even though the condition in the macro was not met.

Additional reference words: 1.00 1.10 function condition ignored


INF: How to Use the Windows OpenFile Dialog Box

 Article Number: Q96114

 CREATED: 08-MAR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to use the OpenFile dialog box from Access

Basic.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

MORE INFORMATION

The OpenFile common dialog box can be implemented in Microsoft Access

through the use of the Windows GetOpenFileName() application

programming interface (API) function. Using this function will

simplify programming issues for the developer. This function creates a

system-defined dialog box, familiar throughout Windows, that makes it

possible for the user to select a file to open. This function will

return a valid file to the programmer that is fully qualified with the

path name. The developer can customize how the system will handle

specific situations, such as specifying that the file must exist when

the user wants to save a file through the use of flags.

To use the code below, paste the function and declarations into a

module.

Notes:

 - In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

 - You may have some Microsoft Windows API functions defined in an existing

   Microsoft Access library; therefore, your declarations may be

   duplicates. If you receive a duplicate procedure name error message,

   remove or comment out the declarations statement in your code.

'-------------------------------------------------------

' Global Declaration Section

'-------------------------------------------------------

Option Compare Database

Option Explicit

Type tagOPENFILENAME

     lStructSize As Long

     hwndOwner As Integer

     hInstance As Integer

     lpstrFilter As Long

     lpstrCustomFilter As Long

     nMaxCustFilter As Long

     nFilterIndex As Long

     lpstrFile As Long

     nMaxFile As Long

     lpstrFileTitle As Long

     nMaxFileTitle As Long

     lpstrInitialDir As Long

     lpstrTitle As Long

     Flags As Long

     nFileOffset As Integer

     nFileExtension As Integer

     lpstrDefExt As Long

     lCustData As Long

     lpfnHook As Long

     lpTemplateName As Long

End Type

Declare Function GetOpenFileName% Lib "COMMDLG.DLL" (_

                    OPENFILENAME As tagOPENFILENAME)

Declare Function GetSaveFileName% Lib "COMMDLG.DLL" (_

                    OPENFILENAME As tagOPENFILENAME)

Declare Function lstrcpy& Lib "Kernel" (ByVal lpDestString As Any,_

                    ByVal lpSourceString As Any)

Dim OPENFILENAME As tagOPENFILENAME

Global Const OFN_READONLY = &H1

Global Const OFN_OVERWRITEPROMPT = &H2

Global Const OFN_HIDEREADONLY = &H4

Global Const OFN_NOCHANGEDIR = &H8

Global Const OFN_SHOWHELP = &H10

Global Const OFN_ENABLEHOOK = &H20

Global Const OFN_ENABLETEMPLATE = &H40

Global Const OFN_ENABLETEMPLATEHANDLE = &H80

Global Const OFN_NOVALIDATE = &H100

Global Const OFN_ALLOWMULTISELECT = &H200

Global Const OFN_EXTENSIONDIFFERENT = &H400

Global Const OFN_PATHMUSTEXIST = &H800

Global Const OFN_FILEMUSTEXIST = &H1000

Global Const OFN_CREATEPROMPT = &H2000

Global Const OFN_SHAREAWARE = &H4000

Global Const OFN_NOREADONLYRETURN = &H8000

Global Const OFN_NOTESTFILECREATE = &H10000

Global Const OFN_SHAREFALLTHROUGH = 2

Global Const OFN_SHARENOWARN = 1

Global Const OFN_SHAREWARN = 0

'-------------------------------------------------------

' Open Common Dialog Function

'-------------------------------------------------------

Function OpenCommDlg ()

  Dim Message$, Filter$, FileName$, FileTitle$, DefExt$

  Dim Title$, szCurDir$, APIResults%

    '*Define the filter string and allocate space in the "c" string

    Filter$ = "Access(*.mdb)" & Chr$(0) & "*.MDB;*.MDA" & Chr$(0)

    Filter$ = Filter$ & "Text(*.txt)" & Chr$(0) & "*.TXT" & Chr$(0)

    Filter$ = Filter$ & "Batch(*.bat)" & Chr$(0) & "*.BAT" & Chr$(0)

    Filter$ = Filter$ & Chr$(0)

    '* Allocate string space for the returned strings.

    FileName$ = Chr$(0) & Space$(255) & Chr$(0)

    FileTitle$ = Space$(255) & Chr$(0)

    '* Give the dialog a caption title.

    Title$ = "My File Open Dialog" & Chr$(0)

    '* If the user does not specify an extension, append TXT.

    DefExt$ = "TXT" & Chr$(0)

    '* Set up the defualt directory

    szCurDir$ = CurDir$ & Chr$(0)

    '* Set up the data structure before you call the GetOpenFileName

    OPENFILENAME.lStructSize = Len(OPENFILENAME)

    'If the OpenFile Dialog box is linked to a form use this line.

    'It will pass the forms window handle.

    OPENFILENAME.hwndOwner = Screen.ActiveForm.hWnd

    'If the OpenFile Dialog box is not linked to any form use this line.

    'It will pass a null pointer.

    OPENFILENAME.hwndOwner = 0&

    OPENFILENAME.lpstrFilter = lstrcpy(Filter$, Filter$)

    OPENFILENAME.nFilterIndex = 1

    OPENFILENAME.lpstrFile = lstrcpy(FileName$, FileName$)

    OPENFILENAME.nMaxFile = Len(FileName$)

    OPENFILENAME.lpstrFileTitle = lstrcpy(FileTitle$, FileTitle$)

    OPENFILENAME.nMaxFileTitle = Len(FileTitle$)

    OPENFILENAME.lpstrTitle = lstrcpy(Title$, Title$)

    OPENFILENAME.Flags = OFN_FILEMUSTEXIST Or OFN_READONLY

    OPENFILENAME.lpstrDefExt = lstrcpy(DefExt$, DefExt$)

    OPENFILENAME.hInstance = 0

    OPENFILENAME.lpstrCustomFilter = 0

    OPENFILENAME.nMaxCustFilter = 0

    OPENFILENAME.lpstrInitialDir = lstrcpy(szCurDir$, szCurDir$)

    OPENFILENAME.nFileOffset = 0

    OPENFILENAME.nFileExtension = 0

    OPENFILENAME.lCustData = 0

    OPENFILENAME.lpfnHook = 0

    OPENFILENAME.lpTemplateName = 0

    '* This will pass the desired data structure to the Windows API,

    '* which will in turn it uses to display the Open Dialog form.

    APIResults% = GetOpenFileName(OPENFILENAME)

    If APIResults% <> 0 Then

        '* Note that FileName$ will have an embedded Chr$(0) at the

        '* end. You may wish to strip this character from the string.

      FileName$ = Left$(FileName$, InStr(FileName$, Chr$(0)) -1

        Message$ = "The file you chose was " + FileName$

    Else

        Message$ = "No file was selected"

    End If

    MsgBox Message$

End Function

REFERENCES

==========

"Microsoft Windows Software Development Kit Programmer's Reference,

Volume 2: Functions," version 3.1

Additional reference words: 1.00 1.10 2.00


PRB: Example Has Wrong Number for Dlookup Ship Postal Code

 Article Number: Q96116

 CREATED: 08-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The example on page 145 of the Microsoft Access "Language Reference"

manual shows a number for Ship Postal Code that does not exist in the

sample database NWIND.MDB. The sentence reads as follows:

   In the following example from the Orders table of the NWIND.MDB

   database, Ship Postal Code is the name of a field, and 98008 is a

   string literal.

RESOLUTION

The example on page 145 should read:

   In the following example from the Orders table of the NWIND.MDB

   database, Ship Postal Code is the name of a field, and 94117 is a

   string literal.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10 docbug checkpage


PRB: NWIND.MDB Query with Criteria Displays Data in Odd Order

 Article Number: Q96419

 CREATED: 16-MAR-1993

 MODIFIED: 22-AUG-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you create a query to display the Category Name from the sample

database NWIND.MDB Categories table, the results appear in an order

different than what is in the table. Even though the natural order of the

Categories table is Beverages then Seafood, the query datasheet shows the

opposite order.

CAUSE

The query will determine the fastest way to obtain the data.

The order in which the records appear in the table may not be the

logical order. This will result in an "odd" order returned by the

query.

RESOLUTION

In the query you should choose the sort order you want to see the

data displayed. Choose Ascending sort order for the Category Name

field to have the names listed in alphabetical order.

STATUS

This behavior is by design.

MORE INFORMATION

Unless you specify the sort order in your query, there is the

possibility that data will appear out of order.

Steps to Reproduce Behavior

---------------------------

Follow these steps in the sample database NWIND.MDB:

1. Create a new query based on the Categories table.

2. Drag the Category Name field onto the QBE grid.

3. Enter "Like BEV* OR SEAF*" (without the quotation marks) in the

   Criteria Row.

4. Run the query.

The resulting dynaset will put "Seafood" above "Beverages," even

though the table order is different.

Additional reference words: 1.00 1.10


PRB: Objects Cannot Be User-Defined Data Type Elements

 Article Number: Q96420

 CREATED: 16-MAR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You receive the following error message when attempting to use

a Microsoft Access defined object data type as a user-defined data

type element:

   Expected: Integer or Long or Single or Double or Currency or String

   or Variant or Identifier.

CAUSE

Objects predefined by Microsoft Access are not supported as user-defined

data type elements.

STATUS

This behavior is by design.

MORE INFORMATION

Microsoft Access defines eight object data types: Control, Database,

Dynaset, Form, QueryDef, Report, Snapshot, and Table. You can use the

Type statement in the Declarations section of a module to define your

own data type. The user-defined data type cannot be one of the eight

predefined data types.

Steps to Reproduce Behavior

---------------------------

1. Create a new module.

2. In the Declarations section, attempt to define a structure as

   follows:

      Type ControlInfo

        Ctl as Control

      End Type

3. From the Run menu, choose Compile All.

You will receive the above error message.

REFERENCES

==========

For more information, search for "Type Statement," then "Object Data

Types" using the Microsoft Access Help menu.

Microsoft Access "Introduction to Programming," version 1.0, Chapter 5,

"Variables, Constants, and Data Types," page 43

Additional reference words: 1.00 1.10 2.00


PRB: Properties Do not Reset Between Crosstab and Make Table

 Article Number: Q96456

 CREATED: 17-MAR-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you choose Crosstab as the query type, by default all columns in

the QBE grid have Group By in the Totals section. If you change the

query type to Make Table, these column properties do not change.

CAUSE

When you change the query type, Microsoft Access removes the rows that

are not allowed and displays rows that are required. Any other rows

that are optional remain on the QBE grid. Since Make Table queries can

include totals, the Total row remains.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create a new query.

3. Add the Employee Sales for 1991 table.

4. Bring the first two fields from the Field List down to the QBE

   grid.

5. From the Query menu, choose Crosstab.

6. From the Query menu, choose Make Table.

7. Type a table name in the Query Properties dialog box.

Notice that the Group By attribute remains in the Total property.

Additional reference words: 1.00 1.10 2.00


PRA: Cannot Paste Column If Focus Is on One Cell in Query

 Article Number: Q96457

 CREATED: 17-MAR-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you cut or copy a query grid column, you can paste it back in only if a

column is selected. If there is no selection (that is, if the focus is on a

single cell), all information is erroneously pasted into one cell. This

same behavior occurs when copying and pasting a query grid row.

CAUSE

Before you paste information from the Clipboard, select an object that has

the same size as the information in the clipboard. In this example, select

an entire column when you paste the information into the query grid.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a query.

2. Select an entire column in the Query Grid (click the mouse once at

   the top of a column when the mouse cursor changes to a down arrow).

3. From the Edit menu, choose either Cut or Copy.

4. Select a cell (to paste the copied column into) and choose Paste

   from the Edit menu.

The pasted values are not correct. The initial value displayed will

probably be a 1, which indicates that the Show box was selected in the

column you copied. You can scroll through values in the cell by using the

up and down arrow keys. If you attempt to move off the cell by clicking

elsewhere on the grid, you will receive a syntax error message.

When you cut or copy a row to the Clipboard, the row is copied to the

Clipboard as tab-separated data. When you paste a row into a single cell,

the tabs appear as rectangular characters.

This behavior occurs pasting into any object in Microsoft Access.

REFERENCES

==========

For more information on pasting information in the query grid, query on the

following words here in the Microsoft Knowledge Base:

   queries and paste

Additional reference words: 1.00 1.10 2.00


INF: Functions to Left and Right Pad Character Strings

 Article Number: Q96458

 CREATED: 17-MAR-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

An imported file may contain field values that have a combination of

numeric and alphabetic characters. These fields do not sort in proper

order if they contain variable numbers of characters. This article

describes functions that you can use to pad these values with a

selected character to produce values of consistent length.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic," in version 2.0.

MORE INFORMATION

Suppose you have a table that contains Customer ID numbers with values

entered as follows:

   Customer ID

   -----------

   123B

   1231

   1231B2

   B123

In a query, these numbers would sort in ascending order as follows:

   Unpadded        Right Padded    Left Padded

   -------------------------------------------

   1231            123100          001231

   1231B2          1231B2          00123B

   123B            123B00          00B123

   B123            B12300          1231B2

Right padding does not change the sort order; however, it is useful if

you need to make all values a consistent number of characters. Left

padding, however, will allow proper sorting.

To create a left-padding function and a right-padding function, enter

the following code in a new or existing module in your database.

Note: In the following sample code, an underscore (_) is used as a

line continuation character. Remove the underscore when re-creating

this code in Access Basic.

'*********************************************************************

'Declarations section of the module.

'*********************************************************************

Option Explicit

Dim x As Integer

Dim PadLength As Integer

'=====================================================================

'The following function will left pad a string with a specified

'character. It accepts a base string which is to be left padded with

'characters, a character to be used as the pad character, and a

'length which specifies the total length of the padded result.

'=====================================================================

Function Lpad (MyValue$, MyPadCharacter$, MyPaddedLength%)

   Padlength = MyPaddedLength - Len(MyValue)

   Dim PadString As String

   For x = 1 To Padlength

      PadString = PadString & MyPadCharacter

   Next

   Lpad = PadString + MyValue

End Function

'=====================================================================

'The following function will right pad a string with a specified

'character. It accepts a base string which is to be right padded with

'characters, a character to be used as the pad character, and a

'length which specifies the total length of the padded result.

'=====================================================================

Function Rpad (MyValue$, MyPadCharacter$, MyPaddedLength%)

   Padlength = MyPaddedLength - Len(MyValue)

   Dim PadString As String

   For x = 1 To Padlength

      PadString = PadString & MyPadCharacter

   Next

   Rpad = MyValue + PadString

End Function

The following example shows an update query that would modify the

Customer ID field by left padding the field with the 0 (zero)

character. You will use the Lpad function that was created in step #2.

   Update Query: Leftpad Customer Number

   ---------------------------------------

   Field name: Customer ID

      Update to: Lpad([Customer ID],"0",6)

Additional reference words: 1.00 1.10 2.00 constant


INF: Extend Mode and ESC in Form View

 Article Number: Q96459

 CREATED: 17-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The ESC key performs two different functions in Form view in Microsoft

Access. If you are in Extend mode, pressing ESC will exit Extend mode.

While entering data in a control, pressing ESC activates the Undo

feature and causes the data to be deleted. This can create a small

inconvenience when you are in Extend mode and doing data entry

simultaneously. Any effort to exit Extend mode by pressing ESC will

erase your data in the current control (the one with the focus) in

addition to leaving Extend mode.

MORE INFORMATION

Extend mode is used to select fields and records in Datasheet and Form

view, and in a report's Design view. It also can be used in grids to select

cells and rows.  To make a selection using Extend mode, position your

cursor in a field or control, then press the F8 function key to turn Extend

mode on. You will notice that EXT appears in the status bar. Once you have

turned Extend mode on, you can press F8 repeatedly to select the word, the

field, the record, and then all records.

To reverse the F8 selection, use SHIFT+F8. The ESC key will exit Extend

mode, as indicated in the summary, but it will also erase your data in the

control with focus.

Additional reference words: 1.00 1.10 2.00


PRB: Restore Macro Action Does Not Appear to Work

 Article Number: Q96460

 CREATED: 17-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

In a macro, the Restore action does not restore a window previously

minimized by the Minimize action.

CAUSE

When an object is minimized in Windows, the focus is automatically

shifted to the next window. The Restore action attempts to restore

a window that is already in a restored condition.

RESOLUTION

To make Windows act on the minimized object, you must first select

the object. To select the minimized object, put a SelectObject

action in the macro immediately before the Restore action.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access and open a database.

2. Create the following macro in a new macro group called Macro1:

      Macro Name     Action

      ---------------------

      Test1          Minimize

                     Restore

3. Create a new form called Form1 and place a command button on it.

   Give the command button the following properties:

      Object: Command Button

      ----------------------

      OnPush: [Macro1].[Test1]

4. Open Form1 in Form view and push the command button.

The form will minimize as expected, but will not restore.

Additional reference words: 1.00 1.10 2.00


PRB: List Box Does Not Scroll When Scroll Box Is Dragged

 Article Number: Q96461

 CREATED: 17-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you have a list box with a vertical scroll bar on a form, and you drag

the scroll box up and down the list box, the list box contents will not

scroll until you release the scroll box.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new form.

2. Place a list box control on the form with the following properties:

      Object: List box

      --------------------------------------------------

      RowSourceType: Value List

      RowSource: 1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0

3. View the form.

4. Drag the list box's vertical scroll box up and down. The list box

   contents do not scroll until you release the scroll box.

Additional reference words: 1.00 1.10 2.00


INF: Misleading Documentation for Cancel Property

 Article Number: Q96462

 CREATED: 17-MAR-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SUMMARY

The documentation for the Cancel property, as well as for the term

"Cancel," is misleading. It implies that the purpose of the Cancel

property is to allow you to select a Yes button to enable Cancel and

thus undo the current record (just as if you chose the Undo Current

Record command from the Edit menu).

This is not true; the Cancel property actually plays a much smaller

role.

MORE INFORMATION

In Microsoft Access version 1.0, the Help topic for "Cancel Property"

states:

   Use the Cancel property to give the user the option of canceling

   uncommitted changes and returning the form to its previous state.

The Microsoft Access "Language Reference" manuals for versions 1.0 and


INF: Using "<", ">", and "=" Operators in Query Parameters

 Article Number: Q96463

 CREATED: 17-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes a simple, non-programmatic way to allow a user

to type the comparison operators "<", ">", and "=" in query parameters.

Due to the nature of the method, query criteria should be kept as

simple as possible. For more complex criteria, you will have to use

Access Basic code.

MORE INFORMATION

1. Create a table called Names with the following fields:

      Table: Names

      -----------------

      Field: First Name

      DataType: Text

      Field: Last Name

      DataType: Text

      Field: Age

      DataType: Number

      Format: Single

2. Enter the following data:

      First Name   Last Name   Age

      ----------------------------

      Tom          Smith        35

      Anne         Howard        7

      Jim          Bowie        20

      Sue          Thomas       44

3. Create the following query based on the Names table:

      Query: List Names

      -----------------

      Field: First Name

      Field: Last Name

      Field: Age

         First Criteria Line: =Mid([Enter Age],2)

         Second Criteria Line: <Mid([Enter Age],2)

         Third Criteria Line: >Mid([Enter Age],2)

         Fourth Criteria Line: <leave blank>

         Show: True

     Field: Expr1:Left([Enter Age],1)

        First Criteria Line: "="

        Second Criteria Line: "<"

        Third Criteria Line: ">"

        Fourth Criteria Line: Is Null

        Show: False

The criteria are entered on successive lines (that is, "Criteria 1" is

entered on the "Criteria" line, "Criteria 2" is entered on the "Or"

line, and "Criteria 3" and "Criteria 4" are entered on the blank lines

below that).

Save the query and run it. Sample output is given for each of the four

types of input:

   [Enter Age]     Output

   ------------------------------------------

   <leave blank>   Tom          Smith      35

                   Anne         Howard      7

                   Jim          Bowie      20

                   Sue          Thomas     44

   <21             Anne         Howard      7

                   Jim          Bowie      20

   >21             Tom          Smith      35

                   Sue          Thomas     44

   =7              Anne         Howard      7

NOTE: The query is not designed to allow combinations of "<", ">", and

"=", such as ">=20". You must always use one of the three operators,

no more, no less, or you must leave the whole parameter blank.

The SQL for the query is given below:

   SELECT DISTINCTROW

      [First Name], [Last Name], Age

   FROM

      Names

   WHERE

      (Age=Mid([Enter Age],2) AND Left([Enter Age],1)="=")

   OR

      (Age<Mid([Enter Age],2) AND Left([Enter Age],1)="<")

   OR

      (Age>Mid([Enter Age],2) AND Left([Enter Age],1)=">")

   OR

      (Left([Enter Age],1) Is Null)

   WITH OWNERACCESS OPTION;

Additional reference words: 1.00 1.10 2.00


INF: Using a Subquery to Simulate a SQL Sub-SELECT Statement

 Article Number: Q96464

 CREATED: 17-MAR-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article explains how to use a subquery to simulate a SQL

sub-SELECT statement. The procedure below uses the sample database

NWIND.MDB to generate a list of customers who have used all three

shippers to deliver their orders.

MORE INFORMATION

You either can create a query (called Query1) based on the Customers

and Orders tables and another query (called Query2) based on Query1,

or you can enter the equivalent SQL statements. This article contains

procedures for both methods.

Creating Query1

---------------

To create Query1 interactively, use the following steps:

1. In the Database window, create a new query by choosing Query and

   then choosing New.

2. In the Table/Query box, select the Customers table and choose Add.

   Select the Orders table and choose Add again.

3. Choose Close. You have now added these two tables to the query. The

   tables are joined on the Customer ID field.

4. Select the Customer ID field in the Customers table and drag it to

   the first cell in the Field record in the query grid. Select the

   Ship Via field from the Orders table and drag it to the second cell

   in the Field record.

5. Save this query as Query1 and choose Close.

The following is the SQL statement displayed for Query1 when you

choose SQL from the View menu:

  SELECT  DISTINCT Customers.[Customer ID], Orders.[Ship Via]

  FROM Customers, Orders,

  Customers INNER JOIN Orders ON Customers.[Customer ID] =

  Orders.[Customer ID];

Creating Query2

---------------

Create a second query (subquery) based on Query1.

To create Query2 interactively, use the following steps:

1. Create another new query, using step 1 in the previous procedure.

   Select Query1 as the source of your data.

2. Hold down the CTRL key and select the Customer ID and Ship Via

   fields from Query1. Drag these fields to the new query grid.

3. Choose the Sum button on the toolbar.

   NOTE: The Sum button looks like the Greek letter Sigma.

4. In the Totals list box in the Customer ID field, select Group By;

   in the Ship Via field, select Count.

5. Clear the Show check box in the Ship Via field and type "=3" in the

   Criteria record.

6. Save this query as Query2. Choose Close.

The following is the SQL statement for the second query:

  SELECT  Query1.[Customer ID]

  FROM Query1

  GROUP BY Query1.[Customer ID]

  HAVING (((Count(Query1.[Ship Via]))=3));

When you run Query2, a list of those customers who have used three

different shippers is displayed.

sub-select SQL relational

Additional reference words: 1.00 1.10 subquery sub-query


PRB: OLE MS Excel, Windows Word Do Not Close When Form Closed

 Article Number: Q96465

 CREATED: 17-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Microsoft Access will not close some OLE servers when you close a table,

form, or report while editing an OLE object.

STATUS

This behavior is by design.

MORE INFORMATION

Microsoft Access will not close Multiple Document Interface (MDI)

applications, even if they were started as an OLE server for an object

stored in Microsoft Access. An MDI application can edit and display

multiple documents at once.

Microsoft Excel version 3.0 and Microsoft Word version 2.0 for Windows are

examples of applications that will be left running if you double-click an

existing embedded object in Microsoft Access and then switch back to

Microsoft Access and close the table, form, or report without closing the

embedded object.

Steps to Reproduce Behavior

---------------------------

1. Open a form in Microsoft Access, and choose Insert Object from the

   Edit menu. In the list of available OLE servers, select Microsoft

   Excel Worksheet.

2. Create the object (worksheet) you want to embed. Once the object is

   completed, close Microsoft Excel. Save the Access form and close it.

3. Reopen the form and double-click the embedded object that you just

   created. Once Microsoft Excel opens and the object is displayed,

   minimize Microsoft Excel and close the Microsoft Access form. Microsoft

   Excel will still be running. You must activate Microsoft Excel and close

   it.

If you repeat these steps with applications such as Paintbrush,

Microsoft Draw, or Note-It (these are not MDI applications), you will

note that these servers are closed when the object is closed.

Additional reference words: 1.00 1.10 2.00


PRB: Error When Installing Access on DEC Pathworks Network

 Article Number: Q96466

 CREATED: 17-MAR-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

During a network server installation of Microsoft Access on a DEC

Pathworks 4.x network, the following error message may be displayed:

   You must run setup/a before setup/n

CAUSE

You probably attempted to install Microsoft Access to a Disk Services

drive.

Microsoft Windows considers DEC Pathworks 4.x Disk Services to be a

local disk drive. Windows considers DEC Pathworks 4.x File Services to

be a network drive.

RESOLUTION

To perform a network server installation of Microsoft Access on a DEC

Pathworks 4.x network, you must install to a File Services drive. You

cannot successfully complete a network installation to a Disk Services

drive.


PRA: GP Fault in Datasheet View of a Form

 Article Number: Q96467

 CREATED: 17-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You receive the following error messages when you switch a form to

Datasheet view:

 - An error has occurred in your application. If you choose Ignore, you

   should save your work in a new file. If you choose Close, your

   application will terminate.

 - MSACCESS caused a general protection fault in MSACCESS.EXE.

CAUSE

A macro is assigned to the form's OnCurrent property, and the macro

includes a GoToControl action that sets the focus on a control located

in the page header section. There is no visible page header section

when you view the form in Datasheet view.

RESOLUTION

If you are using a macro that includes a GoToControl action that sets

the focus on a control located in the page header section of the form,

do not view the form in Datasheet view.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version

2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Create a GoToControl macro that goes to any control on a form, and

   then assign the macro to the OnCurrent property of the form.

2. Place this control in the page header section of the form.

3. View the form in Datasheet view.

Additional reference words: 1.00 1.10 GPF


INF: Requirements to Connect to Sybase SQL Server

 Article Number: Q96468

 CREATED: 17-MAR-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The SQL Server ODBC driver that ships with Microsoft Access is

designed to work with both Microsoft SQL Server and Sybase SQL Server.

This article describes requirements for running Microsoft Access

versions 1.0, 1.1, and 2.0 with Sybase SQL Server.

MORE INFORMATION

The SQL Server ODBC driver works with both Microsoft and Sybase SQL

Servers. However, the Microsoft applications that shipped with the SQL

Server driver (Visual Basic version 2.0 and Microsoft Access) were

tested and verified with Microsoft SQL Server only.

The following sections discuss the issues associated with using the

Microsoft SQL Server ODBC driver with Sybase SQL Server.

ODBC Driver Requires Catalog Stored Procedures

----------------------------------------------

The ODBC driver requires the catalog stored procedures that ship with

SQL Server version 4.2a. Until the 4.9.1 Sybase release, these catalog

procedures did not ship with Sybase servers. To install the

procedures, you must run the INSTCAT.SQL script against the Sybase

server.

NOTE: Sybase changed the system catalogs in their 4.8 release.

Therefore, Sybase SQL Server versions 4.8 and later require a modified

script called INSTCAT.48. This revised script is available from

Microsoft Product Support and CompuServe.  This script is required with

Microsoft Access version 1.0. With Microsoft Access 1.1 and 2.0, the

INSTCAT.SQL file applies to all versions of Microsoft SQL Server, as well

as to all versions of Sybase SQL Server.

For more information on the INSTCAT.48 script, query on the following

words here in the Microsoft Knowledge Base:

   access and sybase and instcat.48

ODBC Driver Comes with Named Pipe Net-Library

---------------------------------------------

The SQL Server ODBC driver that ships with Microsoft Access and Visual

Basic 2.0 comes with the Named Pipe Net-Library. To connect to Sybase,

you need to use the SQL Bridge product or buy the Net-Libraries from

Sybase for each client machine. (The only Sybase Net-Library that has

gone through interoperability testing is the Microsoft TCP/IP

Net-Library.)

Both Microsoft Access and Visual Basic 2.0 use the network in a way

that is atypical of Windows applications; they use multiple

simultaneous connections and use asynchronous calls. For this reason,

Sybase Net-Libraries may fail with these products in some network

configurations. Microsoft and Sybase are discussing how best to

perform interoperability testing with the various network

configurations supported by Sybase (FTP, Wollongong, Novell and other

TCP/IP, DECnet, and so forth).

The following is a list of Net-Libraries that Microsoft has confirmed

to work with Microsoft Access/ODBC and Sybase SQL Server:

NOTE: An EBF is an Emergency Bug Fix, available from Sybase.

Net-Lib                                              EBF #

-------------------------------------------------------------------

Named Pipe Net-Libraries 1.0

Novell LAN WorkPlace TCP 4.0 with 1.0 Net-Library

Netware (SPX) 1.0 Net-Library

FTP 2.05 with Net-Libraries 1.0 and 1.0.1

Microsoft TCP/IP 1.0 with Net-Lib 1.0.1

FTP 2.1 with Net-Library 1.0.1                       1285

FTP 2.2 with Net-Library 1.02                        2300

NetMangae TCP/IP 3.06 Net-Library 1.0                1326

PC-NFS Net-Library 1.0                               1334

Wollongong Pathway Net-Lib 1.0                       1327*

DECNET (WDBDECDE.DLL)                                1561, May 1993

*NOTE: To use Wollongong Pathway, the files C37603.EXE and C39489.EXE are

required in addition to EBF #1327. This is required by Wollongong Pathway

and is not specific to running ODBC or Microsoft Access. These files are

available from Wollongong, either through their BBS or through CompuServe.

Contact Wollongong for more information.

The two additional files are for the latest version of Wollongong's Pathway

Access, version 2.1.1. (The version number for the run-time software is

1.2.) The run-time software is shipped with Pathway Access, but can also be

ordered separately from Wollongong. The run-time software is all that is

needed to run Net-Lib.

Some of the products mentioned above are manufactured by vendors

independent of Microsoft; we make no warranty, implied or otherwise,

regarding these products' performance or reliability.

Additional reference words: 1.00 1.10 2.00 1.0  net-lib net-library net


INF: Short Description of a Dynaset

 Article Number: Q96469

 CREATED: 17-MAR-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

"Dynaset" is a Microsoft Access term for an updateable view. Rather

than storing the actual data locally for the view, pointers to the

data are stored locally in memory. Displaying the data in the view

involves using the pointers to get the data from the underlying

tables. Also, these pointers make it possible to update the data as

well.

Additional reference words: 1.00 1.10 2.00


PRA: Error: Not Enough System Resources in Access

 Article Number: Q96471

 CREATED: 17-MAR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

Running a Microsoft Access query can result in this error:

   Not enough system resources to update display.

CAUSE

Changing the Row Height and Font after initially running a

query causes

this error to occur the next time that query is run.

RESOLUTION

Choose the OK button when you get the above error message.

The query

runs and displays its results with the default settings. The

next time

you run the query, no error will appear.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access version

1.0. This problem was corrected in Microsoft Access version

1.1.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB.

2. Run the Category List query. To run a query, choose the

Query

   button in the Database window. Select the desired query,

and then

   choose the Open button.

3. From the Layout menu, choose Row Height.

4. Change the setting to 12.0.

5. Choose Font from the Layout menu and change the font to

Microsoft Serif

   and the font size to 10.

6. Switch the query to Design view and choose Run from the

Query menu.

7. From the File menu, choose Close.

8. From the Database window, select the Category List query

and

   choose Open.

The error message appears. After choosing the OK button

(your only

option), you will see the query with the default row height,

font, and

font point size. The next time you run the query, no error

message

will appear.

REFERENCES


PRB: Navigation Button Unavailable in Main/Subform Wizard

 Article Number: Q96473

 CREATED: 17-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you are using the FormWizard to create a Main/Subform form, you

cannot always use the FormWizard's navigation buttons to move back to the

previous Wizard screen.

RESOLUTION

If you need to change the table or query that the main form is based on,

choose Cancel. You will need to restart the FormWizard.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

You can use the FormWizard's navigation buttons (Back and Next) to move

backward and forward within the FormWizard. You can move backward to

change the subform source, but you cannot move backward to change the

main form source.

Additional reference words: 1.00 1.10


PRA: Cue Cards Do not Use Standard Windows Menu

 Article Number: Q96474

 CREATED: 17-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you are using Cue Cards in Microsoft Access, you might notice that

the Control menu is not a standard Windows menu. For example, when you

click a menu item to select it, it does not become highlighted.

RESOLUTION

Although the Cue Cards Control menu does not look like the standard

Windows menu, its functionality is not impaired. You are still able

to select the menu items with your mouse.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

The Control menu is the uppermost left-hand corner of a window. The

standard Windows Control-menu commands allow you to resize, move, maximize,

and minimize that window.

Steps to Reproduce Problem

--------------------------

1. From the Help menu, choose Cue Cards.

2. From the Cue Cards Help screen, select I'm Not Sure.

3. Click the Cue Cards Control-menu box (the upper-left corner of the

   Cue Cards window).

4. Choose Minimize.

Although the word Minimize is not highlighted, the Cue Cards window will

become minimized.

REFERENCES

==========

For more information about the elements of a standard Microsoft window,

see the Microsoft Windows "User's Guide." For Windows version 3.0, see

Chapter 2, "Basic Skills," pages 21-22. For Windows version 3.1, see

Chapter 1, "Windows Basics," pages 8-9.

Additional reference words: 1.00 1.10 checkpage


INF: How to Convert to and from Unsigned Integers

 Article Number: Q96475

 CREATED: 17-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

There are situations in which calling functions from external dynamic link

libraries (DLLs) returns a 2-byte unsigned integer. Access Basic does not

support this data type. Correctly evaluating this data type requires

converting it from an unsigned integer to an Access Basic Long data type.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

The Access Basic integer data type has a range of -32,768 to 32,767.

An unsigned integer has a range of 0 to 65,536.

Access Basic uses the most significant bit to set the sign of the

value. Therefore, when a value exceeds 32,767, bit 16 is set to

reflect a negative number. To evaluate an unsigned integer, you must

manually adjust bit 16.

There are two methods you can use to convert to and from the unsigned

integer type to the Access Basic Long data type. The first method uses

basic arithmetic (65,536 is subtracted or added to the unsigned

integer). The second uses bit-wise operators. The arithmetic method

works as well as the bit-wise method; however, the arithmetic method

may be more readable, and the bit-wise method may be faster when

executed repetitively.

1. Open a new module or a previously created module and enter the

   following code:

   '*************************************************************

   'Declarations section of the module.

   '*************************************************************

   Option Explicit

   '=============================================================

   ' Arithmetic Method:

   ' ------------------

   ' Create the following ar_ConvertFromUnsignedInteger& (Uint%)

   '    and ar_ConvertToUnsignedInteger% (Bytes&) function in the

   '    Module. This first function reads in an unsigned integer

   '    and returns the converted value as a long. The second

   '    function reads in a long a returns an unsigned integer.

   '=============================================================

   Function ar_ConvertFromUnsignedInteger& (Uint%)

      If Uint% < 0 Then

         ar_ConvertFromUnsignedInteger& = Uint% + 65536

      Else

         ar_ConvertFromUnsignedInteger% = Uint%

      End If

   End Function

   Function ar_ConvertToUnsignedInteger% (Bytes&)

      If Bytes& > 32767 Then

         ar_ConvertToUnsignedInteger% = Bytes& - 65536

      Else

         ar_ConvertToUnsignedInteger% = Bytes&

      End If

   End Function

   '=============================================================

   ' Bitwise Method:

   ' ---------------

   ' Create the following bw_ConvertFromUnsignedInteger& (Uint%)

   '    and bw_ConvertToUnsignedInteger% (Bytes&) function in the

   '    Module. This first function reads in an unsigned integer

   '    and returns the converted value as a long. The second

   '    function reads in a long a returns an unsigned integer.

   '    The message box statement in the second function is used

   '    to prevent an overflow message when the value passed to

   '    the function is greater than 64 kilobytes.

   ' To illustrate what is taking place in the first bitwise function:

   '    Uint% equals -23584, a value returned from an external dynamic

   '    link library that is an unsigned integer and needs to be

   '    converted to an long:

   '        1010001111100000 (-23584)

   '    AND   11111111111111 (7FFF)

   '        ----------------

   '          10001111100000 (41952)

   '=============================================================

   Function bw_ConvertToUnsignedInteger% (Bytes&)

      Dim x%

      If Bytes& > 65535 Then

         MsgBox "You passed a value larger than 65535"

         Exit Function

      End If

      x% = Bytes& And &H7FFF

      bw_ConvertToUnsignedInteger% = x% Or -(Bytes& And &H8000)

   End Function

   Function bw_ConvertFromUnsignedInteger& (Uint%)

      bw_ConvertFromUnsignedInteger& = Uint% And &HFFFF&

   '-------------------------------------------------------------

   ' The &HFFFF& requires the & at the end of the hex number. This

   '   qualifies the hex number as 32 bit versus 16 bit.

   '-------------------------------------------------------------

   End Function

Examples of Using These Functions

---------------------------------

An external dynamic-link library (DLL) requires and returns an unsigned

integer. The Declare statement looks like the following:

   Declare Function External_Call% Lib "your.dll" (ByVal ValueToPass%)

The Declare statement uses integer data types because Access Basic

does not support unsigned integers. However, the external dynamic-link

library does not know this and returns an unsigned integer that must be

converted for use; therefore, the code may appear as follows:

   x% = External_Call(bw_ConvertToUnsignedInteger%(41952))

   y& = bw_ConvertFromUnsignedInteger&(x%)

Additional reference words: 1.00 1.10 2.00


PRB: Changes in Subform Design Do Not Update in Main Form

 Article Number: Q96477

 CREATED: 17-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

After editing a subform with the main form in Design view, the changes

you make to the subform are not committed until you close and reopen

the main form.

RESOLUTION

After editing the subform with the main form in Design view, close and

save the subform. Click in the subform control and press ENTER. Your

main form now reflects the changes that you made to its subform.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Open the Categories form in Design view.

3. Select the Category ID control.

4. Double-click anywhere inside the Categories Subform control to open

   it in Design view.

5. From the View menu, choose Field List. Drag the English Name field

   to the Category Subform control.

6. Exit and save the changes to the Categories Subform control. This

   action returns you to the the Categories form in Design view.

7. View the form in Form view.

Note that the field you added (English Name) is not in the subform.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, page 274

Additional reference words: 1.00 1.10 checkpage subform refresh update


PRB: Print Preview Displays Only First Line of Toggle Button

 Article Number: Q96543

 CREATED: 21-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you preview a form with a toggle button that contains text

without any spaces, if the text is longer than the size of the toggle

button, characters on the first line of the toggle button are

correctly displayed, but the remaining lines are either missing or

truncated. This happens when you use a Hewlett-Packard (HP) LaserJet

IIISi printer and you have selected either of the following screen

fonts: System or Microsoft Sans Serif.

CAUSE

In print preview, the method to display some system fonts on toggle

buttons is slightly different than the method used to actually print

the buttons.

RESOLUTION

Change the format of the toggle button control text to a printer font

or a TrueType font.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create an unbound form named Test.

2. Place a toggle button control on your form. Do not change the

   default size of the toggle button.

3. From the View menu, choose Properties.

4. Type the word "Caption" (without the quotation marks) in the

   Caption property.

5. Switch to Form view. (Note that the toggle button correctly wraps

   the text.)

6. From the File menu, choose Print Preview. Print preview truncates

   the letter "n." When you print the form, however, the text prints

   correctly.

Additional reference words: 1.00 1.10 2.00


INF: Using Microsoft Word to Edit and Spell Check Memo Field

 Article Number: Q96544

 CREATED: 21-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

You can use a word processor to edit memo fields stored in Microsoft

Access tables. Then you can check the spelling and grammar in your data.

This article describes how to use Microsoft Word for Windows to edit memo

fields.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access.

MORE INFORMATION

Note the following information before trying the example:

 - Microsoft Word for Windows must have the DOS TEXT Import/Export filter

   installed.

 - Only the most basic formatting will be preserved because memo fields

   do not support tabs, margins, fonts, or other fancy formatting.

 - Memo fields are limited to 32,000 characters (about 8-12 pages in

   Microsoft Word for Windows). Excess characters will be truncated.

 - This example is presented in the simplest terms. If you open

   the Microsoft Word document and return to Microsoft Access before

   you save the file, you will receive an "Access denied" error message

   when the Access Basic code tries to open the document that is already

   currently open in Microsoft Word.

The following example uses the Employees table in the NWIND.MDB database.

1. Create the following function in a new module.

   '******************************************************

   'Declarations section of the module

   '******************************************************

   Option Explicit

   '=====================================================

   'The following function EditMemo() calls Microsoft

   'Word for Windows

   '=====================================================

   Function EditMemo (MyEditBox As Control)

   Dim X%, LineInFile$, NewLine$, FileNum%, CarriageReturn_LineFeed$

   CarriageReturn_LineFeed$ = Chr$(13) & Chr$(10)

   FileNum% = FreeFile

   Open "TEMP.TXT" For Output As #FileNum%

   'save the text to temporary file for Microsoft Word for Windows

   If Not IsNull(MyEditBox) Then

      Print #FileNum%, MyEditBox

   Else

      MsgBox "There is no text to edit.  Abort."

      Exit Function

   End If

   Close #FileNum%

   X% = Shell("WINWORD.EXE TEMP.TXT", 3)

   MsgBox "Press Any Key to Return" ' required to pause the function

   'Assume completion of the edits in Microsoft Word, now read the text

   'and place it back into the edit control.

   FileNum% = FreeFile

   Open "TEMP.TXT" For Input As #FileNum%

   NewLine$ = ""

   Do While Not EOF(FileNum)

      Line Input #FileNum%, LineInFile$

      If NewLine$ <> "" Then

         NewLine$ = NewLine$ & CarriageReturn_LineFeed$

      End If

      NewLine$ = NewLine$ & LineInFile$

   Loop

   MyEditBox = NewLine$

   Close #FileNum%

   End Function

2. Create a new blank form and base it on the Employees table.

3. Place two text box controls (Last Name and Notes) on the form and

   assign the following properties:

      Object: Text box

      ------------------------

      ControlName: Last Name

      ControlSource: Last Name

      Object: Text box

      ------------------------------

      ControlName: Notes

      ControlSource: Notes

      OnDblClick: =EditMemo([Notes])

4. Save the form and switch to Form view.

5. Double-click the memo field to launch Microsoft Word for Windows.

   You will be presented with the Convert File dialog box. Select

   Text Only and then choose the OK button.

6. Perform the operations you want.

7. Exit from Microsoft Word for Windows and save the document.

8. Microsoft Access loads the changes back into the memo field.

For a more elegant solution, one that replaces the MsgBox routine,

query on the following words here in the Microsoft Knowledge Base:

   b_waccess and waitshell

Additional reference words: 1.00 1.10 2.00 spell check errmsg


PRB: Changed Field Names In Table Are Not Reflected In Query

 Article Number: Q96545

 CREATED: 21-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you create a query using an existing table and then change a

field name in that table, the new field name does not show in the

query grid when the query is reopened. The old field name in the

query grid has been made into an expression similar to this:

   Expr1: TableName.[Old FieldName]

CAUSE

Changes to table field names do not propagate up through the queries

based on that table.

RESOLUTION

Replace the new expression in the field cell of the query grid with

the correct field name from the table. The field list in the upper

half of the query window will show the current field names.

STATUS

This behavior is by design.

MORE INFORMATION

This behavior actually preserves the original query so you can see

what was originally included in the query.

Steps to Reproduce Behavior

---------------------------

1. Create the following table. Save it, and enter a few records:

      Table: Table1

      -------------

      Field Name:  OldName

      DataType:    Text

2. Create the following query adding the table that you created in

   step 1:

      Query Name: Query1

      ------------------

      Field Name: OldName

      Show:       True

3. Run this query. Notice that data in the OldName field shows up in

   Datasheet view of the query.

4. Open Table1 in design view and change the field OldName to

   NewName. Close and save the table.

5. Open Query1 in Design view. Notice that the field cell now shows the

   following:

      Expr1: Table1.[OldName]

   If you run the query, this field will be blank. To correct this, choose

   NewName from the list in the field cell of the query.

Additional reference words: 1.00 1.10 2.00 update structure


INF: Recovering MDB File Larger Than the 128- Megabyte Limit

 Article Number: Q96550

 CREATED: 21-MAR-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SUMMARY

A Microsoft Access version 1.0 database (.MDB file) is

limited to a

maximum size of 128 megabytes (MB). However, you can exceed

this limit by

importing large amounts of data or by creating objects that

cause the

limit to be exceeded.

MORE INFORMATION

In the event a Microsoft Access database exceeds the limit,

here are

two options you can use to attempt to remedy the situation:

1. If you are able to open the database, export some of the

objects to

   another database, and then delete them from the current

database.

available

2. If you are unable to open the database, try to compact

the database by

   using the Compact utility. It will work on files larger

than 128 MB,

   unlike the Repair utility.

Unfortunately, there are situations where neither one of

these options will

work. If this is the case, you will be unable to recover the

data using

Microsoft Access.

had exceeded

was corrupt.

so it may not

using version 1.0

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Appendix A,

page 663

Additional reference words: 1.00 checkpage


PRB: Label Placed in, Not to Left of, Command Button on Form

 Article Number: Q96573

 CREATED: 22-MAR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

In Microsoft Access version 1.x, when you place a command button on a form,

a label is placed in the top left corner of the command button control,

rather than to the left of the control. In Microsoft Access version 2.0,

there will be no label placed in the top left corner of the command button

control unless the Autolabel property is set to Yes.

RESOLUTION

In Microsoft Access 1.x, you can change the default AutoLabel property of

the command button to No before creating a new button from the toolbox. New

command buttons will not have a label created when they are placed on the

form. Alternately, you can move the label to a different location after the

control has been created. In Microsoft Access 2.0, the Autolabel property

is set to No by default.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

Follow these steps using the sample database NWIND.MDB:

1. Open the Suppliers form in Design view.

2. Choose the command button tool in the toolbox.

3. Place the control anywhere on the form. In Microsoft Access 1.x, the

   command button will display with a label in the top left corner. In

   Microsoft Access 2.0, the Command Button Wizard will be invoked and

   after you answer several questions, the command button will be placed on

   the form without a label unless the AutoLabel property has been changed

   to Yes.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, page 430.

Microsoft Access "User's Guide," version 2.0, Chapter 15, "Designing

Forms," "Changing the default properties for a type of control"

Additional reference words: 1.00 1.10 2.00 push button pushbutton


INF: General Number Format Ignores Decimal Number Setting

 Article Number: Q96574

 CREATED: 22-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

When you place a text box control on a form or report bound to a

numeric field, if the control's Format property is set to General

Number, the DecimalNumbers property setting will have no effect. This

is because the General Number format displays only the number of

decimal places necessary for each value.

REFERENCES

==========

For more information on the General Number format, search for "General

Number," then "Format Property - Number and Currency DataTypes" using the

Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 formatting checkpage


INF: How to Use Access Basic to Derive Statistical Mode

 Article Number: Q96575

 CREATED: 22-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes an Access Basic function that creates a

snapshot that determines the frequency of occurrences for all numbers

in a table.

The most frequently occurring number in a dataset is called the mode,

which is a measure of central tendency (a "middle" measure of a

dataset). The data set consisting of the numbers

   {1,1,2,2,2,3,6,100}

has a mode of 2, because it occurs three times in the set. The data

set consisting of the numbers

   {1,1,1,2,2,2,3,6,10}

is bimodal, and has modes of 1 and 2 (both numbers occur three time in

the set).

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

To create an Access Basic function that determines the mode, open a

new module or a previously created module and enter the following

code:

NOTE: In the following sample code, an underscore (_) is

used as a line continuation character. Remove the underscore

when re-creating this code in Access Basic.

   '*************************************************************

   'Declarations section of the module.

   '*************************************************************

   Option Explicit

   '=============================================================

   ' Create the following Mode() function in the Module

   ' The following function will initialize:

   ' - A variable for the database object.

   ' - A variable for the snapshot.

   ' - Sets the database object to the opened database.

   ' - Creates a snapshot based on the database object.

   ' - This function requires table and field name parameters where the

   '     arguments are passed using "[" when the name includes spaces.

   '=============================================================

   Function Mode (tName$, fldName$)

      Dim ModeDB As Database

      Dim ssMode As Snapshot

      Dim ModalField1, ModalField2, ModalResult1, ModalResult2

      If tName$ = "" Or fldName$ = "" Then Exit Function

      Set ModeDB = CurrentDB()

      Set ssMode = ModeDB.CreateSnapshot("SELECT DISTINCTROW Count_

                      (" & fldName$ & ") AS Mode, " & fldName$ & " _

                      FROM " & tName$ & " GROUP BY " & fldName$ & " _

                      ORDER BY Count(" & fldName$ & ") DESC;")

      ModalField1 = ssMode(fldName$)

      ModalResult1 = ssMode!Mode

      ssMode.MoveNext

      ModalField2 = ssMode(fldName$)

      ModalResult2 = ssMode!Mode

         If ModalField1 <> ModalField2 Then

            Mode = "The Result is Modal: " & ModalResult1

         Else

            Mode = "The Result is Bimodal: " & ModalResult1 & _

                     " and " & ModalResult2

         End If

      ssMode.Close

      ModeDB.Close

   End Function

How to Use the Mode() function

------------------------------

Create a form with text box controls that will reflect all measures of

central tendency of a data set. In the ControlSource property for the

text box control, enter:

   =Mode("TableName", "FieldName").

The value of this control will be the statistical mode of the data

set. Another way to use this function is to call it from within

another function that compares mode from different data sets. For

example:

   Function CompareModes()

      Dim MyDB as Database

      .

      .

      .

      X = Mode("[TableName]", "[FieldName]")

      Y = Mode("[Table Name]", "[Field Name]")

      If X > Y Then Debug.Print "The mode for X is greatest."

   End Function

Additional reference words: 1.00 1.10 2.00


INF: Error Messages When Concatenating Variables or Controls

 Article Number: Q96576

 CREATED: 22-MAR-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you are concatenating variables or controls in a function or

CreateDynaset method, you may receive one of the following error

messages:

   Type Mismatch

   -or-

   1 parameter expected only 0 supplied

These error messages can result if either of the following is true:

 - You are including a variable or control name in the function syntax

   and Microsoft Access is unable to recognize the data type.

 - You are using incorrect syntax to concatenate the variables.

This article presents examples in which these errors occur and explains how

to correct them.

MORE INFORMATION

"Type Mismatch" Error Message

-----------------------------

You receive the "Type Mismatch" error message when you concatenate a

variable or control that has a string data type in a method or function as

a numeric data type. For example, the following function produces the "Type

Mismatch" error message:

   Function MyFunction (DataToFind As String)

      Dim MyDB As Database, MySet As Dynaset

      Set MyDB = CurrentDB()

      Set MySet = MyDB.CreateDynaset("Employees")

      MySet.FindFirst "Title = " & DataToFind

The correct syntax for the last line of code above is as follows:

   MySet.FindFirst "Title = '" & DataToFind & "'"

Keep the following requirements in mind:

 - When the criteria for an Access Basic function or method is a string

   data type, single quotation marks around the string variable are

   required.

 - Numeric data types do not require delimiters.

 - Dates require the number sign (#).

"1 Parameters Were Expected, But Only 0 Were Supplied" Error Message

--------------------------------------------------------------------

You may receive this error message when you use the CreateDynaset

method in Access Basic on an existing query. If the query is a

parameter query, you need to explicitly declare the parameter and its

data type and set the parameter value for that query in the function.

The following sample code will generate the error message:

   Function TestQP ()

      Dim MyDB As Database, MySet As Dynaset

      Set MyDB = CurrentDB()

      Set MySet = MyDB.CreateDynaset("Query1")

      Debug.Print MySet![First Name]; Tab(10); MySet![Last Name]

   End Function

When you refer to a parameter query, the correct syntax is as follows:

   Function TestQP ()

      Dim MyDB As Database, MySet As QueryDef, MyDyna As Dynaset

      Set MyDB = CurrentDB()

      Set MySet = MyDB.OpenQueryDef("Query1")

      MySet![Enter a Name] = "Dav*"

      Set MyDyna = MySet.CreateDynaset()

      Debug.Print MyDyna![First Name]; Tab(10); MyDyna![Last Name]

      MyDyna.Close

      MySet.Close

   End Function

The same error message also appears when you concatenate a variable in

the SQL SELECT statement of a CreateDynaset method. The correct syntax

is as follows:

NOTE: In the following example, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this

example.

   Set MySet = MyDB.CreateDynaset("SELECT * FROM Employees WHERE _

                    Employee ID] = " & Forms!Form1!Field0 & ";")

This SELECT statement points to a control on a form for the WHERE

clause.

Additional reference words: 1.00 1.10 2.00 parameters errmsg


PRB: Macro Condition Evaluates True if Control Is Null

 Article Number: Q96577

 CREATED: 22-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A macro that conditionally checks the contents of a control on a

form always evaluates as True if the control is null.

RESOLUTION

Include a StopMacro macro action with a condition to test the

control for null. If the control is null, the macro will stop. If

it is not null, the second macro action will occur. This will be

the action you want to occur if your condition is met.

MORE INFORMATION

If you do not test for the null condition, the macro will evaluate to

True.

Steps to Reproduce Behavior

---------------------------

1. Create a new unbound form named Form1.

2. Add a text box control to the form named Field0.

3. Create and save a new macro named Test.

      Macro Name    Condition           Action

      ----------------------------------------

      Test          [Field0] = "yes"    MsgBox

      MsgBox Arguments

      ----------------------------------------

      Message: The Answer is YES!

      Beep:  Yes

4. Switch back to Design view of Form1 and place a command button on

   the form. Set the OnPush property to the Test macro.

5. Switch to Form view and run the macro by choosing the command

   button. Note that Field0 is null. (The Msgbox should appear).

6. Type the word "NO" into Field0 and rerun the macro (no Msgbox will

   appear).

7. Type the word "YES" into the field and run the macro (Msgbox should

   appear).

   To correct this situation, change the Test macro so it includes the

   StopMacro action before the MsgBox action:

      Macro Name    Condition           Action

      ----------------------------------------

      Test          [Field0] Is null    StopMacro

                    [Field0] = "yes"    MsgBox

Additional reference words: 1.00 1.10 2.00


INF: Conversions for C Data Types in Access Basic

 Article Number: Q96578

 CREATED: 22-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes some of the conversions between Access Basic

and C arguments.

MORE INFORMATION

The following are general data type conversions:

   hWnd            ByVal var As Integer

   LPSTR           ByVal var As String

   hDC             ByVal var As Integer

   WORD            ByVal var As Integer

   DWORD           ByVal var As Long

   INT             ByVal var As Integer

   INT FAR *       var As Integer

   CHAR FAR *      ByVal var As String

   LONG            ByVal var As Long

   LONG FAR *      var As Long

   BYTE            ByVal var As Integer

   BOOL            ByVal var As Integer

   UNSIGNED SHORT  ByVal var As Integer

   UNSIGNED CHAR   ByVal var As Integer - must convert with Asc(var)

   UNSIGNED LONG   ByVal var As Long

The following list shows how to define the C data type in an Access

Basic data type:

   BYTE, BOOL            Var As String * 1

   LPSTR, CHAR FAR *     Var As Long       - Use API lstrcpy() to get

                                             the string pointer.

   anything FAR *        Var As Long       - This does not give the correct

                                             data type but contains the

                                             correct number of bytes; you

                                             may have to convert.

The following list describes the differences returned from a function:

   LPSTR               Function As Long    - Use lstrcpy() to get the

                                             string from the pointer.

Additional reference words: 1.00 1.10 2.00 conversion


PRB: SendKeys Macro Does Not Run

 Article Number: Q96579

 CREATED: 22-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A macro including a SendKeys macro action does not run the SendKeys

action.

CAUSE

If the Wait argument for the SendKeys action is not set to Yes, the

macro action is run after some delay. Depending upon the following

macro action, the keystrokes that are sent may not be valid. If the

keystrokes are not valid, the SendKeys action appears not to have

been run.

RESOLUTION

Set the Wait argument for the SendKeys action to Yes.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a macro named TestMacro.

      Macro Name         Action

      ---------------------------

      TestMacro          SendKeys

                         MsgBox

      TestMacro Actions

      ---------------------------

      SendKeys

         Keystrokes: %FX

         Wait: No

      MsgBox

         Message:  "HELLO WORLD"

2. Save the macro.

3. Run TestMacro.

   The first macro action should exit Microsoft Access. However, the

   Wait argument is set to No and the message box is activated before

   the SendKeys action is run. When the keystrokes are processed, they

   are not valid and you will hear beeping instead. If the Wait

   argument had been set to Yes, the SendKeys action would have been

   completed before moving to the next action, thus exiting Microsoft

   Access.

Additional reference words: 1.00 1.10 2.00 key strokes


PRB: Invalid Reference to Field '<Value>' Using SetValue

 Article Number: Q96580

 CREATED: 22-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If the Expression argument of a SetValue macro action evaluates to a text

expression beginning with a letter, you may receive the following alert

message when a SetValue macro action attempts to set the value of a

control:

   !  Invalid reference to field '<value>'

CAUSE

An Expression argument of a SetValue macro action that begins with a

leading equal sign (=) is understood to be a field name.

RESOLUTION

Remove the leading equal sign in the Expression argument.

Steps to Reproduce Behavior

---------------------------

1. Create a macro named My Macro with one action as follows:

      Macro Name         Action

      -------------------------

      My Macro           SetValue

      My Macro Actions

      ----------------

      SetValue

         Item: Field0

         Expression: ="A023bbb"

2. Create a new unbound blank form.

3. Place a command button on the form by dragging the macro named My

   Macro from the Database window onto the form.

4. Create a text box on the form. Verify that the ControlName is

   Field0.

5. Switch to Form view.

6. Click the command button to run the macro.

   You will receive the following error message:

      Invalid reference to field 'A023bbb'

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 538-539

Additional reference words: 1.00 1.10 2.00 setvalue errmsg checkpage


INF: Join Type Mismatch Errors Caught at Runtime

 Article Number: Q96581

 CREATED: 22-MAR-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access will not detect a type mismatch error for joins created in

a query until the query is actually run. This is illustrated in the

following example.

MORE INFORMATION

Follow these steps in the sample database NWIND.MDB:

1. Create a new query.

2. Add the Orders and Products tables from the Add Table dialog

   box.

3. Create a join between the Employee ID field in Orders and

   the Product Name field in Products.

4. Bring all fields from both tables into the Field row of the QBE

   grid.

5. From the Query menu, choose Run.

The query will start to process, then return the following error message:

   ! TYPE MISMATCH

Choose OK to clear the box (choosing the Help button will give you

information on the possible causes of this error).

It may not be obvious that the join is at fault because of the timing

of the error message (especially when querying large amounts of data

over a network).

This issue is one reason it is advantageous to create relationships

between tables before creating queries.

Additional reference words: 1.00 1.10 2.00 error code 13 errmsg


PRB: Alert Appears When it Should Not When Running a Macro

 Article Number: Q96582

 CREATED: 22-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you create a macro but do not save it, and then try to run

another macro from the File menu, the following message appears:

   ? Must save macro first. Save now?

The Help option states that if you choose Cancel, you will be

returned to the current macro window; however, this does not

happen. If you choose the Cancel button from the message box, the

macro list appears and you can choose another macro to run, without

saving the first one.

RESOLUTION

Microsoft recommends that you save your macro before you call

another one to run.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a macro with a MsgBox action, close and save the macro.

2. Create another macro, but do not save it.

3. While you have the second macro open, choose Run Macro from the

   File menu.

4. When a message box prompts you to save the current macro, choose

   Cancel.

Additional reference words: 1.00 1.10 2.00


PRB: Unwanted Record Separator at the Bottom of a Subform

 Article Number: Q96583

 CREATED: 22-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

In a subform in a main form, the bottom border of the subform appears to be

painted even if the subform's Border property is set to Clear.

CAUSE

In actuality, what appears to be a border may really be a record

separator.

RESOLUTION

To resolve this situation, choose Size To Fit from the Layout menu

for the subform. This is done while you are in Design view of the

main form and the subform control has been selected.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the form in Design view.

2. Click on the name of the embedded subform.

3. Choose Palette from the View menu, or click the Palette button on

   the toolbar.

4. You can check or clear the Border property Clear check box, but

   the border of the subform remains unchanged.

Additional reference words: 1.00 1.10 2.00


INF: Sample Preview Ignores Query

 Article Number: Q96584

 CREATED: 22-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you choose Sample Preview from the File menu, Microsoft Access

ignores any query that your report is based on. Use Sample Preview to

check the general layout of your report, but use Print Preview to

check the data in your report.

MORE INFORMATION

The Sample Preview option for reports provides an accurate view of the

layout of the report. However, the Sample Preview option ignores any

criteria or joins in the underlying query upon which the report is

based. The option is designed as a speed enhancement to view the look

and feel of your report.

The data that you will see displayed in this Sample Preview is based

directly on the table used in the report's underlying query. If more

than one table is in this query, the Sample Preview will erroneously

combine records from the two tables.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 17, "Report

Basics," page 406

Additional reference words: 1.00 1.10 2.00 checkpage


PRB: Form Opens Blank Except for Header

 Article Number: Q96585

 CREATED: 22-MAR-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You open a form in Form view and it is completely blank. There are no

controls or text; everything is blank except for the form header.

CAUSE

The form footer may be too large for the form, and it may be covering the

entire detail section when you view the form.

Also, if you have a form that is read-only and there is no data in the

underlying dynaset, no controls will be shown.

RESOLUTION

If the problem is with the form footer, shorten the footer to allow only

enough space for any controls that may appear there.

In the case of no data, controls in the form footer or header will be

visible.

MORE INFORMATION

There are other reasons that a form may open and appear to be blank.

Typically, this happens because the dynaset contains no records, or

privileges have been limited. However, an oversized form footer can also

cause this to occur.

Steps to Reproduce Behavior

---------------------------

The following steps are based on the sample database NWIND.MDB:

1. Open the Categories form in Design view.

2. From the Layout menu in version 1.x, or the Format menu in version 2.0,

   choose Form Hdr/Ftr to add a header and footer to the form.

3. Extend the length of the footer to 5 inches (place no controls in

   the footer).

4. View the form in Form view. The form will appear to be blank.

REFERENCES

==========

For more information about why a form might appear to be blank, query on

the following words here in the Microsoft Knowledge Base:

   completely and blank and form

Additional reference words: 1.00 1.10 2.00


PRA: Orders Form Doesn't Print/Preview SubTotal & Total

 Article Number: Q96586

 CREATED: 22-MAR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

You have a main form and a subform, and in the subform you

have a

control that uses an aggregate function, such as Sum(), to

calculate a value. On the main form, you have a control set

to this

subform control. When the main form is displayed in Form

view, the

control on the main form displays the correct value.

However, when

you switch the main form to Print or Print Preview, this

control is

blank.

For example, look at the Orders form included in the sample

database NWIND.MDB. Note the Subtotal and Total fields. In

Form

view, these fields display values. When you switch to Print

Preview, these values do not appear.

CAUSE

If the subform is displayed in Datasheet view, any main form

controls that refer to aggregate calculated subform controls

do not

get repainted.

RESOLUTION

Display the subform as a continuous form, or use a domain

aggregate

function in the subform control. (See below for more

information on

these workarounds.)

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0. This problem was corrected in Microsoft Access

version 1.1.

MORE INFORMATION

To work around this problem, you can either use a continuous

form

instead of a datasheet in the subform, or replace the

aggregate

function with a domain aggregate function in the subform

control.

In the form named Orders Subform, a text box control named

Order

Subtotal is calculated by using the following aggregate

expression:

   =Sum([Extended Price])

On the form named Orders, the Subtotal control refers to

this

calculated subform control. The Orders form displays the

Subtotal

value but does not display the value in Print Preview.

Workaround 1

------------

1. Open the Orders Subform in Design view and change the

ViewsAllowed

   property to Both and the DefaultView property to

Continuous Forms.

2. Close and save the Orders Subform.

3. Open the Orders form. Note that the Subtotal and Total

fields are

   correct. Switch to Print Preview and these amounts are

now

   displayed.

   Note: You will probably want to rearrange the detail

section of

   Orders Subform so it displays properly in the Orders

form.

Workaround 2

------------

1. Open the Orders Subform in Design view.

2. Change the text box control named Order Subtotal to the

following:

   Note: In the following sample code, an underscore _ is

used as a

   line continuation character. Remove the underscore when

re-creating

   this code in Access Basic.

      Object: text box

      ----------------

      ControlName: Order Subtotal

      ControlSource: =DSum("[Extended Price]","[Order

Details2]", _

                         "[Order ID]=Forms![Orders].[Order

ID]")

3. Close and save the form.

4. Open the Orders form in Form view.

Note how the Subtotal and the Total controls display the

correct

values in both Form view and Print Preview.


PRB: Join Is Broken by Value(s) in Fields '[Field Name]'

 Article Number: Q96587

 CREATED: 22-MAR-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you add or edit records in a form or query datasheet and you

attempt to commit the record by moving from the current record or by

closing the dynaset, the following error message is displayed:

   Join is broken by value(s) in fields '<field name>' (in Microsoft

   Access version 1.x)

   -or-

   There is no record in table '<table name>' with key matching field(s)

   '<field name>' (in Microsoft Access version 2.0)

In the sample messages above, <field name> identifies the foreign key and

<table> identifies the one-side table.

CAUSE

You tried to enter or edit data through a query based on more than one

table. In a one-to-many relationship, you entered or edited data on

the "many" side, and a corresponding match based on the join field

does not exist on the "one" side.

STATUS

This behavior is by design.

RESOLUTION

When you add or edit records in a query, if the relationship between

two tables is a one-to-many relationship, only enter values in the

linking field in the "many" table that have matches in the linking

field in the "one" table.

MORE INFORMATION

Microsoft Access knows that a given relationship is a one-to-many

relationship if the field on which the tables are linked or joined is

a primary key (or Indexed - No Duplicates) in one of the tables, but

not in the other table. (The linking field in the "many" table is also

known as the "foreign key.") If a field is updated on the "many" side

of a relationship and does not have a match on the "one" side of the

relationship, an "orphan" would be produced.

Steps to Reproduce Behavior

---------------------------

Follow these steps in the sample database NWIND.MDB:

1. Open the query named Order Information.

2. From the Records menu, choose GoTo, and then select New.

3. Input a new Order ID and Customer ID. Enter a value in the Customer

   ID field that does not exist in the Customers table.

4. Press DOWN ARROW to move to a new record. The following error message is

   displayed:

      Join is broken by value(s) in fields 'Customer ID'

REFERENCES


PRB: Macro Condition Example Using COUNT() Is Incorrect

 Article Number: Q96588

 CREATED: 22-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Page 519 of the Microsoft Access "User's Guide," version 1.0, or page 523

of the Microsoft Access "User's Guide," version 1.1, shows examples of

valid conditions to be used in the Condition column in the Macro window.

The last example shows the following:

   COUNT(Order_ID) > 35

This condition will result in the error message "Can't parse expression."

If you correct the parsing error by adding square brackets and replacing

the underscore with a space, as in the following example,

   COUNT([Order ID]) > 35

you will receive the error message:

   Function isn't available in expressions.

RESOLUTION

To see if the total number of entries in the Order ID field is greater

than 35, use the DCOUNT() function in a macro expression, as in the

following example:

   DCOUNT("[Order ID]","Orders") > 35

If there are more than 35 entries in the Order ID field of the Orders

table, the expression above will return TRUE.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

REFERENCES

==========

For more information on the DCount() function , search for "DCount" then

"DCount Function" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 docbug errmsg logical false


PRB: Error Message "Couldn't Find Object [Object Name]"

 Article Number: Q96589

 CREATED: 22-MAR-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You receive the following error message:

   Couldn't Find Object [object name]

RESOLUTION

Use the following to troubleshoot the problem:

 - First check to ensure that [object name] exists. It could be a

   table, a query, or an SQL statement. If it does not exist, you must

   remove all references to it from your application. Often, the

   RecordSource property of a form or report will contain a reference to

   an object whose name has changed or has been deleted.

 - If [object name] exists, then it is likely that there is a syntax

   or spelling error in the reference to it.

 - You're trying to open an attached table, but the file containing the

   table isn't on the path you specified when you attached it. If you've

   moved the file, you can use the Attachment Manager to update the

   attachment so it points to the correct path.

Additional reference words: 1.00 1.10 2.00 misc tshoot msg errmsg


INF: Determining How Many Instances of Application Are Active

 Article Number: Q96591

 CREATED: 22-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

You can use Windows API calls in Access Basic to determine how many

instances of an application are running. You can use this to prevent re-

entrance of an application that is already running, to determine how many

instances of an application are active, or to start a loop in which you

remain until the application quits.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

This article outlines three uses of two Windows APIs in Access Basic.

Open a new module or a previously created module and enter the

following code:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   '------------------------------------------

   'Global Declarations Section Of The Module.

   '------------------------------------------

   Option Explicit

   Declare Function GetModuleHandle% Lib "Kernel" (ByVal lpModuleName$)

   Declare Function GetModuleUsage% Lib "Kernel" (ByVal hModule%)

1. Prevent re-entrance:

   '------------------------------------------------------------------

   ' The following function will test for re-entrance and return

   ' True if there is already an instance of the application active,

   ' or it returns False. This function requires an argument that is

   ' the name of the application.

   '------------------------------------------------------------------

      Function TestForReentrance% (ApplicationName$)

         If ApplicationName$ = "" Then Exit Function

         If GetModuleUsage(GetModuleHandle(ApplicationName$)) Then _

                           TestForReentrance = True

      End Function

Example of Using this Code

--------------------------

You can use this function to keep from starting an application that

is already running

   Function RunMyApp$ (szAppToRun$)

      Dim x%

      If Not TestForReentrance(szAppToRun) Then

         x = Shell(szAppToRun)

         Exit Function

      End If

      RunMyApp = "AppToRun is presently active."

   End Function

and a call to this in the Immediate window such as:

   ?RunMyApp$("Clock.exe")

2. Count the number of instances:

   '------------------------------------------------------------------

   ' The following function will return the number of instances of an

   ' application that are currently active.

   '------------------------------------------------------------------

   Function CountInstance% (szAppName$)

       CountInstance = GetModuleUsage(GetModuleHandle(szAppName))

   End Function

3. Remain idle until an application quits:

   '------------------------------------------------------------------

   ' The following function will attempt to start an MS-DOS application

   ' and remain in a loop until that application quits.

   '------------------------------------------------------------------

   Sub RunDosAppUntil (szAppToRun$)

      Dim hMod%

      hMod% = Shell(szAppToRun, 1)

         If (hMod% > 32) Then

            While (GetModuleUsage(hMod%))

               DoEvents

            Wend

         Else

           MsgBox "Unable to start the Application"

        End If

   End Sub

Additional reference words: 1.00 1.10 2.00


PRB: Page Hdr/Ftr Is Not Under View Menu

 Article Number: Q96592

 CREATED: 22-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Page 474 of the Microsoft Access version 1.0 "User's Guide," and page 478

of the Microsoft Access version 1.1 "User's Guide," says to remove the page

header and footer from a report by choosing Page Hdr/Ftr from the View

menu. This command is not on the View menu, but rather on the Layout menu.

RESOLUTION

The last two sentences of this paragraph read as follows:

   Remove the page header and footer. (From the View menu, choose

   Page Hdr/Ftr.)

They should read as follows:

   Remove the page header and footer. (From the Layout menu, choose

   Page Hdr/Ftr.)

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10 docbug checkpage


PRB: System Defaults Not Showing in Import/Export Setup

 Article Number: Q96890

 CREATED: 30-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you choose the Import/Export Setup command from the File menu, the

Leading Zeros In Dates and Four Digit Years check boxes do not take

the defaults from the Microsoft Windows system settings found in

Control Panel.

CAUSE

The Control Panel does not have a date setting that corresponds to

the Leading Zeros setting used in Microsoft Access dates. The

Windows setting has one for day and one for month, which do not

have to be the same.

STATUS

This behavior by design.

Additional reference words: 1.00 1.10 2.00 zeroes


PRB: TransferSpreadsheet Action Does Not Add File Extention

 Article Number: Q96891

 CREATED: 30-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The TransferSpreadsheet action requires a file type and filename to

export data to a spreadsheet. The filename tells Microsoft Access

what to name the spreadsheet file that will hold the exported data.

If you do not specify an extension in this filename, Microsoft

Access will not add the appropriate extension for the file format

to which you are exporting.

RESOLUTION

By not automatically writing a file extension, you are able to specify

any extension you like (for example, .EXE, .DAT, and .INI).

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a table called Table1 and add some fields and example data.

2. Create the following macro:

      Macro Name      Action

      ----------------------

      Transfer It     TransferSpreadsheet

      Transfer It Actions

      ----------------------

      TransferSpreadsheet

         Transfer Type: Export

         Spreadsheet Type: Microsoft Excel

         Table Name: Table1

         File Name: TestIt

         Has Field Names: No

3. Run the macro.

A Microsoft Excel spreadsheet file will be created in the current

directory and the file will be called TESTIT, not TESTIT.XLS.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 476-479

Additional reference words: 1.00 1.10 2.00 worksheet .xls .wks .wk1 .wk3


INF: Page Locking, No Cluster Indexing Support

 Article Number: Q96892

 CREATED: 30-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Cluster indexing and row level locking are not possible with Microsoft

Access, unless you are using an attached table.

MORE INFORMATION

These features are not supported because of the variable-length

architecture. When using an attached table, Microsoft Access uses the

same locking scheme as does the native product. When you are using the

installable ISAMs for dBASE, Paradox, and Btrieve, you will do record-

level locking. The Paradox ISAM even understands the clustered indexes

and takes advantage of these indexes in some queries.

The following products are manufactured by vendors independent of

Microsoft: Btrieve by Novell, Inc., dBASE by Borland International,

Inc., and Paradox by Borland International. We make no warranty, implied

or otherwise, regarding these products' performance or reliability.

Additional reference words: 1.00 1.10 2.00


PRA: Setting OLE Object Property May Cause GP Fault

 Article Number: Q96893

 CREATED: 30-MAR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

Microsoft Access will produce a general protection (GP)

fault if the

OLEDATA property is set to a null value or an invalid

object.

CAUSE

OLEDATA is a property of an unbound embedded object used in

either

a form or report. The property is not available in the

Object

Properties dialog box; it is set by Microsoft Access and can

only

be modified using Access Basic code.

If the OLEDATA property is set to an invalid object,

Microsoft

Access will display the error "Not a valid OLE object."

Microsoft

Access will allow you to exit the dialog box and continue to

work

in design mode. The frame will remain in the form or report;

however, since its link is broken, it will be dimmed. Access

will

produce a GP fault when leaving design mode to display the

form in

view mode, or the report in print preview mode.

If the OLEDATA property is set to null, Microsoft Access

will display the

error "The setting you entered isn't valid for this

property" and produce a

GP fault upon exiting the dialog box.

RESOLUTION

Setting the embedded objects Visible property to False will

suppress the display of the object.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0. This problem was corrected in Microsoft Access

version 1.1.

MORE INFORMATION

Any unbound embedded object inserted with the Paste, Paste

Link*, or

Paste Special* command is subject to the GP fault if the

OLEDATA

property is set to a invalid object.

Steps to Reproduce Problem

--------------------------

 1. Using Paintbrush, open any .BMP file.

 2. Select the object and copy it to the Clipboard.

 3. Exit Paintbrush.

 4. Open Microsoft Access and create a new database.

 5. Create a new form.

 6. In the form's Design view, paste in the object.

 7. Leave the form open and go to the Database window.

 8. Create a new module.

 9. Open the Immediate window.

Option 1

--------

10. Enter the following command:

       Forms![Form1]![Embedded0].OLEDATA=NULL

    Microsoft Access will display the following error:

       The setting you entered isn't valid for this

property.

11. Choose the OK button.

    Microsoft Access will GP fault.

Option 2

--------

12. Enter the following command:

       Forms![Form1]![Embedded0].OLEDATA="X"

    Microsoft Access will display the following error:

       Not a valid OLE object

13. Choose the OK button.

14. Go back to Form1.

15. Switch to the form's View window.

    Microsoft Access will GP fault.


PRB: Switching Views Disables Undo

 Article Number: Q96894

 CREATED: 30-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you place a new control on a form and switch to Form view to see

it, you cannot choose Undo Create from the Edit menu when you go

back to Design view. Instead, Can't Undo is available, even though you

have not made any changes since adding the control.

CAUSE

Switching to Form view is considered a change, thereby nullifying

the Undo option.

STATUS

This behavior is by design.

MORE INFORMATION

If you create a form and add a control, you can choose the Undo Create

command from the Edit menu to remove the control that you have just

created. However, if you switch to Form view to see your modified

form, and then switch back to design mode, the Undo Create option

is no longer available. Immediately after you make a change, you can

reverse it until you make another change. Switching to Form view is

considered a change. Thus, you cannot undo the creation of the

control, and the Edit menu list displays Can't Undo.

REFERENCES

==========

For more information, search for "undo timeout," then "undoing

changes" in the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


PRB: ORDER BYs Must Be Output Columns in DISTINCT Queries

 Article Number: Q96895

 CREATED: 30-MAR-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you create a query and use the DISTINCT predicate in conjunction

with the ORDER BY clause, the fields that are being ordered must be

output columns. If the ORDER BY fields are not output columns, you

will receive the following error message:

   ORDER BY clause [Table Name].[Field Name] conflicts with DISTINCT

RESOLUTION

Use the DISTINCTROW predicate or remove the specified field from the ORDER

BY clause.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

Follow these steps in the sample database NWIND.MDB:

1. Create a new query and add the Employees table.

2. Place the Last Name and First Name fields in the query grid.

      Query: MyQuery

      ----------------------

      Field Name: Last Name

         Sort: Ascending

         Show: False

      Field Name: First Name

         Show: True

3. From the View menu, choose SQL. Modify the SQL statement as follows:

      SELECT DISTINCT

         [Employees].[First Name]

      FROM [Employees]

      ORDER BY

         [Employees].[Last Name];

4. Run the query. The following error will be displayed:

      ORDER BY clause (Employees.[Last Name]) conflicts with DISTINCT

To resolve this, you must Show the Last Name field.

Additional reference words: 1.00 1.10 2.00


PRB: Raised and Sunken Check Box and Option Button Controls

 Article Number: Q96896

 CREATED: 30-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

In VGA resolution (640 X 480) raised check boxes and option buttons are

indistinguishable from sunken check boxes and option buttons on both forms

and reports.

STATUS

This behavior is by design.

MORE INFORMATION

You can specify three different appearances for controls on your forms

and reports: Normal, Raised, and Sunken. Check box controls and option

button controls allow you to specify these different appearances, but

raised and sunken are displayed identically.

Steps to Reproduce Behavior

---------------------------

1. Create a blank unbound form in VGA resolution.

2. In Design view add three check box controls to the form.

3. Add three option button controls to the form.

4. Choose the Palette button and make one of the check boxes and one

   of the option buttons sunken. Leave one of each normal. Make one of

   each raised.

5. Switch to Form view. Compare the raised controls to the sunken

   controls.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 12, "Using Special

Design Effects on Forms and Reports"

Microsoft Access "User's Guide," version 1.0, page 306

Additional reference words: 1.00 1.10 2.00 checkpage


PRB: Operation Stops when Editing Attached SQL Tables

 Article Number: Q96897

 CREATED: 30-MAR-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Microsoft Access may return an inconsistent value for a floating

point field in an SQL table when it checks the value of the field

before editing and before updating. This can result in the error

message

   Data Has changed: Operation Stopped

when you are trying to update a record in an attached SQL table.

CAUSE

The problem occurs if an SQL field data type is set to Float and

the table does not contain a TimeStamp field, or when an SQL

indexed field data type is set to either DateTime or Float.

RESOLUTION

1. Remove the index from any fields with the DateTime or Float

   data types.

   To obtain information on any index within a SQL table, you can

   run the following system stored procedure within the System

   Administrator Facility (SAF):

      sp_helpindex <Table Name>

   To remove an index, use the following command:

      DROP INDEX <Table_Name.Index_Name>

   Note that you must be logged into the SQL Server as either the table

   owner or the System Administrator.

2. If other fields in the table have the Float data type, you must

   insert a TimeStamp field in the table. If a field with this

   data type is present, Microsoft Access returns a consistent value for

   fields of this data type and will use the value in this field to

   verify whether the record has been modified.

   This can be accomplished by performing the following command

   within SAF:

      ALTER TABLE <Table Name> ADD TimeStamp timestamp

   Note that you must be logged in as either the database

   owner or the System Administrator to run the above command.

Additional reference words: 1.00 1.10 2.00 SQL


INF: Unexpected Stored Procedures Found in SYSOBJECTS Table

 Article Number: Q96898

 CREATED: 30-MAR-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Unexpected stored procedures are found in the SYSOBJECTS table in SQL

Server. Stored procedures with the general format ODBC#xxxxnnnnn are

found when querying the SYSOBJECTS table. For example, if you issue

the following query from SAF

   SELECT * FROM SysObjects WHERE Name LIKE "ODBC%"

you may see stored procedures similar to:

   ODBC#sa24518

   ODBC#sa2334

   ODBC#sa17854

This article describes these stored procedures and what you can do

about them.

MORE INFORMATION

The stored procedures are created by ODBC for executing parameter

queries. When Microsoft Access executes a query that is parameter,

it calls the ODBC function SQLPrepare that creates these stored

procedures that are compiled. These stored procedures pass the proper

arguments to ensure proper execution.

The stored procedures are deleted under normal circumstances once the ODBC

connection is closed. If a crash or abnormal termination of the ODBC

connection occurs, it is possible that the stored procedures will remain

on the server. In this case, the stored procedures can be removed without

causing any problems.

To remove stored procedures manually, use SAF (SQL Administrator

Facility) to drop each procedure. The command syntax is

   DROP PROCedure [owner.]procedure_name[,[owner.]procedure_name...]

where procedure_name refers to the procedure you are removing. For

example,

   DROP PROC ODBC#sa24518, ODBC#sa2334

would remove two stored procedures, ODBC#sa24518 and ODBC#sa2334.

Additional reference words: 1.00 1.10 2.00


INF: Importing Word Print Merge Data Files to Microsoft Access

 Article Number: Q96899

 CREATED: 30-MAR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - Microsoft Word for Windows, versions 1.0, 1.1, 1.1a, 2.0, 2.0a,

   2.0a-CD, 2.0b, 2.0c

---------------------------------------------------------------------

SUMMARY

This article describes how to import data from a Word for Windows

print merge data file for use in Microsoft Access.

MORE INFORMATION

In order to use data from a Word for Windows print merge data file in

Microsoft Access, the file must be saved as a comma- or tab-delimited

unformatted text file.

Word for Windows can perform print merges on data contained in files

that are comma- or tab-delimited, or on data formatted from a table. If

the data is already comma- or tab-delimited, you must take care to

ensure the file is saved as an unformatted text file.

If the data is in table form, the table must first be converted to a

tab-delimited format before saving it as a text file.

NOTE: In Word for Windows, you can create multiple-line information within

a table cell that contains carriage returns (paragraph marks). The carriage

returns must be removed before converting the table to a tab-delimited

format.

Converting Data from a Table to a Tab-Delimited Format

------------------------------------------------------

Word for Windows 1.x:

1. Open the data document in Word for Windows.

2. Position the insertion point anywhere inside the table.

3. Press ALT+Keypad 5 to select the entire table (make sure that NUM

   LOCK is turned off).

4. From the Insert menu, choose Table To Text.

5. In the Convert Table To box, select Tab Delimited, then choose OK.

Word for Windows 2.x:

1. Open the data document in Word for Windows.

2. Position the insertion point anywhere inside the table.

3. From the Table menu, choose Select (or press ALT+Keypad 5).

4. From the Table menu, choose Convert Table To Text.

5. Choose the Tabs button from the Separate Text With group

   and choose OK.

Saving the Data File as an Unformatted Text-Only File

-----------------------------------------------------

Word for Windows 1.x:

1. From the File menu, choose Save As, and enter an unique filename in

   the Save File Name box.

2. Choose the Options button.

3. From the File Format box, select Text Only, and choose OK.

Word for Windows 2.x:

1. From the File menu, choose Save As, and type a unique filename in

   the File Name box.

2. In the Save File As Type box in the lower left corner, select Text

   Only, and choose OK.

Removing Unwanted Carriage Returns from a Table-Formatted Data File

-------------------------------------------------------------------

Word for Windows 1.x:

1. In the Search For box type "^p" (the caret symbol (^) is generated by

   pressing SHIFT+6).

2. In the Replace With box press SPACEBAR once.

3. Clear the Confirm Changes check box and choose the OK button.

Word for Windows 2.x:

1. From the Edit menu, choose Replace.

2. In the Find What box, type "^p" (the caret symbol (^) is generated by

   pressing SHIFT+6).

3. In the Replace With box, press SPACEBAR once.

4. Choose the Replace All button.

Importing the Text Data File into Microsoft Access

--------------------------------------------------

1. From the File menu, choose Import.

2. Select Text (Delimited) from the Data Source list and choose OK.

3. Select the Word for Windows text file to import from the file list

   and choose the Import button.

4. Select First Row Contains Field Names if the first row in the

   Word data file contains a list of field names.

5. Choose the Options button.

6. Choose {tab} in the Field Separator box.

7. Choose the OK button to begin the import.

Additional reference words: 1.00 1.10 2.00 winword


INF: How to Send Information to the Clipboard

 Article Number: Q96900

 CREATED: 30-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

There is no Microsoft Access command to send information to the

Clipboard. To post information to the Clipboard, you need to define an

Access Basic function that calls several Windows API functions. This

article defines a function that copies text to the Clipboard.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

Notes

-----

 - In the following sample code, an underscore (_) is used as a line

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

 - You may have some Windows API functions defined in an existing

   Microsoft Access library; therefore, your declarations may be

   duplicates. If you receive the duplicate procedure name error, remove

   or comment the Declare statement from your code.

To call the function, you can make a string assignment to the returned

value, such as:

   X = ClipBoard_SetData("This string will go to the Clipboard!")

'=================================================================

' General Declarations

'=================================================================

Option Compare Database   'Use database order for string comparisons

Option Explicit

Declare Function kb_OpenClipBoard% Lib "User"_

                    Alias "OpenClipBoard" (_

                    ByVal hwnd%)

Declare Function kb_GlobalAlloc% Lib "Kernel" _

                    Alias "GlobalAlloc" (ByVal wFlags%, ByVal wBytes&)

Declare Function kb_GlobalLock& Lib "Kernel" _

                    Alias "GlobalLock" (ByVal hMem%)

Declare Function kb_lstrcpy& Lib "Kernel" _

                    Alias "lstrcpy" (ByVal lpString1 As Any, _

                    ByVal lpString2 As Any)

Declare Function kb_GlobalUnLock% Lib "Kernel" _

                    Alias "GlobalUnLock" (ByVal hMem%)

Declare Function kb_CloseClipBoard% Lib "User" Alias"CloseClipBoard"()

Declare Function kb_EmptyClipBoard% Lib "USER" _

                    Alias "EmptyClipBoard" ()

Declare Function kb_SetClipboardData% Lib "User" _

                    Alias "SetClipboardData" (ByVal wFormat%, _

                    ByVal hMem%)

Global Const GHND = &H42

Global Const CF_TEXT = 1

Global Const MAXSIZE = 4096

Function ClipBoard_SetData (MyString$)

   Dim hGlobalMemory%, lpGlobalMemory&, hClipMemory%, X%

   '-------------------------------------------

   ' Allocate moveable global memory.

   '-------------------------------------------

   hGlobalMemory% = kb_GlobalAlloc(GHND, Len(MyString$) + 1)

   '-------------------------------------------

   ' Lock the block to get a far pointer

   ' to this memory.

   '-------------------------------------------

   lpGlobalMemory& = kb_GlobalLock(hGlobalMemory%)

   '-------------------------------------------

   ' Copy the string to this global memory.

   '-------------------------------------------

   lpGlobalMemory& = kb_lstrcpy(lpGlobalMemory&, MyString$)

   '-------------------------------------------

   ' Unlock the memory.

   '-------------------------------------------

   If kb_GlobalUnLock(hGlobalMemory%) <> 0 Then

      MsgBox "Could not unlock memory location. Copy aborted."

      GoTo OutOfHere2

   End If

   '-------------------------------------------

   ' Open the Clipboard to copy data to.

   '-------------------------------------------

   If kb_OpenClipBoard(0&) = 0 Then

      MsgBox "Could not open the Clipboard. Copy aborted."

      Exit Function

   End If

   '-------------------------------------------

   ' Clear the Clipboard.

   '-------------------------------------------

   X% = kb_EmptyClipBoard()

   '-------------------------------------------

   ' Copy the data to the Clipboard.

   '-------------------------------------------

   hClipMemory% = kb_SetClipboardData(CF_TEXT, hGlobalMemory%)

OutOfHere2:

   If kb_CloseClipBoard() = 0 Then

      MsgBox "Could not close Clipboard."

   End If

End Function

REFERENCES

==========

For more information on how to retrieve information from the Clipboard,

query on the following words here in the Microsoft Knowledge Base:

   ClipBoard_GetData and GetClipboardData

Additional reference words: 1.00 1.10 2.00 checkpage


INF: LimitToList Property Set to Yes Needs a Unique Entry

 Article Number: Q96901

 CREATED: 30-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

If you set the LimitToList property of a combo box to Yes, and type a

portion of an entry into the combo box and press ENTER, you may

receive the following error message:

   The text you enter must match an entry in the list.

The error occurs because there are duplicates in the list. For

example, if you enter the value "co" in the combo box and the values

"conf" and "cond" exist in the drop-down list, the error occurs.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, chapter 9, "Designing

Forms", pages 244-245

Additional reference words: 1.00 1.10 2.00 combo box errmsg checkpage


PRA: StDevP() with All NULL Records Returns #ERROR

 Article Number: Q96902

 CREATED: 30-MAR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

When the StDevP() function is applied to a database

containing only NULL

records, The error message "#ERROR" results. This problem

does not occur

with the StDev() function.

RESOLUTION

Make sure that at least one record of a database where the

StDevP()

function is used contains a non-NULL value.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0. This problem was corrected in Microsoft Access

version 1.1.

MORE INFORMATION

StDevP() and StDev() are functions that return estimates of

the standard

deviation for a population or a population sample,

respectively.

Steps to Reproduce Behavior

---------------------------

1. Create and save the following table:

      Table: Table1

      -------------------------

      FieldName: A

         DataType: Text

      FieldName: B

         DataType: Number

         Default Value: (blank)

2. View the Table1 table in Datasheet view. Add several

records to the

   table, entering text in field A. Do not enter anything in

field B for

   any of the records.

3. Create a new unbound form with the following text box:

      Object: Text box

      ----------------------------------------

      ControlName: Field0

         ControlSource: =DStDevP("B","Table1")

4. View the form in Form view.

In Microsoft Access version 1.0 you will receive a "#ERROR"

error

message. In Microsoft Access version 1.1 you will receive

NULL.


PRA: '#' Appears in Attached Table Name in Error Message

 Article Number: Q96903

 CREATED: 30-MAR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

In certain error messages, a number sign (#) instead of a

period

appears as a file extension separator. For example, this

message

may appear:

   Couldn't open file 'PDXSALES#DB'

instead of this message:

   Couldn't open file 'PDXSALES.DB'

This problem occurs in errors that are generated while

attempting

to attach an external table that uses an installable ISAM

driver

(as seen in the [Installable ISAMs] section of the

MSACCESS.INI

file in the WINDOWS directory.)

CAUSE

Internally, an installable ISAM driver replaces the period

in the

table name with a number sign for database compatibility

purposes.

The problem is caused when Microsoft Access uses this

internal

number sign-separated table filename in the error message,

instead

of the period-separated name.

This is a cosmetic problem only; it does not affect the

operation

of the installable ISAM driver or the attaching of external

tables.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0. This problem was corrected in Microsoft Access

version 1.1.


PRB: Low Number of Share Locks Can Cause Error Message

 Article Number: Q96904

 CREATED: 30-MAR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You receive the error message "Can't save; record is locked by another

user" in Microsoft Access, even when only one user (in one session on one

computer) is using a database opened for shared access.

CAUSE

This error can be caused by an insufficient number of share locks.

RESOLUTION

Be sure that the number of share locks is set to 500 or more. The

number of share locks is set by the /L:xxxx parameter when SHARE.EXE

is invoked, usually in the AUTOEXEC.BAT file, as follows:

   C:\DOS\SHARE.EXE /L:500

The Microsoft Access Setup program modifies your AUTOEXEC.BAT file

and sets the number of share locks to 500, but some other program

may alter that value.

Although 500 share locks are sufficient for most Microsoft Access

applications, some applications may have problems related to the

number of share locks. You may need to gradually increase the number

of share locks until these problems disappear. Try to add as few share

locks as possible, since each share lock uses memory.

Note that if you are running Microsoft Access under Windows for

Workgroups in 386 Enhanced mode, then you do not need to load SHARE.EXE

in your AUTOEXEC.BAT file. VSHARE.386, which is loaded automatically by

Windows for Workgroups in 386 Enhanced mode, will take care of this

problem.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

REFERENCES

==========

For more information on VSHARE.386, query on the following words here in

the Microsoft Knowledge Base:

   VSHARE.386 and enhanced

Additional reference words: 1.00 1.10 WinIss share-lock errmsg shared


PRB: Rounding Errors Importing/Exporting dBASE IV Values

 Article Number: Q96905

 CREATED: 30-MAR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Some floating-point values (single and double precision) have rounding

errors when exported to or imported from a dBASE IV database. For

example, if the floating-point number .0807 is exported from a

Microsoft Access database to a dBASE IV database and then imported

back to Microsoft Access, after the import the value reads .08069.

CAUSE

This problem is caused by the floating-point number being converted

from IEEE floating-point numeric format (used by Microsoft Access and

several other Microsoft products) to ASCII character values required

by dBASE IV. The Microsoft Access dBASE ISAM converts IEEE floating-

point values to ASCII, and conversion of binary fractions to decimal

is inherently inexact.

Typically, such rounding errors are not noticeable or relevant because

they occur at digits far to the right of the decimal point and are not

displayed. However, sometimes the rounding error may appear in the

visible portion of the number.

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10 2.00


PRA: Opening Objects in Transactions Can Cause Rollback

 Article Number: Q96906

 CREATED: 30-MAR-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The following error message is displayed while attempting to open a

second occurrence of a database object (such as a table, dynaset, or

form) in a transaction:

   Invalid database object

CAUSE

This error message results from a new occurrence of a database object

overwriting a previous occurrence of a database object, which

"orphans" the first object (that is, the first object's pointer to the

database is destroyed).

When Microsoft Access detects that an object is orphaned, it attempts

to close it. Because the object is in a transaction, however, the

close fails, and therefore Microsoft Access rolls back all levels of

nested transactions so that the close succeeds.

This implicit rollback causes all objects opened in transactions to be

closed. As a result, any reference to an object closed by this process

results in the "Invalid database object" error message.

RESOLUTION

This problem occurs only when objects are implicitly closed (by the

process mentioned above), and does not occur when the object is

explicitly closed in a transaction.

Thus, the keys to avoiding this problem are:

 - Always open objects outside of transactions.

 - Always explicitly close objects.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

Create and run the following procedures:

   Sub Sub1()

     Dim db As Database, tb As Table

     Set db = CurrentDB()

     BeginTrans

        Set tb = db.OpenTable("table1") 'Table opened in transaction

        Call Sub2

        Debug.Print tb.recordcount   'Result: "! Invalid database

                                     'object."

        tb.Close

     CommitTrans

     db.Close

   End Sub

   Sub Sub2()

     Dim d as Database

     Set d = CurrentDB()

   End Sub  'd loses scope, does implicit rollback and close of db.

Additional reference words: 1.00 1.10 AB ABC Engine


PRB: Zoom Box Accessible When Multiple Fields Are Selected

 Article Number: Q96969

 CREATED: 01-APR-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SYMPTOMS

You can open a Zoom box when multiple fields in a table are

selected; however, the contents of only the first selected

field

are visible.

STATUS

This behavior is by design.

MORE INFORMATION

Although multiple fields in a table can be selected when

opening a

Zoom box, only one field is displayed in the Zoom box.

Steps to Reproduce Behavior

---------------------------

1. Create a table containing multiple fields and open it in

Design view.

2. From the Edit menu, choose Select All.

3. Press SHIFT+F2.

Note that the data you see in the Zoom box comes from only

the first

selected item.

Additional reference words: 1.00 1.10 zoom builder


PRB: Weekday Disappears While Editing Long Date Format Field

 Article Number: Q96970

 CREATED: 01-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you edit a date field that is formatted as Long Date, the

weekday disappears from the field. The weekday reappears when you

exit the field.

CAUSE

A date is stored as a number that is parsed to display the format

that you choose. All data types have certain formats that Microsoft

Access can parse. The weekday is not parsed, and therefore it is

removed from the date when you begin to edit the date field.

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10 2.00 formatting


INF: How MS Access Variable-Length Fields Export to dBASE

 Article Number: Q96971

 CREATED: 01-APR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

Microsoft Access uses variable-length fields for tables. However, when you

export a table to dBASE, which uses fixed-length fields, field sizes in

dBASE are set based on what their FieldSize property setting is in

Microsoft Access. For example, if you have a table with a text field whose

FieldSize property is 50, that field will have a field length of 50 in

dBASE.

Additional reference words: 1.00 1.10 2.00


PRA: Access Hangs Importing Big Lotus 1-2-3 Spreadsheets

 Article Number: Q96972

 CREATED: 01-APR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

Your computer stops responding ("hangs") when you are

attempting to

import a large spreadsheet (more than 64,000 cells) into

Microsoft Access.

CAUSE

The Lotus 1-2-3 spreadsheet import option in Microsoft

Access is

limited to 64,000 formatted cells. By default, Lotus 1-2-3

formats

all cells with the general format if they are not explicitly

set to

some other format by the user. As a result, if a Lotus 1-2-3

spreadsheet to be imported has more than 64,000 cells, then

Microsoft Access cannot import it and the system may hang

during

the import process.

RESOLUTION

To import a Lotus 1-2-3 spreadsheet with more than 64,000

cells,

you must first split the spreadsheet into separate

spreadsheets

so that the number of cells in each does not exceed 64,000.

The spreadsheet must be split--importing subranges from

large

spreadsheets does not eliminate the problem.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0. This problem was corrected in Microsoft Access

version 1.1.


INF: Validating Data with Values From Another Table

 Article Number: Q96973

 CREATED: 01-APR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

The text below presents two examples that demonstrate setting the

ValidationRule property to use values in a different table. You must

use either the DCount() or DLookup() function to do this.

You can use a validation expression to compare the value entered by

the user with a value in one or more other tables. You can create a

validation rule to accept only values that exist in a second table or

to reject values that exist in a second table.

MORE INFORMATION

Example 1: Using the DCount() Function

--------------------------------------

In the following example, the user can enter into "Table1" only those

values that exist in the "Field" field of "Table2."

NOTE: In the following examples, an underscore (_) is used as a line-

continuation character. Remove the underscores when re-creating these

examples.

   Table: Table1

   ---------------------------------------------------------

   Field Name: Field Name

   DataType:  Text

   Validation Rule: DCount("[Field]","Table2","[Field]='" &_

                          [Field in Table1] & "'") > 0

In the following example, the user can enter into "Table1" only those

values that do not exist in the "Field" field of "Table2."

   Table: Table1

   ---------------------------------------------------------

   Field Name: Field Name

   DataType:  Text

   Validation Rule: DCount("[Field]","Table2","[Field]='" &_

                          [Field in Table1] & "'") = 0

Example 2: Using the DLookup() Function

---------------------------------------

In the following example, the user can enter into "Table1" only those

values that exist in the "Field" field of "Table2."

   Table: Table1

   ----------------------------------------------------------

   Field Name: Field Name

   DataType:  Text

   Validation Rule: DLookup("[Field]","Table2","[Field]='" &_

                         [Field in Table1] & "'")Is Not Null

In the following example, the user can enter into "Table1" only those

values that do not exist in the "Field" field of "Table2."

   Table: Table1

   ----------------------------------------------------------

   Field Name: Field Name

   DataType:  Text

   Validation Rule: DLookup("[Field]","Table2","[Field]='" &_

                         [Field in Table1] & "'")Is Null

Replace "Field" with the appropriate field name in your database (be

sure to preserve the quotation marks and square brackets). Replace

"Table2" with the name of the validation table in your database and

replace "Table1" with the name of the table in which you are entering

data.

DCount() searches through the specified field in the validation table

and counts all records where the field name is equal to the value

entered in the table. If the function returns a value greater than

zero, the function found one or more matching records.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 45 and 652

Additional reference words: 1.00 1.10


PRB: Reordering Rows in Table or Macro Design Window

 Article Number: Q96984

 CREATED: 04-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you move the location of a row in a table or macro's Design view,

Microsoft Access appears to insert the row at the wrong location.

CAUSE

This behavior is by design. While you are moving the row, Microsoft

Access will display an insertion line immediately above the row

selected by your mouse pointer. The row is always inserted immediately

beneath the insertion line.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new macro.

2. Create three macro actions: AddMenu, ApplyFilter, and Beep (in that

   order).

3. Click the row selector to select the first macro action, AddMenu.

4. Drag this action down until your mouse pointer is over the row

   selector for the Beep action. (Note that the insertion line is

   above the Beep action.)

When you drop the AddMenu action at this point, Microsoft Access will

insert AddMenu immediately above Beep.

Additional reference words: 1.00 1.10 2.00


PRB: Using "Save As" from Table Design View Does Not Copy Data

 Article Number: Q96985

 CREATED: 04-APR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

In table Design view, you choose Save As from the File menu to create

another table with the same structure. When you open the new table in

Datasheet view, it contains no records.

CAUSE

The Save As command copies a table's structure only, not its data.

RESOLUTION

To copy both the structure and the data in a table, do the following:

1. In the Database window, choose the Table button.

2. Select the table you want to copy.

3. From the Edit menu, choose Copy (or press CTRL+C).

4. Choose a destination for your new table. To paste the table into

   an existing database, choose Open Database from the File menu. To

   paste the table into a new database, choose New from the File menu.

5. From the Edit menu, choose Paste (or press CTRL+V). The Paste

   Table As dialog box is displayed.

6. Select Structure And Data.

7. Type a name for the new table and choose the OK button.

Additional reference words: 1.00 1.10 2.00


PRB: Combo Box Displays Only 255 Characters of Memo Field

 Article Number: Q96987

 CREATED: 04-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you are looking at the contents of a Memo field in a combo box, the

entire contents of the Memo field are not visible. Instead, only the

first 255 characters of the memo field are visible.

RESOLUTION

If you need to view the entire contents of a Memo field, use a text

box instead of a combo box.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Most data types are limited to 255 characters, but Memo data type fields

can contain up to 32,000 characters. A combo box can only display up to

255 characters, regardless of the underlying field's data type.

Additional reference words: 1.00 1.10


PRB: Not Enough Stack Memory When Opening Form

 Article Number: Q96988

 CREATED: 04-APR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you open a form, it flashes repeatedly, and the following

message is displayed:

   Not Enough Stack Memory

CAUSE

One possible cause is that a macro with a Requery action is assigned

to the first control in the form's Tab Order. Or the macro is

assigned to the OnCurrent property of the form. This creates an

infinite loop, causing the form to requery until stack memory is

depleted.

RESOLUTION

If the macro must be assigned to the first control, assign it to the

BeforeUpdate event of the control.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

The example below uses the sample database NWIND.MDB.

Steps to Reproduce

------------------

1. Create a new macro with a single Requery action. You do not need to

   fill in any arguments for this macro action. Save the macro as

   MyRequery.

2. Open the Categories form in Design view.

3. Assign the macro MyRequery to the OnEnter property of the first

   control on the Categories form. This should be the text box control

   named Category ID.

4. Open the form in Form view.

The form flashes several times. After several seconds, you receive the

following error message:

   Not Enough Stack Memory

Additional reference words: 1.00 1.10 continuously


INF: How to Create a "Please Wait" Message

 Article Number: Q96989

 CREATED: 04-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Sometimes you may want to display a status message to inform a user he

or she must wait for an action to be completed. For example, you may

want to display the text "Please Wait" while Microsoft Access is

initializing a database, running a long query, and so on. You can do

this by using a form and a macro. This article presents a simple

example using the sample database NWIND.MDB.

MORE INFORMATION

To display a status message in Microsoft Access, do the following:

1. Create an unbound blank form named PLEASEWAIT. Add a label with the

   message you want to display. For example, type "Please Wait" (without

   the quotation marks) as the caption. The form properties should be set

   to the following:

      Form: PLEASEWAIT

      ----------------

      ScrollBars: Neither

      Popup: Yes

      Modal: Yes

      RecordSelectors: No

2. Create the following macro named Test1:

      Macro Name             Action

      -----------------------------

      Test1                  OpenForm

                             RepaintObject

                             OpenQuery

                             Close

      Test1 Actions

      -----------------------------

      OpenForm

         Form Name: PLEASEWAIT

         View: Form

         Date Mode: Read Only

         Window Mode: Normal

      RepaintObject

         Object Type: Form

         Object Name: PLEASEWAIT

      OpenQuery

         Query Name: <Daily Orders Total>

         View: Datasheet

      Close

         Object Type: Form

         Object Name: PLEASEWAIT

   NOTE: The above argument for OpenQuery is just an example of what you

   may want to run; this can be anything. The main macro actions in Test1

   are OpenForm, RepaintObject, and Close.

3. Run the macro. The PLEASEWAIT form should open. As soon as the

   query completes processing, the form disappears and the query results

   appear.

Additional reference words: 1.00 1.10 2.00 StatusBar Status Bar Meter


PRA: GPF Hiding Control in Form Footer in Datasheet View

 Article Number: Q96990

 CREATED: 04-APR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

If you have a control in the footer of a form and you then

hide that

control in an event, such as OnCurrent, and then view the

form in

Datasheet view, Microsoft Access may cause a general

protection (GP)

fault.

CAUSE

In Datasheet view, Microsoft Access incorrectly assumes that

a grid

column is associated with the field being hidden. However,

that is

not true in this case, since the control is in the form's

footer.

RESOLUTION

Since forms with controls in the footer are normally meant

to be

used in Form view, set the Form's ViewsAllowed property to

Form

so that the form cannot be switched to Datasheet view.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access version

1.0. This problem no longer occurs in Microsoft Access

version 1.1.


PRA: GPF When Using ListParameters Method on Database

 Article Number: Q96991

 CREATED: 04-APR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SYMPTOMS

Illegally using the ListParameters method on a Database object does

not generate a compile-time error as expected, but rather a general

protection (GP) fault.

RESOLUTION

The ListParameters method is intended only for use with QueryDef objects.

Use only methods legal for use on the Database object:

   Close            CreateDynaset

   CreateQueryDef   CreateSnapshot

   DeleteQueryDef   ListTables

   OpenQueryDef     OpenTable

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

version 1.0. This problem was corrected in Microsoft Access version 1.1.

MORE INFORMATION

In Microsoft Access versions 1.1 and 2.0, you receive the following

descriptive compile-time error instead of a GP fault:

   Method not applicable for this object

Attempting to list parameters for a database object is illegal, but

instead of generating the expected compile-time error, Microsoft

Access version 1.0 generates a GP fault. For example, the following

subroutine causes a GP fault in Microsoft Access version 1.0 instead

of a compile-time error:

   Sub Test

      Dim db As Database

      Dim Snap As Snapshot

      Set db = CurrentDB()

      Set Snap = db.ListParameters()

   End Sub

Additional reference words: 1.00


PRA: Setup Leaves MS-SETUP.T Directory and Files on Disk

 Article Number: Q96992

 CREATED: 04-APR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

If you request Microsoft Access SETUP.EXE to install

SHARE.EXE and

then reboot your computer when installation is complete,

Setup does not

properly erase the temporary directory MS-SETUP.T (and the

files it

contains) on your hard disk. This leftover directory

contains data

files totaling approximately 600K. These files occupy disk

space, but

otherwise have no affect on Microsoft Access or any other

application.

RESOLUTION

Either do not choose Reboot Your Machine at the end of the

installation process, or manually delete the temporary

directory

MS-SETUP.T and its files after you reboot.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0. This problem has been corrected in Microsoft

Access

version 1.1.


PRA: GPF Using Invalid IIf() as ControlSource

 Article Number: Q96993

 CREATED: 04-APR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

If you use the IIf() function as the ControlSource property

of a

form or report and do not provide the necessary parentheses

around

the parameter list, Microsoft Access may cause a general

protection

(GP) fault instead of returning an error message.

For example, the following syntax is incorrect and will

cause a GP

fault:

   =IIf IsNull([Fld]),"NULL","NOT NULL"

Note that the parentheses for the IIf() function are

missing. As

soon as you try to leave the property setting, the GP fault

will

occur.

RESOLUTION

Ensure that all IIf() functions include the required

parentheses

around the parameter list. The following syntax is a

corrected

version of the one displayed above:

   =IIf(IsNull([Fld]),"NULL","NOT NULL")

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0. This problem was corrected in Microsoft Access

version 1.1.


PRA: File Truncation on Password-Protected Servers

 Article Number: Q96994

 CREATED: 04-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Using an incorrect Microsoft Windows for Workgroups driver with

Microsoft Access may cause file truncation. If you have an early

version of the Windows for Workgroups WFWNET.DRV file (dated before

11/02/92), choosing the Network button in Microsoft Access dialog

boxes to connect to password-protected servers may cause database

files opened on those servers to become truncated.

NOTE: This problem was discovered before Microsoft Access was released.

All copies of Microsoft Access include the updated Windows for Workgroups

driver and installation instructions.

RESOLUTION

Update the WFWNET.DRV driver file, using the driver update program

included with Microsoft Access. Complete instructions are contained in

the flier included in your copy of Microsoft Access.

Additional reference words: 1.00 1.10 2.00 wfwg truncate


PRB: Stacker 3.0 CHECK.EXE Reports Database Files as Corrupt

 Article Number: Q96995

 CREATED: 04-APR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Running the Stacker version 3.0 CHECK.EXE program with the /=D and /F

switches often results in erroneous reports that Microsoft Access .MDB

files are corrupt and should be deleted. The /=D and /F switches are

meant only for development and debugging purposes and can incorrectly

identify files as corrupt.

RESOLUTION

Do not run the CHECK.EXE program with the /=D switch. If you do run

CHECK.EXE with the /=D switch, choose No when you are prompted to

delete corrupt files.

MORE INFORMATION

STAC Electronics has created a document explaining the "lost sector

groups" reported by CHECK /=D. This file is called TEC042.DOC on

CompuServe and the STAC BBS, and document #3003 on STAC FAX, STAC

Electronics's automated fax response service.

Stacker is manufactured by STAC Electronics, a vendor independent of

Microsoft; we make no warranty, implied or otherwise, regarding this

product's performance or reliability.

arguments options

Additional reference words: 1.00 1.10 2.00 WinIss third-party flags


INF: How to Change the Font for the Zoom Box

 Article Number: Q96996

 CREATED: 04-APR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to modify the system UTILITY.MDA database

to change the default font used in the Zoom box of Microsoft Access.

MORE INFORMATION

To change the font for the Zoom box, do the following:

1. Before you open Microsoft Access, copy the UTILITY.MDA file to

   MYUTIL.MDA. The UTILITY.MDA file is generally stored in your Microsoft

   Access directory.

2. Start Microsoft Access. From the File menu, choose Open Database,

   select MYUTIL.MDA, and choose the OK button.

   NOTE: When you open this database, you are prompted to choose the OK

   button in response to several error messages. These errors are caused by

   duplicate modules loaded from the UTILITY.MDA database. The messages

   will be similar to the following:

      Tried to load module with duplicate procedure definition: BuilderZoom

3. In Design view, open the ZoomForm form. Select the unbound text box

   control Zoom, and change the following properties to the ones noted

   below or to a font of your choice.

      FontName:    Microsoft Sans Serif

      FontSize:    12

      FontWeight:  Semi-bold

   NOTE: Select a font and a size that suit your needs.

4. Close the database and save your changes to the ZoomForm form. Exit

   Microsoft Access.

5. Use any ASCII text editor, such as NOTEPAD.EXE, to modify the

   MSACCESS.INI file in your Windows directory. You should modify the

   MSACC20.INI file if you are using Microsoft Access version 2.0.

   Change the following line in your [Options] section from

      [Options]

      UtilityDB=C:\ACCESS\UTILITY.MDA

      -to-

      [Options]

      ;UtilityDB=C:\ACCESS\UTILITY.MDA

   Add a new line so the section reads:

      [Options]

      ;UtilityDB=C:\ACCESS\UTILITY.MDA

      UtilityDB=C:\ACCESS\MYUTIL.MDA

6. Save the MSACCESS.INI file or MSACC20.INI file.

When you next start Microsoft Access and use the Zoom box for editing,

the font, size, and weight reflect the changes you made.

Additional reference words: 1.00 1.10 2.00 zoombox font expressions


PRB: Toolbar Disappears When Printing a Document

 Article Number: Q96997

 CREATED: 04-APR-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you choose Print while previewing a form or report, the toolbar

disappears while the Print dialog box is being displayed. The toolbar

reappears after the print job has been sent.

STATUS

This behavior is by design. The behavior does not compromise any

functionality in Microsoft Access.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Preview any report.

2. From the File menu, choose Print.

Note that the Print dialog box appears and that the toolbar disappears.

If you print the report, the toolbar returns when the print job has been

completed.


PRB: Query Window Does Not Always Scroll to Record

 Article Number: Q96998

 CREATED: 04-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you click on a query's record selector field and press ENTER,

the screen does not always scroll automatically to display that

record.

RESOLUTION

In order to get the window to scroll to a record, the selector

field must first be altered.

STATUS

This behavior is by design.

MORE INFORMATION

If the record selector shows record 1, clicking on the record number and

pressing ENTER sends the insertion point to that record but does not scroll

the screen to display record 1.

Steps to Reproduce Behavior

---------------------------

Follow these steps in the sample database NWIND.MDB:

1. Run the query named Customer List.

2. Using the vertical scroll bar, scroll down the query. Note that

   the record selector does not change from record 1.

3. Click the mouse just to the right of the record number 1 and press

   ENTER. The insertion point disappears, but the query window does not

   scroll to record 1.

4. Repeat steps 1-3, but this time erase the record number and retype

   it. Press ENTER.

Note that this time the window scrolls to record 1. This is the

normal behavior with any record number you enter.

Additional reference words: 1.00 1.10 2.00


PRB: File Rename Dialog Still Enabled When No Filename Given

 Article Number: Q96999

 CREATED: 04-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you have the Database window open, if you choose Rename from

the File menu and do not enter a name for the selected object, the

OK button is still enabled. If you choose the OK button, you will

receive the following error message:

   Not a valid document name:

CAUSE

Dialog boxes that are provided with Windows disable the OK button

if an expected entry is not made. This particular dialog box is not

provided by Windows. Microsoft Access does not disable the OK

button in this dialog box when there is no entry in the field.

RESOLUTION

You must enter a new name for the object.

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10 2.00


PRB: Incorrect Results Received with DSum() Function

 Article Number: Q97000

 CREATED: 04-APR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Incorrect results received from the Dsum() function.

CAUSE

The Dsum() function returns a set of values in a specified set of

records (domain). Typically you might use this function in a text box

control on a report to total the values from a field in a table or

query.

If you omit the surrounding quotation marks from the expression

argument, you will not see the expected error message. Instead, you

see a value that is actually derived by taking the last value of the

field from the report and summing it x number of times (once for each

record in the table or query).

RESOLUTION

Surround each argument in the Dsum() function with quotation marks.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

The following example is based on the sample database NWIND.MDB:

1. Open the Freight Charges report in Design view.

2. Add a text box to the Company Name footer section:

      Object: Text Box

      ----------------------------------------------------

      ControlName: MyDsum

         ControlSource: =DSum([Freight],"Freight Charges")

3. Preview the report. The amount showing in this text box is

   incorrect (compare it to the text box control in the report footer

   section named Grand Total). Notice that the optional criteria

   expression is not included in this example. Therefore, you would

   expect to see the total of the Freight field from the Freight

   Charges query.

4. Change the ControlSource to:

      =DSum("[Freight]","Freight Charges")

6. Preview the report. Now the amount in the text box is correct.

REFERENCES

==========

For more information on the Dsum() function, search for "Dsum" using the

Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 expressions


INF: "Fieldname" Is Not an Index in This Table

 Article Number: Q97001

 CREATED: 04-APR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you run an Access Basic function that attempts to perform a

Seek method on a table, you receive the following error message

   '<Fieldname>' isn't an index in this table.

where <Fieldname> is the name of a field in your table that has been

defined as an index in your function. This field is also the primary

key in the table.

CAUSE

When you set the Index property in your function and you are

referring to a primary key field, you should refer to the field as

PrimaryKey; that is, do not refer to the field by the name of the

field.

RESOLUTION

Change the statement in your function that sets the current Index

property. The correct syntax should resemble the following:

   EMPTable.Index = "PrimaryKey"

MORE INFORMATION

The following example is based on the sample database NWIND.MDB:

Steps to Reproduce

------------------

1. Create a new module and enter the following function:

      '*********************************************

      'Declarations section of the module.

      '*********************************************

      Option Explicit

      '=============================================

      ' This FINDID function accepts one parameter.

      '=============================================

      Function FINDID (EMPLOYID As String)

         Dim db As Database, EMPTable As Table

         Set db = CurrentDB()

         Set EMPTable = db.OpenTable("Employees")

         EMPTable.Index = "EMPLOYEE ID"

         EMPTable.Seek "=", EMPLOYID

            If EMPTable.NoMatch Then

               MsgBox "Not a valid ID. Try another"

            Else

               MsgBox "This Employee ID is in the table!"

            End If

         EMPTable.Close

      End Function

2. From the View menu, choose the Immediate window.

3. Enter the following statement in the Immediate window:

      ? FINDID("1")

   You will see the following error message:

      'Employee ID' isn't an index in this table.

   NOTE: The Employee ID field has been defined as the primary key in

   the Employees table.

4. Change the EMPTable.Index statement to the following:

      EMPTable.Index = "PrimaryKey"

5. Repeat step 3.

   You will see the appropriate message box indicating whether you

   entered a valid number.

REFERENCES

==========

Microsoft Access "Introduction to Programming," version 1.0, page 114

Additional reference words: 1.00 1.10 seek find errmsg docbug


PRA: GPF Referencing Form Dynaset with Form Variables

 Article Number: Q97002

 CREATED: 04-APR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

Form dynaset references do not always work properly when

using form

variables. If you reference a form dynaset with variables,

you may

receive a general protection (GP) fault.

RESOLUTION

Always refer to a form dynaset with explicit references

through the

form. The first code fragment below shows how to reference a


PRA: Cannot Add Counter Columns to Tables with > 4 MB Data

 Article Number: Q97003

 CREATED: 04-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

-------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You cannot add Counter data type columns to existing tables

containing roughly greater than 4 megabytes (MB) of data.

CAUSE

This problem occurs because of a limitation in the Microsoft Access

transaction model, which is limited to a transaction size of about 4 MB.

The problem occurs with Counter columns because the table data for

columns is updated when the new column is added. The update takes

place in a transaction, and with large tables (greater than 4 MB),

the update encounters the Microsoft Access transaction size limit.

When this happens, the transaction rolls back and the Counter

column is not successfully added.

RESOLUTION

Use the following steps to add a Counter column to a large table:

1. Copy and paste the table's structure (not the table's data) to a

   new table.

2. Add a Counter data type column to the new table.

3. Create an append query that transfers the data from the old table

   to the new table.

4. Verify that the new table has the correct data.

5. Delete the old table.

6. Rename the new table to the name of the old table.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

versions 1.0 and 1.1. This problem no longer occurs in Microsoft Access

version 2.0.

Additional reference words: 1.00 1.10


PRA: GPF on Update Query Due to Query Design Option

 Article Number: Q97004

 CREATED: 04-APR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

Update queries do not work correctly if you use the Options

command

on the View menu to set the Query Design option, Restrict

Available

Fields, to No (the default is Yes). In most cases, Microsoft

Access

causes a general protection (GP) fault; however, there have

been

isolated cases where the query completed and incorrectly

updated

the wrong columns in the table.

RESOLUTION

Set Restrict Available Fields to No on a query-by-query

basis by

clearing the Restrict Available Fields check box on the

Query

Properties dialog box instead of using the Options/View menu

method

to set this option on a global basis.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0. This problem was corrected in Microsoft Access

version 1.1.


PRA: Descending Sort Query Returns Wrong Number of Rows

 Article Number: Q97005

 CREATED: 04-APR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

When sorting data in descending order on an indexed column

containing over 506 duplicate entries, Microsoft Access may

return

the wrong number of rows to the user.

CAUSE

This occurs when the Index property for a column is set to

"Yes (No

Duplicates)" or "Yes (Duplicates OK)," but not when there is

a

primary key on the column. Nonprimary-key indexes can have

multiple

null entries.

RESOLUTION

Remove the index from the column being sorted. This causes

the

query to execute more slowly but gives you correct results.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0. This problem was corrected in Microsoft Access

version 1.1.


PRA: Bad Results Searching Multicolumn Paradox Indexes

 Article Number: Q97006

 CREATED: 04-APR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SYMPTOMS

Using the Find command on the Edit menu to search Paradox

fields for

specific values does not work properly if all of the

following are

true:

 - The field being searched is part of a multicolumn index.

 - The field contains NULLs.

 - The Search Fields As Formatted option is disabled in the

Find In

   Field dialog box on the Edit menu.

RESOLUTION

To work around this problem, check the Search Fields As

Formatted

option in the Find In Field dialog box so that the index is

not used

in the search. Similarly, when querying on Paradox fields

that are

part of a multicolumn index containing NULL values, use the

LIKE

operator in places where you would normally use the

equivalence

operator. For example, avoid using

   SELECT *

   FROM TestTable

   WHERE ((FieldX=23));

and instead use the following:

   SELECT *

   FROM TestTable

   WHERE ((FieldX Like 23));

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

versions 1.0 and 1.1. We are researching this problem and

will post

new information here in the Microsoft Knowledge Based as it

becomes

available.

Additional reference words: 1.00 1.10


PRB: Only One Button Accepts Selection in Yes/No Option Group

 Article Number: Q97510

 CREATED: 13-APR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When a database contains a form that has an option group bound to a

Yes/No field and the option group contains two option buttons, one

of which is assigned the option value 0 and the other the option

value 1, only the second button can be selected.

CAUSE

In Microsoft Access, the value (0) represents FALSE and any other

value represents TRUE. In a field of data type yes/no, TRUE values

are assigned the value (-1). If you select an option button that

has the value (1), the yes/no field to which the option group is

bound is changed to (-1), or TRUE.

Actually, the option button attempts to put the value (1) into the

yes/no field. But since the field is of data type yes/no, the field

is set to (-1) for any value other than (0). The value of the

option button is set to (1) and the yes/no field now contains a

(-1), therefore the button does not appear to be selected.

RESOLUTION

Change the option value for the second button from 1 to -1.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. In a form, create an option group for a Yes/No field.

2. Add two option buttons to the group.

3. Set the option value for Button1 to 0.

4. Set the option value for Button2 to 1.

5. Choose Form view. Any attempt to select Button2 fails.

Additional reference words: 1.00 1.10 2.00 radiobutton


PRB: Unable to Add All Fields in Graph FormWizard

 Article Number: Q97511

 CREATED: 13-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When creating a graph, you will receive the following error message

if you try to include more than one date field in the graph:

   You can select only one date field.

You will receive the following error message if you try to include

more than three fields in the graph and more than one of those

fields is a text field

   You can only select one non-numeric field if you want to use

   <number> fields for your chart.

where <number> is the number of fields that you selected.

STATUS

This behavior is by design.

MORE INFORMATION

When you are creating a chart with the Graph FormWizard, the Add All

(>>) button, even though it is displayed as a choice, will return an

error message if your source table or query contains more than one

date field. You will also receive an error message when using the Add

All (>>) button if your source table or query contains more than one

text field for a chart that has more than three fields.

Steps to Reproduce Behavior

--------------------------

1. Open the NWIND.MDB sample database.

2. Use FormWizards to create a new form based on the Orders table.

3. When the FormWizard asks "Which AccessWizard do you want?" select

   Graph. Choose the Next button.

4. When the FormWizard asks "Which type of Graph do you want?" choose

   the Next button.

5. When the FormWizard asks "Which fields contain the data you want

   to graph and use for labels?" select all the fields. To select all

   the fields, choose the Add All (>>) button.

   When you choose the Next button, you will receive an error message

   indicating that only one date field can be in the graph.

   To receive the other error message, repeat steps 2-4, substituting

   the Customers table for the Orders table.

Additional reference words: 1.00 1.10 2.00


PRB: ValidationRule Parses Function Name w/o Parens to String

 Article Number: Q97512

 CREATED: 13-APR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you type an expression containing a function name that has no

parentheses or parameters in the ValidationRule property of a text

box, the expression is evaluated as a string instead of a function.

RESOLUTION

Put parentheses or parameters after all function names so they can

be correctly evaluated as functions instead of text strings. For

example, use

   =Date()

instead of:

   =Date

NOTE: For this example to work correctly, after putting parentheses after

=Date, you also need to change the Format property of the text box to

General Date.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create a new, unbound blank form.

3. Place a new, unbound text box on the blank form.

4. From the View menu, choose Properties so that you can change the

   properties of the form and objects on the form.

5. In the ValidationRule property of the text box, type the following

   and then press the ENTER key:

      =Date

   Note that Microsoft Access automatically changes the expression you

   entered from =Date to ="Date".

6. From the View menu, choose Form.

7. Type a date in the text box.

   When you type a date such as 04/05/93 in the text box and then

   press the ENTER key, you get the message, "The value you entered is

   prohibited by the validation rule set for this field." However, the

   text box accepts the word "Date," which is the word changed by

   Microsoft Access in the ValidationRule property of the text box.

Additional reference words: 1.00 1.10 2.00 validation


PRB: "Table Exclusively Locked" Error Switching to Form View

 Article Number: Q97513

 CREATED: 13-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

An attempt to switch from Design view to Form view fails and

Microsoft Access generates the following message:

   Table <tablename> is exclusively locked

CAUSE

The form's RecordSource property refers to a table that remains

open in Design view.

RESOLUTION

Perform one of the following three procedures to address this

behavior:

 - Close the open table.

 - Change the open table to Datasheet view.

 - Open the form before opening the table (this opens the table in

   Design view for read-only access).

Additional reference words: 1.00 1.10 2.00 errmsg


INF: Writing Functions Called from Events or Expressions

 Article Number: Q97514

 CREATED: 13-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Functions can be used in a variety of places in Microsoft Access. How

you write your functions depends on where the functions are going to

be called from.

This article assumes that you are familiar with Access Basic and with

creating applications for Microsoft Access using the programming tools

provided with Microsoft Access.

MORE INFORMATION

There are two main styles for writing Access Basic functions:

 - Functions can be called from event properties, such as the

   AfterUpdate property for a control on a form. Typically, you would

   call the function with a parameter. The function then acts on or

   modifies the parameter.

 - Functions can be used in expressions, such as calculated controls.

   The difference is in how the result is returned when the function

   exits.

NOTE: This article does not address event procedures in Microsoft Access

version 2.0, since these are Sub procedures and not functions.

The examples below use the Proper() function to illustrate the

differences between the two function styles. Proper() converts the

first letter of a word to uppercase and the other letters to

lowercase.

Calling a Function from an Event Property

-----------------------------------------

The Proper() function can be written so it can be called from an

event, such as the AfterUpdate property of a control on a form. In

this example we will call it ProperAU() as a reminder that it should

be called from the AfterUpdate property.

Enter the following function in a module:

   Function ProperAU(Field As Control)

      Field=UCase(Left(Field,1)) & LCase(Mid(Field,2))

   End Function

NOTE: The result of the calculation updates the field that was

passed as a parameter.

Example

-------

1. Open the Customers form in Design view.

2. View the Property sheet by choosing Properties from the View menu.

3. Add the following statement to the AfterUpdate property of the

   First Name field:

      Object: Text Box

      ----------------

      ControlName: First Name

      AfterUpdate: =ProperAU([First Name])

Now, whenever the employees name is typed into the Employee form,

it will be converted to the correct format when the user presses

TAB or ENTER.

Calling a Function from an Expression

-------------------------------------

The Proper() function can be written so it can be called from an

expression, or calculated control. In this example we will call it

ProperCC() as a reminder that it should be used in calculations.

Enter the following function in a module:

   Function ProperCC(Field)

      ProperCC=UCase(Left(Field,1)) & LCase(Mid(Field,2))

   End Function

NOTE: The result of the calculation is assigned to the function.

This way, it can be used in an expression or calculated control.

Example

-------

1. Open the Customers form in Design view.

2. Add the following calculated control to the form:

      Object: Text Box

      ----------------

      ControlName: Proper Last Name

      ControlSource: =ProperCC([Last Name])

   Now when you type in the Last Name field, you will see the correct

   capitalization in the Proper Last Name field.

   NOTE: You will not be able to type in the Proper Last Name field.

   ProperCC() does not change underlying data like ProperAU() does.

   For this reason, ProperCC() is useful in reports and expressions

   and can be used more places than ProperAU().

   You can use ProperCC in the same manner as any of the built-in

   functions listed in the "Language Reference," such as UCase, LCase,

   and so on.

Determining the Type of Function You Need

-----------------------------------------

   Where used                                   Function style

   -----------------------------------------------------------

   AfterUpdate, BeforeUpdate, and so on         Event

   RunCode macro action                         Event

   Calculated controls on forms and reports     Expression

   Calculated fields in a query                 Expression

   SetValue macro action expression             Expression

   Default values in a table or form            Expression

   Called from another function or sub          Expression

Additional reference words: 1.00 1.10 2.00


INF: Passing a Null Pointer to an External DLL

 Article Number: Q97515

 CREATED: 13-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The null value is a valid or required parameter for some dynamic-link

libraries (DLLs). To specify a null value, use 0&.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

When your procedure calls a function and passes the expression 0&, the

ampersand (&) specifies a 32-bit (far) null pointer. In a function

declaration, an As Any parameter instructs Access Basic to omit type

checking for that parameter and to pass the value to the called

function.

The following code demonstrates the correct method to declare an

Access Basic function that passes a null parameter to a function in a

DLL. Open a new module or edit a previously created Module to contain

the following code.

Notes

-----

 - In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

 - Some functions of the Microsoft Windows application programming

   interface (API) may be declared in an existing Microsoft Access library.

   If so, the declarations below are duplicates. If the duplicate procedure

   name error occurs, remove or comment out the offending declare statement

   from your code.

   '*********************************************************************

   'Declarations section of the module.

   '*********************************************************************

   Option Explicit

   '=====================================================================

   ' Declare the WriteProfileString API function from the external

   '    Windows dynamic-link library "kernel."

   '=====================================================================

   Declare Function WriteProfileString% Lib "Kernel" (

                       ByVal lpApplicationName As Any,

                       ByVal lpKeyName As Any,

                       ByVal lpString As Any)

   '=====================================================================

   ' Create the following FlushIniCache%() function in the Module. The

   ' following function calls the external function, specifying null for

   ' each argument. This causes WriteProfileString to flush its internal

   ' cache and writes to disk any changes to WIN.INI. NOTE: Using this

   ' function incorrectly can cause a general protection fault or modify

   ' your WIN.INI file.

   '=====================================================================

   Function FlushIniCache%()

      FlushIniCache = WriteProfileString% (0&, 0&, 0&)

   End Function

Additional reference words: 1.00 1.10 2.00


PRB: Random Characters in Text Box Bound to OLE Object Field

 Article Number: Q97516

 CREATED: 13-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

In Form view, when you set the ControlSource property for a text

box to an OLE Object field, strange characters appear in the text box.

RESOLUTION

Change the ControlSource for the text box to a field that is not an

OLE Object and use an OLE Object Frame to display the contents of

the OLE Object field.

MORE INFORMATION

The text box displays random characters, such as vertical bar

characters or apostrophes, when a text box is bound to an OLE Object

field and the current record contains an OLE Object in that field. If

the OLE Object field in the current record is empty, no characters

appear in the text box.

Additional reference words: 1.00 1.10 2.00


INF: How to Print Total Number of Pages on Each Page of Report

 Article Number: Q97517

 CREATED: 13-APR-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

You can print the page number on each page of a report by using the

Page property in a text box control in the page footer. The example

below also shows you how to print the total number of pages in the

report on each page (for example, 1/<n>, where <n> is the total number of

pages).

The sample program below uses the SendKeys statement to go to the end of

the report, stores the total number of pages in a global variable, then

returns to the beginning of the report to print or preview the report.

NOTE: This method may not work with all reports. Below are four known

problems with this method:

 - If the report window is zoomed (maximized), the END key in the

   SendKeys statement will not work correctly.

   By default, reports open with the report window zoomed. Pressing Z

   unzooms the screen and pressing the END key moves you to the end of

   the report so that the code below can calculate the total number of

   pages. However, if the report window is zoomed, the END key moves

   the cursor to the right corner of the screen instead of going to

   the last page of the report. The SendKeys statement in the

   GotoEnd() function contains the key combination ALT+Z  (or %Z) to

   toggle the zoomed mode off. If your report displays a 0 for total

   pages, try omitting the %Z from the SendKeys statement.

 - If a query takes a long time to process, Microsoft Access can yield

   processor control to Windows, which empties the keyboard buffer.

   When  this happens, the GotoEnd() function (which uses SendKeys)

   fails, the  SendKeys data is lost, and the total number of pages

   listed may be wrong. (This problem most often occurs when a report

   contains subreports.)

 - If your report contains subreports, this method does not calculate

   the total number of report pages correctly. Currently, there is no

   workaround for this behavior. A change to this behavior is being

   reviewed for inclusion in a future version of Microsoft Access.

-  If you use an OpenReport macro action where the report is sent

   directly to the printer, this will fail because the functions are not

   allowed to go to the end of the report and back again to create the

   total page number variable.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools

provided with Microsoft Access. For more information on Access Basic,

please refer to the "Introduction to Programming" manual.

MORE INFORMATION

To print the total number of pages in a report at the bottom of each

page, do the following:

1. Open a new module or a previously created module and enter the

   following sample code:

   NOTE: In the following sample code, an underscore (_) is used as a

   line-continuation character. Remove the underscore when re-creating

   this code in Access Basic.

      '*************************************************************

      'Declarations section of the module

      '*************************************************************

      Option Explicit

      Global TotalPages as Integer

      '*************************************************************

      'Create the following functions in the module.

      '*************************************************************

      Function GetTotalPages()

         GetTotalPages = TotalPages

      End Function

      Function GotoEnd()

         TotalPages = 0

         SendKeys "%z{END}", False

         ' SendKeys does not work if report is maximized

      End Function

      Function SaveTotalPages(TotPgNum As Integer)

         If TotalPages = 0 Then

            TotalPages = TotPgNum

            SendKeys "{HOME}", False

         End If

      End Function

2. Open your report in Design view.

3. From the View menu, choose Properties to display the property

   sheet. Add the following function to the report's OnOpen event:

      OnOpen: =GotoEnd()

4. Place a text box control called MyPage in the page footer:

      Object: Text Box

      ----------------

      ControlName: MyPage

         ControlSource: =Page

         Visible: No

5. Change the report footer's OnFormat property to:

      OnFormat: =SaveTotalPages([MyPage])

6. Place a text box control in the page footer as follows:

      Object: Text Box

      ----------------

      ControlName: PageNum

         ControlSource: =Page & "/" & GetTotalPages()

When you print the report, the text box control prints the page number

as 1/<n>, where <n> is the total number of pages in the report.


INF: How to Select More than One Item from a List Box

 Article Number: Q97518

 CREATED: 13-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to create a pair of list boxes to imitate the

multiple selection behavior used in AccessWizards.

MORE INFORMATION

The example below demonstrates how to create a new form that contains two

list boxes and three command buttons. You can add items to or delete

items from the list using the command buttons or the properties of the

list boxes:

1. Create the following new table:

      Table: Table1

      -----------------------------------------------

      Field Name: List (primary key)

         DataType: Text

         Field Size: 15

         Caption: Items that will be provided in list

      Field Name: Selected

         DataType: Text

         Field Size: 5

         Caption: Indicates if the item has been selected

2. View the table in Datasheet view. Add five records to the table. For

   each record, type any text in the List field (for example a list of

   colors or cities), and type "YES" (without quotation marks) in the

   Selected field.

3. Create the following two new queries based on Table1:

      Query: Select Yes

      -------------------------------

      Field Name: List

         Show: Yes

         Criteria: [selected] = "YES"

      Query: Select No

      ------------------------------

      Field Name: List

         Show: Yes

         Criteria: [selected] = "NO"

4. Enter the following three sample functions in a new or existing

   module:

      '=======================================================

      'The following function opens the table and changes the

      'selected value from YES to NO, and then executes the

      'query for the two list boxes so that they will display

      'the updated values.

      '=======================================================

      Function ADD ()

         Dim MyDB As Database

         Dim MyTable As Table

         Dim y As Control

         Set MyDB = CurrentDB()

         Set MyTable = MyDB.OpenTable("Table1")

         Set y = forms!SelectList.field0

         MyTable.index = "PrimaryKey"

         MyTable.Seek "=", y

         MyTable.Edit

         MyTable.[selected] = "no"

         MyTable.Update

         MyTable.Close

         DoCmd Requery "field0"

         DoCmd Requery "field1"

      End Function

      '=======================================================

      'The following function opens the table and changes the

      'selected value from NO to YES, and then executes the

      'query for the two list boxes so that they will display

      'the updated values.

      '=======================================================

      Function Del ()

         Dim MyDB As Database

         Dim MyTable As Table

         Dim y As Control

         Set MyDB = CurrentDB()

         Set MyTable = MyDB.OpenTable("Table1")

         Set y = forms!SelectList.field1

         MyTable.index = "primarykey"

         MyTable.Seek "=", y

         MyTable.Edit

         MyTable.[selected] = "yes"

         MyTable.Update

         MyTable.Close

         DoCmd Requery "field0"

         DoCmd Requery "field1"

      End Function

      '=======================================================

      'The following function sets all values in the Selected

      'field to YES, and then executes the query for the two

      'list boxes so that they will display the updated

      'values.

      '=======================================================

      Function Clear ()

         Dim MyDB As Database

         Dim MyTable As Table

         Set MyDB = CurrentDB()

         Set MyTable = MyDB.OpenTable("Table1")

         On Error GoTo erhandle

         MyTable.MoveFirst

         Do Until MyTable.EOF

            MyTable.Edit

            MyTable.[selected] = "yes"

            MyTable.Update

            MyTable.MoveNext

         Loop

      erhandle:

         Resume Next

         DoCmd Requery "field0"

         DoCmd Requery "field1"

      End Function

5. Create the following new, unbound form, and then save it as

   SelectList:

      Object: list box

      -----------------------------

      ControlName: field0

         ControlSource:

         RowSourceType: Table/Query

         RowSource: Select Yes

         OnDblClick: =ADD()

      Object: list box

      -----------------------------

      ControlName: field1

         ControlSource:

         RowSourceType: Table/Query

         RowSource: Select No

         OnDblClick: =Del()

      Object: command button

      -----------------------

      ControlName: Button One

         Caption: Clear

         OnPush: =Clear()

      Object: command button

      -----------------------

      ControlName: Button Two

         Caption: Add item

         OnPush: =Add()

      Object: command button

      -------------------------

      ControlName: Button Three

         Caption: Delete item

         OnPush: =Del()

The first list box, Field0, displays the items to be selected. The second

list box, Field1, displays the items that are selected.

Additional reference words: 1.00 1.10 2.00 listbox combo multiple fill


INF: Correct Syntax for TransferDatabase to dBASE and Paradox

 Article Number: Q97519

 CREATED: 13-APR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you attempt to export a Microsoft Access table to dBASE or Paradox,

you may encounter errors. This article explains the correct argument syntax

for exporting the Categories table from the sample database NWIND.MDB to

dBASE III using the TransferDatabase macro action. The equivalent Access

Basic syntax is also explained.

MORE INFORMATION

NOTE: Both of the following examples export the Categories table to

a dBASE file in the C:\DBASE directory. You need to enter a valid

directory in your macro or you may receive the following error

message when you run the macro or function:

   isn't a valid path

Example 1 - Using the TransferDatabase Macro Action

---------------------------------------------------

Create a macro named Export1. This macro will export the Categories

table to a dBASE file.

   Macro Name     Action

   -------------------------------

   Export1        TransferDatabase

   Export1 Actions

   ------------------------------

   TransferDatabase

      Transfer Type:   Export

      Database Type:   dBASE III

      Database Name:   C:\dbase

      Object Type:     Table

      Source:          Categories

      Destination:     Test1.dbf

      Structure Only:  No

NOTE: To use the TransferDatabase macro action to export to a

Paradox table, you must choose "Paradox" for the Database Type

argument and enter the Destination argument as "Test1.db".

Example 2 - Using an Access Basic Function

------------------------------------------

Create a new module and enter the following function:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   Function ExportdBASE ()

      DoCmd TransferDatabase a_export, "dBASE III", "c:\dbase", _

               a_table, "Categories", "Test1.dbf"

   End Function

Additional reference words: 1.00 1.10 2.00 docbug errmsg


INF: Maximum Number of Rows in Table When Counter is the Key

 Article Number: Q97520

 CREATED: 13-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The maximum value of a Counter data type is the same as the maximum

value of a Long Integer. A Long Integer is 32 bits long and has a

maximum positive value of 2,147,483,647 and a minimum negative value

of -2,147,483,648. If you use a Counter as the primary key, a table

can contain up to four billion records. The maximum number of records

in the table is also limited by the maximum size of a database. For

more information, see Appendix A in the Microsoft Access "User's

Guide," versions 1.0, 1.1 and 2.0.

MORE INFORMATION

Values in a Counter field increment from 1 to 2,147,483,647. The next

record receives the minimum negative value for a Long Integer,

-2,147,483,648. The Counter value for each subsequent record is one

greater than the previous value, until it reaches zero.

Additional reference words: 1.00 1.10 2.00 checkpage


PRA: Hang Importing .DBF Files Longer Than dBASE IV Max.

 Article Number: Q97521

 CREATED: 13-APR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

CodeBase++ version 1.07 allows you to create .DBF files

where the

record length exceeds the dBASE IV maximum record length.

Microsoft

Access may hang (stop responding) when trying to import this

type

of .DBF file.

RESOLUTION

Export the CodeBase++ .DBF file to delimited text, then

import the

ASCII file into Microsoft Access.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0. This problem was corrected in Microsoft Access

version 1.1.


INF: Sample DDE Macro Communicates with Microsoft Excel 4.0

 Article Number: Q97522

 CREATED: 13-APR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - Microsoft Excel for Windows, version 4.0

---------------------------------------------------------------------

SUMMARY

The text below demonstrates communication between two applications

through dynamic data exchange (DDE). Specifically, one example shows a

macro developed for Microsoft Excel version 4.0 for Windows that

starts Microsoft Access, loads a database and runs a macro. A second

example shows an Access Basic function that loads Microsoft Excel and

runs a macro.

MORE INFORMATION

Running a Microsoft Access Macro from Microsoft Excel

-----------------------------------------------------

Perform the following three steps to demonstrate this behavior. These

steps assume that a "MESSAGE" macro already exists in Microsoft

Access.

1. In Microsoft Excel, choose New from the File menu, select Macro

   Sheet and choose OK.

2. Enter the following macro into the macro sheet. Substitute the

   appropriate location for files on your computer.

      =EXEC("c:\access\msaccess.exe c:\access\db4.mdb")

      Chan=INITIATE("MSACCESS","system")

      =APP.ACTIVATE("Microsoft Access")

      =EXECUTE(Chan,"MESSAGE")

      =TERMINATE(Chan)

      =RETURN()

3. To run the macro, select the first cell, select Run from the Macro

   menu and choose OK.

The EXEC function in the macro loads Microsoft Access minimized and

loads the DB4.MDB database. The macro initiates a DDE channel and

assigns it to the variable Chan. The APP.ACTIVATE switches to the

Microsoft Access window to show the macro actions running.

The EXECUTE function runs a macro named "MESSAGE," as follows.

   Name Summary

   --------------------------------

   Application Name: "MSACCESS"

   Window Title: "Microsoft Access"

   Topic: "System"

   Item: "Message"

Running a Microsoft Excel Macro from Microsoft Access

-----------------------------------------------------

Perform the following two steps to demonstrate this behavior. These

steps assume that a macro named "Message" already exists in a

Microsoft Excel macro sheet named "MACRO1.XLM."

1. In Microsoft Access, create a new function that contains the

   following code. Substitute the appropriate location for files on

   your computer.

      Function CallExcel ()

         Dim Chan

         x = Shell("c:\excel\excel.exe c:\excel\macro1.xlm", 1)

         Chan = DDEInitiate("Excel", "System")

         DDEExecute Chan, "[Run(""macro1.xlm!Message"")]"

         DDETerminate Chan

      End Function

2. Create a new blank form and place a command button on it.

3. Select the button.

4. From the View menu, choose Properties.

5. Set the button's OnPush property to the following:

      = CallExcel()

   Note that the OnPush property is renamed OnClick in Microsoft Access

   version 2.0.

6. View the form in Form view.

7. Choose the command button to start the function.

The Shell function loads Microsoft Excel and the "MACRO1.XLM" macro

sheet full screen and leaves the focus on Microsoft Excel. The macro

initiates a DDE channel and assigns it to the variable Chan.

The EXECUTE function runs a macro named "Message."

   Name Summary

   -------------------------------------

   Application Name: "Excel"

   Window Title: "Microsoft Excel"

   Topic: "System"

   Item: "[Run(""macro1.xlm!Message"")]"

The syntax for these two macros demonstrates that the correct syntax

for the "Item" depends on the target application.

REFERENCES

==========

"Microsoft Excel Function Reference", version 4.0, pages 14 - 15

Additional reference words: 1.00 1.10 2.00


INF: Displaying Start, Finish, and Elapsed Times on a Form

 Article Number: Q97523

 CREATED: 13-APR-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article demonstrates how to create command buttons to enter start

and finish times on a form, and how to show elapsed time.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic," in version 2.0.

MORE INFORMATION

The following seven steps use macros and Access Basic code to display

start and finish times on a form:

1. Create a new module called Module 1. Create the appropriate

   declaration section and add the following function.

   NOTE: In the following sample code, an underscore (_) is used

   as a line continuation character. Remove the underscore when

   re-creating this code in Access Basic.

   '-----------------------------------------

   ' GLOBAL DECLARATION

   '-----------------------------------------

   Option Compare Database

   Option Explicit

   '=======================================================

   ' The following function calculates elapsed time.

   ' This function displays the total time elapsed in the

   ' following format:

   '    <hours>:<minutes>:<seconds>

   ' For example:

   '    48:57:04

   '=======================================================

   Function TimePassed (Startup, Done)

      TimePassed = Format(Int(Abs(Startup - Done) * 24), "###:") + _

                      Format(Abs(Startup - Done), "nn:ss")

   End Function

2. Create a macro to set the elapsed time, as follows.

      Macro Name               Action

      ----------------------------------

      Set Elapsed Time         Set Value

      Set Elapsed Time Actions

      -----------------------------------------------------

      Set Value

         Item: [Elapsed Time]

         Expression: TimePassed([Start Time],[Finish Time])

3. Create a macro to set the start and finish time, as follows.

     Macro Name     Condition                             Action

     --------------------------------------------------------------

     SetTime  IsNull(Forms![Time Form]![Start Time])      Set Value

              Not IsNull(Forms![Time Form]![Start Time])  Set Value

      SetTime Actions

      ----------------------

      Set Value

        Item: [Start Time]

         Expression: Now()

      Set Value

         Item: [Finish Time]

         Expression: Now()

4. Create a new blank, unbound form (do not select a table or query).

5. Add three text box controls to the form and assign them the

   following properties:

      Object: Text Box

      -----------------------

      ControlName: Start Time

         Enabled: No

         Locked: Yes

      Object: Text Box

      ------------------------

      ControlName: Finish Time

         Enabled: No

         Locked: Yes

      Object: Text Box

      -------------------------

      ControlName: Elapsed Time

         Enabled: No

         Locked: Yes

6. Add three command button controls to the form, and assign them the

   following properties:

      Object: Command Button

      ----------------------

      ControlName: Begin

         Caption: Start

         OnPush: SetTime

      Object: Command Button

      ----------------------

      ControlName: Complete

         Caption: Finish

         OnPush: SetTime

      Object: Command Button

      ---------------------------

      ControlName: Time Elapsed

         Caption: Time Elapsed

         OnPush: Set Elapsed Time

   Save the form as Time Form.

7. Choose Form view to test the example as follows:

   a. Choose the Start button. The current date and time display in

      both the start time and finish time boxes.

   b. Choose the Start button again. While the start time should not

      change, the finish time will update to the current data and

      time.

   c. Choose the Finish button to set or reset the finish time.

   d. Choose the Time Elapsed button to display the elapsed time in

      days, hours, and minutes.

For additional information on calculating times, query on the following

words here in the Microsoft Knowledge Base:

   calculating and elapsed and time

REFERENCES

==========

Microsoft Access "Introduction to Programming," version 1.0, Chapter 3,

"Access Basic Essentials"

Additional reference words: 1.00 1.10 2.00


INF: Round or Truncate Values to Desired Number of Decimals

 Article Number: Q97524

 CREATED: 13-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The Format property of a control can round a number or currency field

to the desired number of decimal places. However, this does not change

the underlying data, which may contain additional digits that the

control does not display. If you add the values in this control, the

sum is based on the actual values and not the displayed values, which

can cause problem with perceived accuracy.

The text below presents four Access Basic functions that round or

truncate data to two decimal places so the displayed and formatted value

and the actual numeric or currency data are the same.

MORE INFORMATION

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access.

The functions are presented in two styles. The first style is

appropriate for the AfterUpdate property of a form control, to ensure

that the data entered matches the data displayed. The second style is

for use in expressions and calculated controls.

To round or truncate numbers to two decimal places, create a new

module in Microsoft Access, create an appropriate declaration section,

and add the following functions.

   '******************************************************

   'Declarations section of the module

   '******************************************************

   Option Explicit

   Const Factor = 100

   '=====================================================

   ' RoundAU and TruncAU are designed to be added to the

   ' AfterUpdate property on a form control.

   '=====================================================

   Function RoundAU (X, Places)

      RoundAU = Int(X * (10 ^ Places) + .5) / (10 ^ Places)

   End Function

   Function TruncAU(X)

      X = Int(X * Factor) / Factor

   End Function

   '=====================================================

   ' RoundCC and TruncCC are designed to be used in

   ' expressions and calculated controls on forms and reports.

   '=====================================================

   Function RoundCC(X)

      RoundCC = Int (X * Factor + 0.5) / Factor

   End Function

   Function TruncCC(X)

      TruncCC = Int (X * Factor) / Factor

   End Function

Examples of Using the Round and Truncate Functions

--------------------------------------------------

The following examples use the NWIND.MDB sample database provided with

Microsoft Access.

 - Add the TruncAU function to the AfterUpdate property of the Unit

   Price field in the Products form, as follows.

      Form: Products

      --------------

      ControlName: Unit Price

         AfterUpdate: =TruncAU([Unit Price])

   If the user accidentally enters $23.055 instead of $23.05, the

   TruncAu function catches the mistake and changes the value to

   $23.05. Instead, if you install RoundAu, the function changes the

   value to $23.06. If you use neither function, the value displays as

   $23.06 but the entered value, $23.055, is used in calculations.

 - Add TruncCC or RoundCC to expressions in a report or a SetValue

   macro action. The following example demonstrates using RoundCC in a

   report footer.

      Report: Summary of Sales By Year

      --------------------------------

      ControlName: Total Sales for Quarter

         ControlSource: =Sum(RoundCC([Order Amount]))

      ControlName: Total Sales for Year

         ControlSource: =Sum(RoundCC([Order Amount]))

   If you use RoundCC, the report sums the values displayed in the

   report, even though the actual values may contain hidden digits.

NOTE: To change the number of decimal places used, change the value of

the global constant, Factor, as follows:

      10 = 1 decimal place

     100 = 2 decimal places

    1000 = 3 decimal places, etc.

Limitations

-----------

These functions should only be used with Currency data. If used with Double

or Single numbers, you can still get minor round-off errors. The reason for

this is that Single and Double numbers are floating point. They cannot

store an exact binary representation of decimal fractions. Therefore there

will always be some error. However, Currency values are scaled integers and

can store an exact binary representation of fractions to 4 decimal places.

Additional reference words: 1.00 1.10 2.00 int trunc precision


PRB: UndoCurrentRecord In BeforeUpdate Property Causes Error

 Article Number: Q97525

 CREATED: 13-APR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTONS

========

If you create a macro that contains a DoMenuItem action that chooses

Undo Current Record from the Edit menu, and you run the macro from a

form's BeforeUpdate property, Microsoft Access generates the following

message when you edit data in the form:

   Command not available: UndoCurrentRecord.

However, if you select the Edit menu, Undo Current Record is available

and works properly.

CAUSE

The Undo Current Record command is not available for use with a macro

run from a form's BeforeUpdate property.

RESOLUTION

In your macro, enter CancelEvent as the first action, then follow that with

the SendKeys action to send an ESC key. (This has the same effect as

choosing the Undo Current Field command from the Edit menu.)

MORE INFORMATION

Page 48 of the Microsoft Access "Language Reference," versions 1.0 and 1.1,

discusses uses for this type of macro in the BeforeUpdate property, and

indicates that calling Undo Current Record works correctly in such a macro.

This is not the case. Calling Undo Current Record causes the error message

above and should not be used.

REFERENCES

==========

Microsoft Access "Language Reference," versions 1.0 and 1.1, "BeforeUpdate,

AfterUpdate Properties," pages 47-48

Additional reference words: 1.00 1.10 2.00 errmsg docerr


PRB: "Circular Reference Caused by Alias" Error Message

 Article Number: Q97526

 CREATED: 13-APR-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

An attempt to run a query fails and Microsoft Access displays the

following message:

   Circular reference caused by alias 'field name' in query

   definition's SELECT list.

CAUSE

The alias, or label, of a calculated field cannot be identical to

any of the field names used to calculate the field.

RESOLUTION

Change the name of the calculated field or let Microsoft Access

automatically assign a name for the field.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the NWIND.MDB sample database.

2. In the Database window, choose the Query button, then choose New. A

   query design screen appears, with a dialog box that prompts for a

   Table or Query to add to the query.

3. Select Catalog, then choose the Add button.

4. Choose the Close button to close the Add Table dialog window.

5. In the first field of the Query design grid, enter the following:

      unit price: [unit price]/100

6. From the Query menu choose Run. The following error occurs:

      Circular reference caused by alias 'unit price' in query

      definition's SELECT list.

7. You can change the alias or label to resolve the error. For example,

   replace the unit price field name with the following:

      price: [unit price]/100

REFERENCES

==========

For more information on the error, search for "error messages: reference"

then search for the specific error message using the Microsoft Access Help

menu.

For more information on renaming fields in queries, search for "queries:

renaming fields" then "Renaming a Field in a Query" using the Microsoft

Access Help menu.

Additional reference words: 1.00 1.10 2.00 errmsg


PRA: Microsoft Access Ignores Paradox Private Directory Rules

 Article Number: Q97527

 CREATED: 13-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Microsoft Access ignores Paradox private directory restrictions and

allows you to examine and modify data in tables in them. Paradox,

however, ignores any changes made by Microsoft Access, since it

assumes the directories to be private.

RESOLUTION

If the directory or directories in question are set as working

directories, they work correctly.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1, and 2.0. We are researching this problem and will post new

information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Paradox version 3.5 allows you to specify directories as "private

directories" (Paradox Menu: Tools/Net/SetPrivate). Private directories

are used to hold Answer tables and the results of queries, as well as

other types of data, and cannot be examined or changed by other users.

If another Paradox user attempts to do so, he or she receives the

error message, "This is a private directory, you are not allowed

access."

Additional reference words: 1.00 1.10 2.00


PRA: Fast Search on Indexed Paradox Column Fails

 Article Number: Q97528

 CREATED: 13-APR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

A Fast Search on an indexed Paradox column fails, even when

there

is data to match the search criteria.

CAUSE

This problem occurs when a Paradox column (field) name has

the same

name as the Paradox table it is contained in.

In Paradox, the primary index is always stored in a table

named

<TABLENAME>.PX, and secondary indexes are stored in tables

named

<COLUMNNAME>.NXX. For example, with a table named "Authors"

that

contains fields named "Authors", "Books", and "Publisher",

the

primary index file is named AUTHORS.PX, and the secondary

indexes

are named BOOKS.N01, PUBLISHER.N02, AUTHORS.N03.

When Microsoft Access performs a Fast Search, it ignores the

file

extensions for these indexes. As a result, if a column name

is the

same as a table name, Microsoft Access sees two indexes with

the

same name and assumes it to be a single multicolumn index

instead

of two separate single-column indexes. This results in

strange

behavior, such as not getting the results you would expect

from a

search or query.

RESOLUTION

Be sure that the field names in the Paradox table differ

from the

table name.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0. This problem was corrected in Microsoft Access

version 1.1.


PRA: GPF Using OpenForm Action to Hide Modal Pop- Up Form

 Article Number: Q97529

 CREATED: 13-APR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

Using the OpenForm action to hide a modal pop-up form may

cause a general

protection (GP) fault in Microsoft Access.

RESOLUTION

Instead of using the OpenForm action to hide a modal pop-up

form, use

the SetValue action to set the form's Visible property to

False.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access version

1.0. This problem no longer occurs in Microsoft Access

version 1.1.

Additional reference words: 1.00 WinIss macros gpf


PRA: GP Fault When RunningSum Tries to Evaluate #ERROR

 Article Number: Q97530

 CREATED: 13-APR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

If a report contains a control whose expression evaluates to

a #ERROR

message, changing the RunningSum property to Over Group or

Over All

causes a general protection (GP) fault.

CAUSE

This problem commonly occurs if you place the Sum() function

in a text

box that appears in the Page Footer section of your report.

Aggregate

functions, like Sum(), Count(), Avg(), and so forth, are not

supported

in page headers and footers and return a #ERROR message if

placed

there. Adding the RunningSum property to a control using the

aggregate

of the Sum() function causes the above GP fault, as does

adding the

RunningSum property to any control that returns a #ERROR

message.

RESOLUTION

Either correct the expression in the ControlSource property

so that

it evaluates correctly, or move the location of the control

on the

report form.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0. This problem was corrected in Microsoft Access

version

1.1.

REFERENCES


PRB: "Internal Database Error (-5001)" Msg Using Btrieve NLM

 Article Number: Q97531

 CREATED: 13-APR-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You receive the following error message when you are using the Btrieve

Network Loadable Module (NLM) with Microsoft Access:

   Internal Database Error (-5001)

NOTE: You might also encounter an "Unexpected Error from External Database

Driver [1017]" error message if you are missing the WBTRVRES.DLL file.

CAUSE

You do not have correct versions of the BREQUEST.EXE, WBTRCALL.DLL,

and WBTRVRES.DLL files. In order for the Btrieve NLM to function

properly with Microsoft Access, Microsoft recommends that the NLM

requester (client) use BREQUEST.EXE, WBTRCALL.DLL, WBTRVRES.DLL

version 6.0, and BTRIEVE.NLM version 5.15.

RESOLUTION

Use the following procedure to obtain the correct versions of these

Btrieve files:

1. Sign on to CompuServe.

2. At the exclamation point (!) prompt, type "go novlib" (without the

   quotation marks).

3. Choose the BTRIEVE/XQL library section.

4. Download the BT515.EXE file and place it in an empty directory.

   Then unzip the file by running BT515.EXE. BT515.EXE is a

   self-extracting zip file and will extract several files and place

   them in directories.

5. After the files are extracted, follow the instructions in the

   BT515.TXT file to properly install these files and for information

   on how to apply patches to the BTRIEVE.NLM file on your server.

6. Add the following lines to your WIN.INI file:

      [BREQUESTDPMI]

      datalength=4096

      tasks=10

      local=no

      chkparms=no

MORE INFORMATION

Btrieve and the Btrieve NLM are manufactured by Novell, Inc., a

company independent of Microsoft; we make no warranty, implied or

otherwise, regarding these products' performance or reliability.

Additional reference words: 1.00 1.10 2.00 errmsg unpack unzip buglist


PRA: GPF Using Empty String with CVDate() or IsDate()

 Article Number: Q97532

 CREATED: 13-APR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SYMPTOMS

If either the CVDate() or IsDate() function is called with an empty

string as the expression, such as CVDate(""), Microsoft

Access

causes a general protection (GP) fault.

RESOLUTION

Verify that you are passing valid date strings in the argument to

CVDate() or IsDate().

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

version 1.0. This problem was corrected in Microsoft Access

version 1.1.

MORE INFORMATION

The CVDate() function converts strings or numeric expressions to a

variant of data type date. The IsDate() function returns a value

indicating whether or not a variant argument can be converted to a

date.

Additional reference words: 1.00 WinIss


PRA: GPF Declaring New Object Variable During Break Mode

 Article Number: Q97533

 CREATED: 13-APR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SYMPTOMS

When you declare a new object variable such as a form or table while your

code is in break mode (when you are debugging your Access Basic code) and

then recompile the code, a general protection (GP) fault occurs. The

following are examples of object variable declarations:

   Dim F as Form

   Dim T as Table

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version

1.0. This problem was corrected in Microsoft Access version 1.1.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. In a new or existing module, enter the following sample function:

      Function GP_Fault()

         z=Forms!Form!X

      End Function

2. Save and then close the module.

3. Create a new form. In the form's OnOpen property, enter:

      =GP_Fault()

4. Save and then close the form.

5. Open the form in Form view. You will receive the error message

   "Invalid reference to form 'Form'". Choose OK.

6. The module will open and the line "z=Forms!Form!X" will be selected.

   Add the following lines below the selected line:

      Dim T as Form

      Set T = Forms![GPF]

7. From the Run menu, choose Compile All.

8. Save and then close the module. When prompted to reset the halted

   code, choose OK.

Additional reference words: 1.00 WinIss


PRB: Access Basic Does Not Support Yes and No Action Arguments

 Article Number: Q97622

 CREATED: 15-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you use the DoCmd statement in Access Basic, Microsoft Access

does not recognize a Yes or No argument.

RESOLUTION

Use True for the argument instead of Yes, and use False instead of

No. True and False are reserved words in Access Basic.

STATUS

This behavior is by design.

MORE INFORMATION

Even though macro actions accept the Yes or No action argument, Access

Basic recognizes only True or False. However, the No argument will

actually work because Microsoft Access does not recognize No.

Therefore, a zero value is returned, which is interpreted as False.

However, a Yes argument will also return a zero value, or False.

Whether you use Yes or No, the argument will always be interpreted as

False.

Steps to Reproduce Behavior

---------------------------

1. Create the following module:

   '************************************************************

   'Declarations Section of the module.

   '************************************************************

   Option Compare database

   'Do not include the Option Explicit or you will receive an error

   'message stating that you did not declare your variable "no".

   'This is because Access Basic does not recognize "no" as a

   'reserved word.

   '=============================================================

   'The following function will run a macro action that will turn

   'warnings off, then attempt to turn them back on.

   '==============================================================

   Sub SetWarnings()

      DoCmd SetWarnings No     'Turn warnings off

      DoCmd SetWarnings Yes    'Turn warnings on

   End Sub

2. Run the sub procedure from the Immediate window by typing the

   following in the window and pressing ENTER:

      SetWarnings

3. Try to delete a form, report, or table. Note that you did not

   receive any warnings. The sub procedure turned off the warnings,

   but did not recognize the Yes argument, so it did not turn them

   back on.

4. Change the sub procedure to:

      Sub SetWarnings()

         DoCmd SetWarnings No

         DoCmd SetWarnings True

      End Sub

5. Run the sub procedure from the Immediate window again.

6. Try to delete a form, report, or table. Note that you will receive

   a warning. The sub procedure recognized the True argument and

   turned the warnings back on.

Additional reference words: 1.00 1.10 2.00 warnings


PRB: Cannot Edit Access Data Using Query with Attached dBASE

 Article Number: Q97623

 CREATED: 15-APR-1993

 MODIFIED: 03-AUG-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You are unable to edit fields in a Microsoft Access table through a

query that joins an attached dBASE table to the Microsoft Access

table. The query joins the tables on a key field in the Microsoft

Access table.

CAUSE

Since relationships can't be created with attached tables using the

Edit Relationship dialog box, joins must be performed manually in

the QBE grid. When a join is created between an attached dBASE

table and a Microsoft Access table on the Primary key field,

Microsoft Access assumes the type of relationship is one-to-many

with the Microsoft Access table representing the "one" side. You

cannot edit fields that come from the "one" side of a one-to-many

relationship.

RESOLUTION

Establish a main/subform setup with the subform based on the

attached dBASE table and the main form based on the Microsoft

Access table. You will be able to edit data from both tables

through their respective forms.

MORE INFORMATION

Even if the data in the dBASE table actually has a one-to-one

relationship with the Microsoft Access table, you will not be able to

edit fields from the Microsoft Access table using a query joining

these tables. If you create a single form based on this query, and set

the form's AllowUpdating property to Any Tables, you will not be able

to edit data in the Microsoft Access table.

Additional reference words: 1.00 1.10 mainform allow updating


INF: How to Synchronize Two Combo Boxes on a Form

 Article Number: Q97624

 CREATED: 15-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to create two combo boxes so that making a

selection in the first combo box limits the list of available items in

the second combo box.

MORE INFORMATION

The following example uses the sample database NWIND.MDB. The first combo

box will list the available product categories, and the second combo box

will list the available products for the category selected in the first

combo box:

1. Create a new, unbound form with the following combo boxes, and then

   save the form as Categories And Products.

      Combo Box 1

      -------------------------------

      ControlName:   Categories

      RowSourceType: Table/Query

      RowSource:     Categories

      ColumnCount:   1

      BoundColumn:   1

      After Update:  Refresh Products

      Combo Box 2

      -----------------------------------

      ControlName:   Products

      RowSourceType: Table/Query

      RowSource:     Category Combo Query

      ColumnCount:   2

      ColumnWidth:   0

      BoundColumn:   1

2. Create the following new query based on the Products table, and then

   save the query as Category Combo Query:

      Query: Category Combo Query

      ---------------------------------------------------------

      Table: Products

      Type: Select Query

      Field: Product ID

         Sort: Ascending

         Show: Yes

      Field: Product Name

         Table: Products

         Show: Yes

      Field: Category ID

         Show: No

         Criteria: Forms![Categories and Products]![Categories]

3. Create the following new macro, and then save it as Refresh Products:

      Requery

         ControlName: Products

4. View the Categories And Products form in Form view. When you select

   a category in the first combo box, the second combo box will be

   updated to list only the available products for the selected

   category.

Notes

-----

In the above example, the second combo box is filled with the results of

the Category Combo Query query. This query finds all the products that

have a Category ID that matches the category selected in the first combo

box.

Whenever a category is selected in the first combo box, the AfterUpdate

property runs the Refresh Products macro, which forces the second combo

box to run the Category Combo Query query again. This refreshes the list

of available products in the second combo box. Without this macro, you

would have to force the second combo box to refresh itself by pressing

the F9 key.

Additional reference words: 1.00 1.10 2.00


PRA: Cue Cards Cannot Be Started from Workstation

 Article Number: Q97625

 CREATED: 15-APR-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you try to run Cue Cards from a workstation set up for a network

installation of Microsoft Access, you receive the following error

message:

   Cue Cards Couldn't Be Started Because of Incomplete Setup.

CAUSE

Microsoft Access has been set up to run from a network drive and the

path used to execute MSACCESS.EXE uses the universal naming convention

(UNC).

RESOLUTION

For Cue Cards to run on a workstation, the path used to execute

MSACCESS.EXE from Program Manager must use the complete conventional

path, including the drive letter. To correct this problem, use the

following steps:

1. In Program Manager, select the Microsoft Access icon.

2. From Program Manager's File menu, choose Properties.

3. In the Command Line text box, type the complete path, including the

   drive letter for MSACCESS.EXE (for example, F:\ACCESS\MSACCESS.EXE).

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10 cuecards errmsg


INF: How to Determine Number of Working Days Between Two Dates

 Article Number: Q97757

 CREATED: 20-APR-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article explains how to calculate the number of working days

between two dates.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

MORE INFORMATION

There is no function in Microsoft Access to determine the number of working

days between two given dates. To determine this, you need to call a user-

defined Access Basic function. Note that the function below includes the

start date and the end date, so the number of days between 02/02/93 and

02/03/93 equals one. The code for the sample function Work_Days() is below.

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   Option Explicit

   Function Work_Days (BegDate As Variant, EndDate As Variant) As Integer

   ' Note that this function does not account for holidays.

      Dim WholeWeeks As Variant

      Dim DateCnt As Variant

      Dim EndDays As Integer

      BegDate = DateValue(BegDate)

      EndDate = DateValue(EndDate)

      WholeWeeks = DateDiff("w", BegDate, EndDate)

      DateCnt = DateAdd("ww", WholeWeeks, BegDate)

      EndDays = 0

      Do While DateCnt < EndDate

         If Format(DateCnt, "ddd") <> "Sun" And _

                          Format(DateCnt, "ddd") <> "Sat" Then

            EndDays = EndDays + 1

         End If

         DateCnt = DateAdd("d", 1, DateCnt)

      Loop

      Work_Days = WholeWeeks * 5 + EndDays

   End Function

To call the function, you can pass either a valid string or an actual

date value. The following are two ways to call this function from the

Immediate window:

   ?Work_Days("01/01/93", "12/31/96") (returns 1043)

   ?Work_Days(#03/05/93#, #04/06/93#) (returns 23)

Additional reference words: 1.00 1.10 2.00 modules Day/Time


INF: Access Workstation Setup (/N) Instructions Are Confusing

 Article Number: Q97771

 CREATED: 21-APR-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

When you set up Microsoft Access to run from a network server, the on-

screen instructions are misleading. This article explains which files are

copied to your hard disk (or user directory) when you choose to run

Microsoft Access from the network server.

MORE INFORMATION

The SETUP /N command for installing Microsoft Access on a workstation

displays the following question:

   Do you want to install Microsoft Access on your hard disk?

To run from the network server instead of your local hard disk drive,

choose No. If you do so, Setup then presents the following message:

   Setup will install Microsoft Access in the following directory,

   which will be created if it doesn't already exist.

This is confusing because it implies that a full copy of Microsoft

Access will be installed on you local hard disk drive. This is not the

case. Only the following files will be copied:

In the ACCESS directory:

   DETCMD.DLL

   SETUP.INI

   STFSETUP.EXE

   STFSETUP.INF

   SYSTEM.MDA  <- Only if a workgroup is not joined

In the Windows directory:

   MSACCESS.INI

   WINHELP.EXE  <- If not Windows v3.1 or above

   WINHELP.HLP  <- If not Windows v3.1 or above

   WINHELP.INI  <- If not Windows v3.1 or above

In the WINDOWS\SYSTEM directory:

   CTL3D.DLL

   COMMDLG.DLL  <- If not Windows v3.1 or above

   DDEML.DLL    <- If not Windows v3.1 or above

   OLECLI.DLL   <- If not Windows v3.1 or above

   OLESRV.DLL   <- If not Windows v3.1 or above

   SHELL.DLL    <- If not Windows v3.1 or above

   VER.DLL      <- If not Windows v3.1 or above

These are the necessary files for running Microsoft Access from the

network.


PRB: Unable to Use Hexadecimal or Octal Values in Properties

 Article Number: Q97772

 CREATED: 21-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You cannot use hexadecimal or octal values referenced as &Hxxxx (for

hexadecimal numbers) or &Oxxxx (for octal numbers) in the properties

of a control.

CAUSE

Most control properties expect either a string expression or a decimal

number.

RESOLUTION

Use decimal numbers rather than hexadecimal or octal numbers.

To determine the decimal equivalent of a hexadecimal or octal number,

enter that number in the BorderColor property of a control (first

write down the original value of the property so that you can easily

restore it). Microsoft Access converts hexadecimal and octal numbers

(&H or &O format) entered in the color properties of a control to

decimal numbers.

MORE INFORMATION

If you enter a hexadecimal or octal number in a control property that

expects a string expression (for example, ValidationRule), Microsoft

Access converts what you entered to a literal string.

If you enter a hexadecimal or octal number in a control property that

expects a number with the Long Integer data type (for example,

BackColor), Microsoft Access converts what you entered to a decimal

number.

The following steps demonstrate how this applies to parameters that

you may want to pass in a function.

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Open the Add Products form in Design view.

3. Select the Product ID text box.

4. From the View menu, choose Properties.

5. In the property sheet, enter the following sample function in the

   ValidationRule field:

      =mytest(&HFF)

   Microsoft Access converts this expression to:

      =mytest("&HFF")

Additional reference words: 1.00 1.10 2.00 hex oct


PRB: Export Table to Other Database Type Does Not Create Index

 Article Number: Q97773

 CREATED: 21-APR-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you export a Microsoft Access table with a primary key field to any of

the supported database formats, an index is not created. Also, if you

import a supported foreign database table having an index or primary key,

the resulting Microsoft Access table will not have a primary key defined.

CAUSE

The Microsoft Access import and export utility only imports and exports

data, not key or index definitions.

RESOLUTION

When you export a Microsoft Access table to an external database format,

you will need to use the native application for that file type to define

the index or key fields. Likewise, after a foreign database is imported to

your Microsoft Access database, you will need to open the table in Design

view and define the primary key field or fields.

STATUS

This behavior is by design.

MORE INFORMATION

The following database formats can be imported or exported by Microsoft

Access. After a table is exported from Microsoft Access, use the native

product for each file type to create your indexes or key fields.

   FoxPro 2.x

   Paradox 3.x

   Paradox 4.x (Microsoft Access version 2.0 only)

   dBASE III +

   dBASE IV

   Btrieve

   SQL Server

Additional reference words: 1.00 1.10 2.00


INF: Microsoft Graph Changes May Not Be Retained

 Article Number: Q97774

 CREATED: 21-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you create a graph on a form or report and later make some

changes to the formatting or to the data itself within Microsoft

Graph, these changes may not appear in the form or report.

This article discusses the different sources of information that Graph

normally uses and which sources take precedence over others in the

hierarchy of graph changes.

MORE INFORMATION

There are several sources of information for a graph: the Microsoft

Graph application, the contents of the graph object's RowSource

property, and the data in the underlying table or query.

Microsoft Access regenerates the graph each time you print or preview the

graph, or switch to Form view. When Microsoft Access regenerates the graph,

it reads the SQL statement in the object's RowSource property. The name of

the graph and the data to be graphed are obtained from this SQL statement.

Microsoft Access obtains the format of the data from the table or query

that is the source of the graph's SQL statement.

The precedence for changes is determined as follows:

 - Anything that you change in Microsoft Graph can be overwritten by

   the SQL statement in the graph's RowSource property or by the

   underlying data itself. (Examples of what you can change in Microsoft

   Graph include font, font size, font color, and the type of graph

   selected.)

 - Anything that you change in the SQL statement of the graph's

   RowSource property can be overwritten by the underlying data.

   (Examples of what you can change in the SQL statement include the

   title and labels.)

 - Anything that you change in the underlying data has precedence over

   other changes. (An example of what you can change in the underlying

   data is the actual format of the data. However, if the SQL statement

   contains a calculated field, such as =Format([Start Date],"MMM"), the

   format is determined by the result of this calculation, not by the

   underlying data.)

REFERENCES

==========

For more information on customizing the title, labels, and data in a

graph, query on "Graph and Format and Label" or "Graph and Title" here

in the Microsoft Knowledge Base.

Microsoft Graph "User's Guide," version 3.0, Chapter 3, "Working with

a Chart", pages 71-101

Additional reference words: 1.00 1.10 2.00 chart checkpage


PRB: Subform Layout Changes Not Saved

 Article Number: Q97775

 CREATED: 21-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you have a form that contains a subform, and the subform is displayed in

Datasheet view, modifications of the order or width of fields on the

subform do not show up on the main form.

CAUSE

The modified subform has not been read by the main form.

RESOLUTION

There are two methods of working around this problem. The first method is

to close the main form, and then open the subform from the Database window

in Design view. Make changes to the subform, then save and close the

subform. When you open the main form again, the modified subform will be

displayed.

The second method is to open the subform from the main form's Design view.

Make changes to the subform, then save and close the subform. Click once in

the subform control, and then press ENTER. The changes to the subform will

show when you switch to the main form's Form view.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. Open the Categories form in Form view.

3. Modify the subform by decreasing the width of the Product Name

   field.

4. Close the Categories form, and then open it again. Note that the changes

   to the subform do not appear.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.1, page 275

Additional reference words: 1.00 1.10 2.00 link checkpage


INF: Running a MS Access Macro from Visual Basic Using DDE

 Article Number: Q97776

 CREATED: 21-APR-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The following information provides some examples of how to use

Microsoft Visual Basic to run macros in Microsoft Access using

dynamic data exchange (DDE).

MORE INFORMATION

The following code demonstrates how to run a macro called "MyMacro" in

Microsoft Access from a Visual Basic application.

   Sub Command1_Click()

      'the character between MSACCESS and System is the pipe symbol

      Text1.LinkTopic = "MSACCESS|System"

      ' Establish a manual DDE link to Access

      Text1.LinkMode = 2

      ' Run the macro called "MyMacro"

      Text1.LinkExecute "MyMacro"

      ' Terminate the DDE link to Access

      Text1.LinkMode = 0

   End Sub

To use this code, create a new Visual Basic program with a text box

and a command button with the following properties:

   Text box

   --------

   Name: Text1

   Command Button

   --------------

   Name: Command1

Double-click the command button and enter the code example listed

above between the "Sub Command1_Click ()" and "End Sub" lines.

When you run this example, be sure that Microsoft Access is running

and that a database containing a macro called "MyMacro" is open. For

testing purposes, you may want to create a macro called "MyMacro" that

contains a single MsgBox action.

NOTE: While the above example uses the Microsoft Access system Topic

listed in the LinkTopic line, Microsoft Access is capable of executing

a macro with virtually every valid topic it supports. For a list of

topics that Microsoft Access supports, query on the following words

here in the Microsoft Knowledge Base:

   b_waccess and dde and server and topics

Additional reference words: 1.00 1.10 2.00


PRA: Multiple Users Adding Fields Causes Cross- Linking

 Article Number: Q97995

 CREATED: 28-APR-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

Incorrect data appears in tables when multiple users load

and modify

the same database within minutes of each other.

The steps below describe a typical scenario in which this

problem

occurs:

1. User1 opens a table in a database.

2. User2 opens the same database and makes a change to the

design of

   the table User1 has open.

3. Less than one minute later, User1 makes a change to the

design of

   the same table.

Either user may then notice data corruption in the table.

Corruption

problems may be apparent in one of the following three ways:

 - Data from one field in the table may be displayed in a

new field.

 - Data in a new or changed field may be displayed in a

second field.

 - Attempting to copy the table containing new or changed

fields

   generates an error message.

CAUSE

This problem, called cross-linking, occurs because

information about

tables in a database is read from the system tables and is

cached into

memory by Microsoft Access when a user opens a database. The

information in a user's cache may become obsolete if another

person

has just made a change and Microsoft Access does not read

the new

information before the first user makes changes. For

example, in the

situation above, User1 has cached the information for the

table, User2

makes a change, and then User1 makes a change before the

system tables

are reread. If this occurs, the table can become corrupted.

It is not necessary for both users to open or change the

same table

for corruption to occur. The information for the table

opened by User1

may be on the same page in the system table as the

information for the

table modified by User2. If that page is cached by Microsoft

Access,

table corruption may occur.

RESOLUTION

Information in the cache for tables not currently in use is

discarded

on a regular basis, so problems do not occur unless changes

are made

before Microsoft Access has had an opportunity to empty the

cache. To

ensure that information in the cache is emptied, wait a

minimum of one

to two minutes before opening the table in Design view.

If the database is corrupt, compacting the affected database

usually

corrects the problem. To do this, close all databases and

choose Compact

Database from the File menu.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access version

1.0. This problem no longer occurs in Microsoft Access

version 1.1.

environment

this

steps to

as


PRA: Password Is Case-Sensitive But Verification Is Not

 Article Number: Q98223

 CREATED: 02-MAY-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

When you change your password by choosing Password from the

Security

menu, the Verify text box is not case sensitive. However,

the Password

dialog box is case sensitive. The next time you start

Microsoft

Access, the password you type must exactly match the new

password you

entered previously.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0. This problem has been corrected in Microsoft

Access

version 1.1.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. From the Security menu, choose Change Password.

2. Type your old password, if you have one, or simply type a

new

   password in the New Password box. Use only uppercase

letters.

3. Type your new password in all lowercase letters in the

Verify box.

   Choose OK.

4. Quit Microsoft Access, then restart it.

5. Type your password in all lowercase letters. The

following error

   message appears:

      Not a valid account name or password.

6. Type your password in all uppercase letters. Note that

the error

   message no longer appears.

REFERENCES


PRB: Error Message "Couldn't Open Table MSysAccounts"

 Article Number: Q98224

 CREATED: 02-MAY-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You receive the following error message when attempting to start

Microsoft Access:

   Couldn't open Table 'MSysAccounts' in SYSTEM.MDA

CAUSE

The SystemDB entry in the [Options] section of your .INI file points to a

file other than a valid SYSTEM.MDA.

NOTE: In Microsoft Access version 1.x, the .INI file is named MSACCESS.INI.

In Microsoft Access version 2.0, the file is named MSACC20.INI.

RESOLUTION

Use the Change Workgroup Icon in the Microsoft Access Group to reset the

.INI file to the correct path for the SYSTEM.MDA file. Or, open the .INI

file using Notepad to correct the entry.

MORE INFORMATION

A correct entry in the .INI file looks like the following:

   [Options]

   SystemDB=C:\ACCESS\SYSTEM.MDA

In the sample line above, make sure to use the correct drive and path for

your Microsoft Access configuration.

Additional reference words: 1.00 1.10 2.00


INF: Use SendKeys Macro Action to Open Combo Box Automatically

 Article Number: Q98225

 CREATED: 02-MAY-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you are entering a large amount of data and want to open a combo

box, it is inconvenient to have to press additional keys or stop to

use the mouse. This article presents a generic macro that opens a

combo box when you set the focus on the control by pressing the

TAB key.

MORE INFORMATION

A macro with a single action, SendKeys, is shown below. You can use

this macro for all combo boxes on your form.

1. Create a macro called Open Combo Box, as follows:

      Macro: Open Combo Box

      ----------------------

      Action: SendKeys

         Keystrokes: %{DOWN}

         Wait: Yes

2. Open your form in Design view.

3. Add the above macro to the OnEnter property of your combo box.

To manually open the combo box, type ALT+DOWN ARROW.

REFERENCES

==========

For more information on automatically sending keystrokes, search for

"SendKeys" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 SendKeys combo box


PRB: Error Message "Macro '' Not Found"

 Article Number: Q98226

 CREATED: 02-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you are entering data using a form, you get the following

error message:

   Macro '' not found

CAUSE

This problem can be caused by one or more spaces having been inadvertently

typed in either the form's or a control's event properties, such as

OnCurrent or AfterUpdate.

RESOLUTION

Open the form in Design view and remove the space(s).

MORE INFORMATION

Microsoft Access version 1.x does not trim the macro name when trying to

find the macro, but does trim it when displaying the error message, so you

see two single quotation marks with no space separating them, which looks

like one double quotation mark.  Microsoft Access 2.0 will trim macro

names, but not if you type a single space.

You should be able to determine whether the space is located in a

control's event property or a form's event property based on what

actions trigger the message.

For example, the error occurs in one of the following situations:

1. Opening the form.

   - Check the Form's OnOpen or OnCurrent property.

   - Also check the OnLoad property of forms in Access 2.0.

   - Check the OnEnter property for the first control that receives the

     focus when the form is opened.

   - Also check the OnGotFocus property of controls in Access 2.0.

2. Typing in a control.

   - Check the control's BeforeUpdate or AfterUpdate property.

   - Also check the control's OnKeyDown, OnKeyPress, OnKeyUp, OnChange

     properties in Access 2.0.

3. Saving a record.

   - Check the form's BeforeUpdate or AfterUpdate property.

4. Moving to a new record.

   - Check the form's OnCurrent property (also see #3).

NOTE: this is not a complete list of causes.

Once you have determined which property is causing the problem, open

the form in Design view and remove the space from that property. If

you are still not sure which property is causing the problem, go to each

property that is blank and press the DEL key.

NOTE: You may have spaces in multiple properties so it is a good idea

to check them all.

Steps to Reproduce Behavior

--------------------------

This example uses the sample database NWIND.MDB:

1. Open the Employees form in Design view.

2. Display the property sheet by selecting Properties from the View

   menu.

3. Select the Last Name control and type a single space in the

   AfterUpdate property.

4. Change to Form view and type data in the Last Name control.

When you attempt to exit this field you will receive the error

message stated above.

Additional reference words: 1.00 1.10 2.00 space event


INF: Explanation of "Option Compare Database" Statement

 Article Number: Q98227

 CREATED: 02-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The description of the Option Compare Database statement in the Microsoft

Access "User's Guide" is not very clear. The following is the description

from the guide:

   Comparison is based on the characters' relative position according to

   the sort order specified when the database was created or compacted.

MORE INFORMATION

The Option Compare statement can be used to make comparisons based on

binary value, text value, or values that are defined in the Options dialog

box. (To modify the Options dialog box, choose Options from the View menu.)

For example, if you use the Option Compare Binary statement, the expression

"a" > "Z" would be true, because the ASCII value of "a" is greater than the

ASCII value of "Z". However, if you use the Option Compare Text statement,

the expression would be false, because "Z" comes after "a" in the alphabet.

If you use the Option Compare Database statement, the expression will be

true or false depending on the New Database Order setting you select in the

Items box of the Options dialog box.

The Option Compare statement can also affect the results of the Instr()

function. For example, the following function finds the first tab character

in a string:

   Function FindTab (mystr$)

      FindTab = InStr(1, mystr$, Chr(9))

   End Function

If mystr$="1<space>abc<tab>ABC", the InStr() function will return the

following results, depending on which Option Compare statement is used:

   Option Compare Database: 2

   Option Compare Text:     6

   Option Compare Binary:   6

For another example, the following function returns the position of the

first uppercase 'c' in the string:

   Function FindEm (mystr$)

      FindEm = InStr(1, mystr$, "C")

   End Function

If mystr$="1<space>abc<tab>ABC", the function will return the following

results, depending on which Option Compare statement is used:

   Option Compare Database: 5

   Option Compare Text:     5

   Option Compare Binary:   9

Additional reference words: 1.00 1.10 2.00 docbug checkpage


INF: Cannot Create Relationships with Attached Tables

 Article Number: Q98228

 CREATED: 02-MAY-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

You cannot create a relationship between a Microsoft Access table and an

attached table. Relationships can be created only between Microsoft Access

tables. Any joins involving attached tables must be created using the

graphical query by example (QBE) grid.

MORE INFORMATION

To establish a relationship between Microsoft Access tables, do the

following:

1. Open a Microsoft Access database. By default, the Database window

   has the focus.

2. From the Edit menu, choose Relationships.

3. Select a table from the Primary Table list box. Note that no

   attached tables appear on the list.

REFERENCES

==========

For more information, search for "relationships between tables", then

"Defining Relationships Between Tables" using the Microsoft Access

Help menu.

Additional reference words: 1.00 1.10 Tables ISAM


INF: How to Determine the View in Which a Form Is Displayed

 Article Number: Q98229

 CREATED: 02-MAY-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

There are no built-in functions or properties in Microsoft Access

to determine if a form is in Form view or Datasheet view. To do this,

you must call a series of Windows application programming interface

(API) functions.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

MORE INFORMATION

To determine the current view of a form, call the function listed

below and pass the form as an argument to the function. For example:

   X% = Is_FormView (Forms!Form)

If the form is in Form view, the returned value is a nonzero number.

If the form is in Datasheet view, zero is the returned value.

Notes:

 - In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

 - You may have some Microsoft Windows API functions defined in an existing

   Microsoft Access library; therefore, your declarations may be

   duplicates. If you receive a duplicate procedure name error message,

   remove or comment out the declarations statement in your code.

Option Explicit

Declare Function GetWindowWord% Lib "User" (ByVal hwnd%,_

                    ByVal nIndex%)

Declare Function GetWindow% Lib "User" (ByVal hwnd%, ByVal wCmd%)

Declare Function IsWindowVisible% Lib "User" (ByVal hwnd%)

Declare Function GetClassName% Lib "User" (ByVal hwnd%,_

                    ByVal lpClassname$, ByVal nMaxCount%)

Const GW_SiblingHwnd% = 2

Const GW_CHILD = 5

Function Is_FormView (F As Form)

   Dim SiblingHwnd%, CName$, CNameLen%

   'get the first child window of the specied form

   SiblingHwnd% = GetWindow(F.hwnd, GW_CHILD)

   'enumerate through the forms child windows until exhausted

   'or you find a visible sub-window with the classname of

   '"OFormSub".

   Do While SiblingHwnd%

      'allocate temporary space.

      CName$ = Space$(128)

      'get the class name of the specified window.

      CNameLen% = GetClassName(SiblingHwnd%, CName$, Len(CName$))

      'peel off the extra characters in the padded string.

      CName$ = Mid$(CName$, 1, CNameLen%)

      ' if the window is visible, and the classname is OFormSub

      ' then the form is either in Design view, or Form view and

      'not in Datasheet view.

      If IsWindowVisible(SiblingHwnd%) And CName$ = "OFormSub" Then

         Exit Do

      End If

      'get the next sibling window.

      SiblingHwnd% = GetWindow(SiblingHwnd%, GW_SiblingHwnd%)

   Loop

   Is_FormView = SiblingHwnd%

End Function

REFERENCES

==========

"Microsoft Windows 3.1 Programmer's Reference," Volume 2

Additional reference words: 1.00 1.10 2.00


INF: How to Query for Duplicate Records

 Article Number: Q98230

 CREATED: 02-MAY-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

When you import data from other databases, records may contain

duplicate information in the primary key fields. You can run a

make-table query to eliminate the duplicate data, but if key fields

for two or more records contain the same value, you may want to

reconcile the information manually to make the records unique.

This article includes sample queries and shows how to list duplicate

information for keys containing single fields or multiple fields.

MORE INFORMATION

Single-Field Keys

-----------------

Note that this example assumes you have a table called MyTable, with the

primary key on the Name field.

1. Open MyTable in Design view and index the Name field, as shown

   below:

      Table: MyTable

      -------------------------------

      Field: Name

         Indexed: Yes (Duplicates OK)

2. Create the following query based on MyTable:

      Query: Find Duplicates

      ----------------------

      Field: Name

         Total: Group By

      Field: Name

         Total: Count

         Criteria: >1

   The equivalent SQL statement is as follows:

      SELECT DISTINCTROW

         Name, Count(Name) As CountOfName

      FROM

         MyTable

      GROUP BY

         Name

      HAVING

         Count(Name)>1

      WITH OWNERACCESS OPTION;

3. Run the query. Duplicate key values are displayed in the first

   column and the number of times the value appears is displayed in

   the second column.

Multiple-Field Keys

-------------------

This example assumes you have a table called MyTable, with a double

primary key on the First Name and Last Name fields.

1. Open MyTable in Design view and index the First Name and Last Name

   fields, as shown below:

      Table: MyTable

      -------------------------------

      Field: First Name

         Indexed: Yes (Duplicates OK)

      Field: Last Name

         Indexed: Yes (Duplicates OK)

2. Create the following query based on MyTable:

      Query: Find Duplicates

      ----------------------

      Field: Last Name

         Total: Group By

      Field: First Name

         Total: Group By

      Field: First Name

         Total: Count

         Criteria: >1

   The equivalent SQL statement is as follows:

      SELECT DISTINCTROW

         [Last Name], [First Name],

         Count([First Name]) As [CountOfFirst Name]

      FROM

         MyTable

      GROUP BY

         [Last Name], [First Name]

      HAVING

         Count([First Name])>1

      WITH OWNERACCESS OPTION;

3. Run the query. Duplicate key values are displayed in the first two

   columns and the number of times the value appears is displayed in

   the third column.

REFERENCES


PRB: Empty Row in List Box Can Be Selected

 Article Number: Q98298

 CREATED: 02-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

An empty or null row of a list box can be selected.

CAUSE

Null is a valid selection in Microsoft Access.

STATUS

This behavior is by design.

MORE INFORMATION

It is also possible to select an empty or null value in a combo box.

Steps to Reproduce Behavior

---------------------------

1. Create a new form.

2. Create a list box on the form with the following properties:

      Object: list box

      ----------------

      RowSourceType: Value List

      RowSource: 1;2;;4

3. From the View menu, choose Form.

You can select the empty row between 2 and 4.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 9, "Designing

Forms" pages 233-243

Additional reference words: 1.00 1.10 2.00 checkpage


PRB: Empty Subforms Are Not Visible in Print Preview

 Article Number: Q98299

 CREATED: 02-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you preview a form containing a subform, the subform area is

completely blank; however, the subform control does appear in the

Design view of the main form.

CAUSE

If you have a subform that does not have any data in it, the subform

appears in Form view with the structure only. However, no part of the

subform is visible in Print Preview.

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10 2.00


INF: Determining Which User You Are Logged

 Article Number: Q98300

 CREATED: 02-MAY-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

There are two quick ways to determine the account (user) under which you

are logged in:

 - In the Database window, select Change Password from the Security

   menu. In the Change Password dialog box, Microsoft Access displays

   the account name.

 - Call the User() function from Access Basic. To do this, open any

   module, type the following in the Immediate window, and then press

   ENTER:

      ? User()

   The user name will be displayed in the Immediate window.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 25, "Administering

a Database System"

Microsoft Access "Language Reference," version 1.0, page 489, "User()


PRA: Syntax Error When "(" Is First Character in Criteria Cell

 Article Number: Q98301

 CREATED: 02-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You receive the error message "Syntax error" when you try to execute a

query.

CAUSE

A opening parenthesis is the first character in a cell in the Criteria

row of the query grid.

RESOLUTION

Depending on the WHERE clause you are using, you can restructure the

query so that there is no opening parenthesis in the Criteria row. See

below in the "More Information" section for an example.

You also can enter the WHERE clause directly in the SQL dialog box. If

Microsoft Access places the opening parenthesis in the Criteria row,

the process is successful. However, the process works only until you

make a change to the query. For example, if you remove a column from

the query grid, even if it is unrelated to the criteria, the error

message is displayed.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

You may want an opening parenthesis in a Criteria cell if you are

searching a Text or Memo field for several key words. For example, you

may want to use a WHERE clause similar to the following:

   (Textcol Like "*performance*" Or Textcol Like "*speed*") And

   (Textcol Like *start*" Or Textcol Like "*run*")

You can enter the WHERE clause either in a single cell in the Criteria

row or as multiple rows in the Criteria section of the query grid.

Place the Textcol column on the grid twice. In one or both instances

of the column, the Show box may be cleared. The Criteria section of

the grid should appear as follows:

          Textcol                 Textcol

          ---------------------   -----------------------------

Criteria: Like "*performance*"    Like "*start" Or Like "*run*"

      or: Like "*speed*"          Like "*start" Or Like "*run*"

Steps to Reproduce Problem

--------------------------

1. Using the sample database NWIND.MDB, create a new query based on

   the Employees table.

2. Drag the Last Name and First Name fields from the table to the

   query grid.

3. In the Criteria cell under Last Name, type the following:

      (Like "*a*")

4. Press TAB to move to the next cell. The "Syntax error" message

   appears.

5. Choose OK. Note that the characters "*a*" are now highlighted.

Additional reference words: 1.00 1.10 errmsg parenthesis


INF: How to Create Synchronized Combo Boxes

 Article Number: Q98660

 CREATED: 11-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to create a combo box that is filtered to list

only items that are related to an item selected in a prior combo box.

MORE INFORMATION

In the following example, the first combo box lists the category names

from the Categories table, and the second combo box lists the product

names from the Products table. When you select a category name in the

first combo box, the second combo box is filtered to list only the

product names for that category:

1. Open the sample database NWIND.MDB.

2. Create the following new query based on the Categories table, and then

   save it as Categories Lister:

      Query: Categories Lister

      -------------------------

      Field name: Category ID

         Show: Yes

      Field name: Category Name

         Show: Yes

         Sort: Ascending

3. Create the following new query based on the Products table, and then

   save it as Products Lister:

   NOTE: In the following sample query, an underscore (_) is used as a

   line-continuation character. Remove the underscore when re-creating

   this query.

      Query: Products Lister

      -----------------------------------------------------------

      Field name: Product ID

         Show: Yes

      Field name: Product Name

         Show: Yes

         Sort: Ascending

      Field name: Category ID

         Show: Yes

         Sort: Ascending

         Criteria: IIF(IsNull([Forms]![Selector Form]![Category _

                   Selection]),[Category ID],[Forms]![Selector _

                   Form]![Category Selection])

   Note that using the IIf() and IsNull() functions in this query lets

   you see a list of all the products if no category is selected.

4. Create the following new macro, and then save it as Reset Product

   Selection:

      Macro Name                 Action        Argument

      ----------------------------------------------------------

      Reset Product Selection    Requery       Product Selection

                                 GoToControl   Product Selection

5. Create the following new unbound form, and then save it as Selector

   Form:

      Object: Combo Box

      ----------------------------------------

         ControlName: Category Selection

         RowSourceType: Table/Query

         RowSource: Categories Lister

         ColumnCount: 2

         ColumnWidths: 0 in;1 in

         BoundColumn: 1

         After Update: Reset Product Selection

      Object: Combo Box

      ---------------------------------

         ControlName: Product Selection

         RowSourceType: Table/Query

         RowSource: Products Lister

         ColumnCount: 3

         ColumnWidths: 0 in;1 in; 0 in

         BoundColumn: 1

6. View the form in Form view. In the Category Selection box, select

   a category and note that the Product Selection box lists only the

   products for that category.

7. In the Category Selection box, select a different category. Note that

   the Product Selection box is reset and lists the appropriate products

   for the new category.

REFERENCES

==========

For more information on requerying, search for "requery" then "Requery

Action" using the Microsoft Access Help menu.

Microsoft Access "User's Guide," version 1.0, pages 237 and 541

You can find information, instructions, and examples in the Solutions

sample application (SOLUTION.MDB) included with Microsoft Access version

2.0. For more information about how to list only items that are related to

an item selected in a prior combo box, open the SOLUTION.MDB database

usually located in the ACCESS\SAMPAPPS directory. Select Get More Mileage

From Combo Boxes, List Boxes, Subforms, And Subreports in the Select A

Category Of Examples box, then select Limit The Contents Of One List Based

On The Value Selected In Another in the Select An Example box.

Additional reference words: 1.00 1.10 2.00 combobox parameter listbox


PRB: Formatting Yes/No Data Type Example

 Article Number: Q98662

 CREATED: 11-MAY-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If you type a format string in the Format property of a text box whose

control source is a Yes/No data type, the format string will appear in

the text box instead of the expected data when you view the form in Form

view.

CAUSE

The format string for the text box is incorrect. This can occur if

you follow the illustration on page 219 of Microsoft Access "Language

Reference." The illustration reads:

   ";Always [Blue];Never [Red]"

RESOLUTION

The illustration on page 219 should read:

   ;"Always" [Blue];"Never" [Red]

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, page 219


INF: Deleting Duplicate Records from Two Tables

 Article Number: Q98664

 CREATED: 11-MAY-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to delete duplicate records from two tables

and retain the most current information (records). In addition, the

article shows how to merge the results of these two tables.

MORE INFORMATION

This article walks you through creating two tables, TEST-1 and TEST-2,

with duplicate records. After adding additional nonduplicate records

to both these tables, you will delete the duplicate records from the

TEST-2 table. Finally, you will update the TEST-1 table to include

nonduplicate information from the TEST-2 table.

Steps to Reproduce Behavior

---------------------------

 1. Open the sample database NWIND.MDB.

 2. In the Database window, select the Shippers table.

 3. From the Edit menu, choose Copy.

 4. From the Edit menu, choose Paste.

 5. In the Paste Table As dialog box, type "TEST-1" (without quotation

    marks) in the Table Name field. Choose OK.

 6. Repeat steps 4 and 5, this time pasting the table as TEST-2.

 7. Open the TEST-1 table and add the following two additional company

    names:

       ABC Shipping

       XYZ Express

    Close the TEST-1 table.

 8. Open the TEST-2 table and add the following two new company names:

       Jiffy Ship

       Hurry Package

    Close the TEST-2 table.

 9. Create a new query based on the TEST-1 and TEST-2 tables.

10. In Microsoft Access version 1.x, join the tables on the Company Name

    field. In Microsoft Access version 2.0, remove the join between the

    Shipper ID fields, then join the tables on the Company Name field.

11. From the Query menu, choose Delete. For this example, the TEST-1 table

    will be considered the most current information; therefore, duplicate

    information will be deleted from the TEST-2 table.

12. From the TEST-1 table, drag Shipper ID and Company Name to the

    QBE grid. Note that the word "Where" appears on the Delete line

    in the QBE grid.

13. Drag the * from the TEST-2 table to the QBE grid. Note that the word

    "From" appears on the Delete line in the QBE grid.

14. From the Query menu, choose Run.

15. You will receive a message stating that three rows will be deleted.

    Choose OK.

16. Open the TEST-2 table. The only two records that remain are the

    nonduplicate records that you added in step 8 above. All the duplicate

    records have been deleted.

The remaining steps append the remaining nonduplicate records from the

TEST-2 table to the TEST-1 table.

17. Open the TEST-2 table.

18. From the Edit menu, choose Select All Records.

19. From the Edit menu, choose Copy.

20. Close the TEST-2 table and then open the TEST-1 table.

21. From the Edit menu, choose Paste Append. You will receive a message

    stating that two rows have been pasted into this table. Choose OK

    to complete the Paste Append.

Your most current information, without duplicates, is now in one table

(TEST-1).

Additional reference words: 1.00 1.10 2.00 queries unique union SQL


INF: Sorting Titles Without Leading Articles (The, An, etc.)

 Article Number: Q98665

 CREATED: 11-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article explains how to sort titles in text fields without

including the leading articles "the," "an," or "a."

MORE INFORMATION

The following is a list of book titles:

   Aztec Indians

   The Ant People

   Beast Man

   The Baseball Club

   An Attempt At Fun

   Apple Valley

If you sort the above list using a custom Microsoft Access function in

a query, the following new list results:

   The Ant People

   Apple Valley

   An Attempt At Fun

   Aztec Indians

   The Baseball Club

   Beast Man

Create the following Access Basic function that returns a book title

without the leading article:

     Option Explicit

     Function Gettitle (Titles) As String

         sp = InStr(1, Titles, Chr$(32))

         If sp > 0 Then

             Select Case Left(Titles, sp - 1)

                 Case "An", "A", "The"    ' add any other articles here!

                     Gettitle = Mid(Titles, sp + 1)

                 Case Else

                     Gettitle = Titles

             End Select

         Else

             Gettitle = Titles

         End If

     End Function

To sort a table on the Titles field, create a query with the following

two columns in the query grid:

   Query

   -----

   Field: Sorted List: Gettitle([Titles])

      Sort: Ascending

      Show: Yes

   Field: [Titles]

      Show: No

The first column is a calculated field that extracts the text of the

Titles field, but omits the leading article. The results of this

calculation are sorted in ascending order. The second Show check box

is cleared so that the query result is not displayed.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 276-277 and 404

Additional reference words: 1.00 1.10 2.00 titles sort


INF: "Form Is Read Only" Error Message

 Article Number: Q98666

 CREATED: 11-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The message "Form is read only" in Microsoft Access version 1.x or "This

Recordset is not updatable" in Microsoft Access version 2.0 is displayed

when you are trying to update data, but the form's DefaultEditing property

is not set to Read Only.

CAUSE

If your form is based on a query with a property set to Read Only, you

will not be able to modify data in the form.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new query based on the Order Details table in the sample

   database NWIND.MDB.

      Query: Orders

      -------------------------------------

      Type:  Select Query

      Join:  None

      Field: Quantity

         Total: Group By

      Field: Unit Price

         Total: Group By

      Field: Expr1: [Unit Price]*[Quantity]

         Total: Expression

2. Run the query, and then try to change the Unit Price in any record.

   The computer beeps, and the status bar displays "Form is read only."

You will get the same result when you try to update a form based on

this query. If you remove the Total line in the query grid you will be

able to modify the records.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.x, Chapter 6, "Designing Select

Queries"

Microsoft Access "User's Guide," version 2.0, Chapter 11, "Designing Select

Queries"

Additional reference words: 1.00 1.10 2.00


PRA: Calculated Control on Subreport Displays Wrong Data

 Article Number: Q98667

 CREATED: 11-MAY-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

A calculated control on your subreport shows incorrect data

for the

first record of alternate pages in the report.

RESOLUTION

Change the CanGrow or the LinkChild and LinkMaster

properties of the

calculated control so that either

 - The control's CanGrow property is not set to Yes

   -or-

 - The control's LinkChild and LinkMaster properties are not

blank

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access version

1.0. This problem no longer occurs in Microsoft Access

version 1.1.

MORE INFORMATION

This problem occurs only with non-linked subreports when the

calculated

control's CanGrow property is set to Yes. This is not a

problem with

linked subreports.

Steps to Reproduce Problem

--------------------------

The example below only works in Microsoft Access version

1.0. This

example uses the sample database NWIND.MDB:

1. Create a new report based on the Categories table. Add

all the

   fields from the Categories table to the report and leave

the report

   open in Design view.

2. Select the Category ID text box, and modify its

properties as follows:

      Object: text box

      --------------------------------

      ControlName: Category IDx

      ControlSource: =[Category ID]

      CanGrow: Yes

3. Save this report as Sub and then close it.

4. Create a new, unbound report. Drag the Sub report from

the Database

   window onto the new report. Save the new report as Main.

5. Preview the Main report. Note that the Category ID field

of the first

   record on the Sub report shows the wrong Category ID for

the record.


INF: How to Buffer SQL Strings Using DDE

 Article Number: Q98668

 CREATED: 11-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.1 and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access can handle SQL strings larger than 255 characters through

dynamic data exchange (DDE). To do this, break the SQL string into portions

with fewer than 255 characters, and then send these strings to Microsoft

Access using DDE. The separate portions are buffered until a semicolon is

sent; at that point, Microsoft Access executes the query.

MORE INFORMATION

The following steps demonstrate how to create a DDE macro in Microsoft

Excel for Windows:

1. Open the sample database NWIND.MDB.

2. Open a new macro sheet in Microsoft Excel. Enter the following

   macro:

      Cell    Command

      --------------------------------------------------

      B1      SQLDDEExample

      B2

      B3      chan=INITIATE("MSACCESS","nwind.mdb;SQL")

      B4      =POKE(chan,"SQLText",C3)

      B5      =POKE(chan,"SQLText",C4:C5)

      B6      QueryResult=REQUEST(chan,"All")

      B7      =TERMINATE(chan)

      B8      =FOR("FldPos",1,COLUMNS(QueryResult))

      B9      =FOR("RecPos",1,ROWS(QueryResult))

      B10     =FORMULA(INDEX(QueryResult,RecPos,FldPos),

                  OFFSET(C7,RecPos,FldPos))

      B11      =NEXT()

      B12      =NEXT()

      B13      =RETURN()

3. Enter the following pieces of the SQL string on the macro sheet:

      Cell     Command

      -------------------------------------------

      C3        SELECT * From categories

      C4         ORDER BY categories.[category id]

      C5         DESC;

   NOTE: Be sure to include one space in front of the words "ORDER"

   and "DESC" in the step above.

4. To run the macro, select cell B3, choose Run from the Macro menu,

   and choose OK. The query then executes.

The results of the query are placed in cells D8:G16 on the Microsoft

Excel macro sheet.

Additional reference words: 1.00 1.10 2.00 queries sql dde


PRB: Default Values of Attached Table Not Used

 Article Number: Q98669

 CREATED: 11-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you attach a table from another Microsoft Access database, the

default values in the attached table do not appear.

CAUSE

The default values in attached tables do not appear because Microsoft

Access does not read the properties of attached tables.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. In any Microsoft Access database, create a new table with a field with

   a data type of Number, and a default value of 5. Save the table as

   Table1.

2. Close the database, and open or create another database.

3. Attach Table1 to the current database.

4. Open Table1, and enter a few values. Note that the default value of 5

   does not appear.

REFERENCES

==========

Microsoft Access "User's Guide," pages 69-70

Additional reference words: 1.00 1.10 external come across


PRA: SQL 4-Byte Values Incorrectly Mapped to Text

 Article Number: Q98670

 CREATED: 11-MAY-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

When you try to edit data on an attached SQL table, you

receive

the following error message:

   ODBC Update Failed

CAUSE

When you attach an SQL table in Microsoft Access version

1.0, 4-byte value

fields are incorrectly mapped to the Text data type.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0. This problem no longer occurs in version 1.1.

MORE INFORMATION

In Microsoft Access version 1.1, 4-byte field data types are

mapped as

follows:

   SQL             ACCESS

   -------------------------

   4-byte Real     Number

   SmallMoney      Currency

   SmallDateTime   Date/Time

Additional reference words: 1.00


PRA: Setup Writes Over Newer CTL3D.DLL File

 Article Number: Q98671

 CREATED: 11-MAY-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

When installing Microsoft Access version 1.0, the file

CTL3D.DLL

may be replaced, even if you currently have a more recent

version of

the file.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0. This problem has been corrected in Microsoft

Access

version 1.1.

MORE INFORMATION

The CTL3D.DLL file provides the 3-D "look" for a Windows

application's

buttons. This file is normally stored in the WINDOWS\SYSTEM

subdirectory.


PRA: GP Fault when Creating a Dynaset from Form Dynaset

 Article Number: Q98672

 CREATED: 11-MAY-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

When attempting to create a dynaset based on a form's

dynaset, you

will get a general protection (GP) fault similar to:

   Application Error

   MSACCESS caused a General Protection Fault in module

   MSACCESS.EXE at 00B0:09B5

CAUSE

This functionality is unsupported. Instead of returning an

error

message explaining this, Microsoft Access causes a GP fault.

Microsoft Access does not support creating a dynaset based

on a

form's dynaset.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access version

1.0. This problem no longer occurs in Microsoft Access

version 1.1.

MORE INFORMATION

In Microsoft Access version 1.0, the following steps will

reproduce a

GP fault.

In Microsoft Access version 1.1, the following steps will

correctly

return the following error message, indicating that this

functionality

is not supported:

   Can't perform operation; it is illegal

Steps to Reproduce Problem

--------------------------

In the following example, the Clone method is used to create

a

duplicate dynaset based on a form's dynaset. This is

incorrect usage

of the Clone method.

1. Open the Categories form in the sample database

NWIND.MDB.

2. Create a new module, with the following Declarations

section:

'*********************************************************

      'Declarations Section of the module.

'*********************************************************

      Option Compare database

      Dim DS as Dynaset, DS2 as Dynaset, F as Form

3. From the View menu, choose the Immediate window.

4. Type the following lines in the Immediate window,

pressing ENTER

   after each line:

      Set F=Forms!Categories![Categories Subform].Form

      Set DS=F.Dynaset.Clone()

      Set DS2=DS.CreateDynaset()

The error will occur after the third line.

REFERENCES

==========

For more information, search for "clone," then "Clone

Method" using

the Microsoft Access Help menu.

Additional reference words: 1.00 gpf CreateDynaset


INF: Improved Print Merge Feature In Microsoft Access 1.1

 Article Number: Q98673

 CREATED: 11-MAY-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article discusses a new feature of Microsoft Access version 1.1:

the ability to directly use Microsoft Access tables in a Microsoft

Word for Windows print merge.

MORE INFORMATION

To use data from a Microsoft Access database in Word for Windows, the

data must be converted to a format that Word for Windows recognizes.

In Microsoft Access version 1.0, this is done by exporting the data

from Microsoft Access as text, or copying tables and queries from

Microsoft Access and pasting them into a Word for Windows document.

A new feature of Microsoft Access version 1.1 is the ability to select

Word for Windows Merge directly in the Export Data Destination dialog

box.

The following steps, performed in Microsoft Access version 1.1,

demonstrate how to convert your table into a data document for Word for

Windows:

 1. With the Database window selected, choose Export from the File menu.

 2. In the Data Destination box, choose Word for Windows Merge. Choose

    OK.

 3. Select the table that contains the information you want, and then

    choose OK.

 4. Microsoft Access will enter a default filename for export. You

    can either accept the default filename or enter a new filename,

    and then choose OK.

 5. Select the options you want in the Export Word Merge Options

    dialog box, and then choose OK.

 6. Minimize Microsoft Access and start Word for Windows.

 7. Open the main document in Word for Windows.

 8. From the File menu, choose Print Merge.

 9. Choose the Attach Data File button.

10. Select the exported text file that you created in step 4.

    NOTE: Word for Windows will only show *.DOC files by default. You

    will need to specify *.TXT files in the List Files Of Type box

    in the Attach Data File dialog box.

11. Use the Insert Merge Fields, Edit Data Field, Check, and Print

    Merge features of Microsoft Word for Windows to complete the

    document.

REFERENCES


PRA: Unable to Import a SQL Server View

 Article Number: Q98674

 CREATED: 11-MAY-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0

------------------------------------------------------------

---------

SYMPTOMS

You can attach a SQL Server view. If you attempt to import

this

view, you receive the following error message:

   Internal database error (-1603)

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0. This problem no longer occurs in Microsoft

Access version

1.1.

MORE INFORMATION

A SQL Server view is similar to a dynaset. It is the result

of running

an SQL query.

Steps to Reproduce Problem

--------------------------

1. Use another application, such as Microsoft Excel Q+E, to

create and

   save a SQL Server view.

2. Start Microsoft Access and open a database.

3. From the File menu, choose Import.

4. Select SQL Database as the Data Source.

5. Select the Data Source you want to import.

6. Log on to the SQL Server by entering your password and

choosing OK.

7. Choose the SQL Server view to import from the Import

Tables dialog

   window.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 4,

"Importing,

Exporting, and Attaching," pages 66-68

Additional reference words: 1.00 checkpage


INF: Maximum Database Size Increased in Version 1.1

 Article Number: Q98675

 CREATED: 11-MAY-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

The maximum database size in Microsoft Access version 1.1 is

1

gigabyte (GB). In Microsoft Access 1.0, the maximum database

size is

128 megabytes (MB).

This article explains how to convert your Microsoft Access

version 1.0

databases into version 1.1 databases, thereby allowing you

to take

advantage of the new database size limit.

MORE INFORMATION

You can use Microsoft Access version 1.0 databases under

Microsoft

Access version 1.1. However, in order to take advantage of

the new

size limit, you must convert your version 1.0 databases.

To convert a Microsoft Access version 1.0 database to

version 1.1

format, do the following:

1. Open Microsoft Access version 1.1.

2. From the File menu, choose Compact Database.

3. Select the database that you want to convert, and choose

OK.

4. The Database to Compact Into dialog window appears. From

the List

   Files of Type combo box, choose Access V1.1 (*.MDB).

Enter a new

   File Name, and choose OK.

NOTE: When you select a version 1.0 database, Access 1.0

(*.MDB) will

be the default format. You will need to manually select

Access 1.1

(*.MDB) in the List Files of Type combo box.

Additional reference words: 1.00 1.10 compact/repair limit


INF: SQL Server Views Read-Only When Attached

 Article Number: Q98786

 CREATED: 13-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - Microsoft SQL Server versions 1.x and 4.2

---------------------------------------------------------------------

Microsoft SQL Server supports updatable views. Microsoft Access can

only attach these views as read-only because SQL Server views do not

have indexes. Microsoft Access requires a unique index on the attached

object for update/delete/insert capability.

Please refer to Knowledge Base article Q90100 for more information on

Microsoft Access and updating attached SQL Server tables.

Additional reference words: 1.00 1.10 2.00 SQL Server attach table view


PRA: Query Progress Meter Reports Status Incorrectly

 Article Number: Q98787

 CREATED: 13-MAY-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When running an append query that appends a large number of records to

an existing table, the progress meter may incorrectly reflect the

status of the query. The progress meter may increase quickly to 98

percent complete and then continue slowly until reaching 100 percent.

CAUSE

The progress meter does not take into account the time for the sorting

phase. If the sorting phase takes a long time, the progress meter does

not correctly reflect the progress of the query.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 7, "Designing

Action Queries and Parameter Queries," pages 170-174

Additional reference words: 1.00 1.10 queries ui meter gage thermometer


INF: Number of Times a Custom Function Executes in a Query

 Article Number: Q98788

 CREATED: 13-MAY-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

A custom function called from a query will execute as follows:

 - One time per query if the expression does not reference a field

 - One time per record if the expression does reference a field

 - Two times per record if there are criteria on the expression

MORE INFORMATION

To optimize a query, Microsoft Access will not re-execute a custom

function unless the value passed to it changes. If the function

accepts a field as a parameter, Microsoft Access must re-execute the

custom function for each record, since the data may change from record

to record. If criteria are placed on the result of the function,

Microsoft Access must re-execute the function when applying the

criteria.

The examples below (examples A, B, and C) demonstrate each of the

three scenarios, using a custom function designed to number the

records in a query.

NOTE: These examples are simplified to demonstrate the results you

can expect when you use custom functions in a query. Many variables

can affect the number of times Microsoft Access re-executes a custom

function. For example, if you first minimize and them maximize

Microsoft Access, the process of repainting the screen also includes

re-executing any custom function that is part of the query result.

Complete the following steps to use examples A, B, and C:

1. Create a new module called RecordNumbers in the sample database

   NWIND.MDB.

2. Add the following to the module's Declarations section:

      Option Explicit

      Global RecordNum

Example A: An Expression that Calculates Only Once Per Query

-------------------------------------------------------------

1. Add the following function to the module you created in the

   previous procedure:

      Function ShouldIncrement ()

         RecordNum = RecordNum + 1

         ShouldIncrement = RecordNum

      End Function

2. Create a new query based on the Employees table. Drag the

   Last Name field to the query grid and add a column with

   the following expression:

      RecordNumber: ShouldIncrement()

3. Run the query. In Microsoft Access version 1.x, you will get the

   following result:

      Last Name    RecordNumber

      -------------------------

      Davolio      1

      Fuller       1

      Leverling    1

      Peacock      1

      Buchanan     1

      Suyama       1

      King         1

      Callahan     1

      Dodsworth    1

   In Microsoft Access version 2.0, you will get the following result:

      Last Name    RecordNumber

      -------------------------

      Davolio      1

      Fuller       1

      Leverling    1

      Peacock      1

      Buchanan     1

      Suyama       1

      King         1

      Callahan     1

      Dodsworth    1

      Hellstern    1

      Smith        1

      Patterson    1

      Brid         1

      Martin       1

      Pereira      1

Note that the function IncrementRecNum() is executed only once.

Example B: An Expression that Calculates Once Per Record

--------------------------------------------------------

1. Add the function DoesIncrement() to the module RecordNumbers you

   created in the first procedure:

      Function DoesIncrement (AnyValue)

         RecordNum = RecordNum + 1

         DoesIncrement = RecordNum

      End Function

2. Create a new query based on the Employees table. Drag the Last

   Name field to the query grid and add a column with the following

   expression:

      RecordNumber: DoesIncrement([Employee ID])

3. Run the query. In Microsoft Access 1.x, you will get the following

   result:

      Last Name    RecordNumber

      -------------------------

      Davolio      1

      Fuller       2

      Leverling    3

      Peacock      4

      Buchanan     5

      Suyama       6

      King         7

      Callahan     8

      Dodsworth    9

   In Microsoft Access 2.0, you will get the following result:

      Last Name    RecordNumber

      -------------------------

      Davolio      1

      Fuller       2

      Leverling    3

      Peacock      4

      Buchanan     5

      Suyama       6

      King         7

      Callahan     8

      Dodsworth    9

      Hellstern   10

      Smith       11

      Patterson   12

      Brid        13

      Martin      14

      Pereira     15

Example C: An Expression that Calculates More Than Once Per Record

------------------------------------------------------------------

1. Create a new query based on the Employees table. Drag the

   Last Name field to the query grid and add a column with

   the following expression:

      RecordNumber: DoesIncrement([Employee ID])

  NOTE: You will need to complete step 1 of example B in order to

  have the DoesIncrement() function available.

2. Open the module RecordNumbers in Design view. From the View menu,

   choose Immediate Window. Type the following statement to initialize

   the variable RecordNum:

      RecordNum = 0

3. Run the query. In Microsoft Access 1.x, you will get the following

   result:

      Last Name    RecordNumber

      -------------------------

      Davolio      1

      Fuller       2

      Leverling    3

      Peacock      4

      Buchanan     5

      Suyama       6

      King         7

      Callahan     8

      Dodsworth    9

   In Microsoft Access 2.0, you will get the following result:

      Last Name    RecordNumber

      -------------------------

      Davolio      1

      Fuller       2

      Leverling    3

      Peacock      4

      Buchanan     5

      Suyama       6

      King         7

      Callahan     8

      Dodsworth    9

      Hellstern   10

      Smith       11

      Patterson   12

      Brid        13

      Martin      14

      Pereira     15

4. Repeat Step 2 in this example (example C).

5. Add the following criteria under RecordNumber:

      >=0

6. Run the query. In Microsoft Access 1.x, you will now get the following

   result:

      Last Name    RecordNumber

      -------------------------

      Davolio      10

      Fuller       11

      Leverling    12

      Peacock      13

      Buchanan     14

      Suyama       15

      King         16

      Callahan     17

      Dodsworth    18

   In Microsoft Access 2.0, you will now get the following result:

      Last Name    RecordNumber

      -------------------------

      Davolio      16

      Fuller       17

      Leverling    18

      Peacock      19

      Buchanan     20

      Suyama       21

      King         22

      Callahan     23

      Dodsworth    24

      Hellstern    25

      Smith        26

      Patterson    27

      Brid         28

      Martin       29

      Pereira      30

In this case, Microsoft Access runs the expression twice, once to

create the dynaset and again to check the criteria you specified.

REFERENCES

==========

For more information on creating custom counters for forms and queries,

query on the following words here in the Microsoft Knowledge Base:

   custom and counter

Additional reference words: 1.00 1.10 2.00 top 20 limit counter


INF: Nulls Allowed in Foreign Key with Referential Integrity

 Article Number: Q98789

 CREATED: 13-MAY-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

Microsoft Access allows a Null value in a field that is the

foreign

key in a relationship if referential integrity is enforced.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. From the Edit menu, choose Relationships.

3. Under Primary Table, select Customers. Under Related

Table, select

   Orders.

   Note the following:

   a. PrimaryKey Fields and Select Matching Fields both

display

      "Customer ID".

   b. The Enforce Referential Integrity check box is

selected.

   c. The Add button is unavailable.

   These characteristics indicate an existing relationship

between

   Customers and Orders tables; thus, you will not be able

to make an

   entry in the Customer ID field of the Orders table if

that Customer

   ID does not exist in the Customers table.

4. Close the Relationships dialog box and open the Orders

table.

5. Change the Customer ID field of the first order to "XXXX"

and press

   TAB to try to move to the next record. You will receive

the

   following error message:

      Can't add or change record. Referential Integrity

rules require

      a related record in the table "Customers."

6. Choose OK.

7. Delete the entry in the Customer ID field. Make sure the

field is

   completely empty. Press TAB to move to the next record.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, page 54

Additional reference words: 1.00 1.10 null compact cascade


INF: Print a Sequential Number for Each Record/Group on Report

 Article Number: Q98790

 CREATED: 13-MAY-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

You can place a text box control that prints a sequential number for

each record in the Detail section of a report. This number can be

reset so that a separate set of numbers is printed for each group of

records. This article explains these procedures by modifying a report

in the sample database NWIND.MDB.

MORE INFORMATION

If you want to print an incremental counter for each record in a report

group, place an unbound text box control in the Detail section of the

report. To begin the sequence with the number 1, set the ControlSource

property to =1, then set the RunningSum property to Over Group.

Steps to Reproduce Behavior

---------------------------

1. From the Database window, open the "List of Products by Category"

   report in Design view.

2. Place the following text box control before the Product Name

   control in the detail section:

      Object: Text Box

      ---------------------------------------------------------------

      Name: MyLineNumber (in version 1.x, Control Name: MyLineNumber)

      ControlSource: =1

      RunningSum: Over Group

3. Preview the report. Note that each group's records are sequentially

   numbered, beginning with the number 1.

You can also increment the counter number for each group in the report

by changing the RunningSum property to Over All. To do this, replace

step 2 above with the following step:

2. Place the following text box control before the Category Name

   control in the Category Name Header section:

      Object: Text Box

      -----------------------------------------------------------------

      Name: MyLineNumber2 (in version 1.x, Control Name: MyLineNumber2)

      ControlSource: =1

      RunningSum: Over All

Repeat step 3 above. Note that each individual record now prints a

unique sequential number.

REFERENCES

==========

For more information, search on "Calculating the Number of Records in a

Report" using the Microsoft Access Help menu

Additional reference words: 1.00 1.10 2.00 reports sequential


INF: Part 1: DDE in Visual Basic to Request MS Access Data

 Article Number: Q98791

 CREATED: 13-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article explains how to use Microsoft Visual Basic to request

data from Microsoft Access using dynamic data exchange (DDE).

For information that goes into greater detail and demonstrates how to

parse the requested data in a Visual Basic array and then populate a

grid control with the data, query on the following words in the

Microsoft Knowledge Base:

   dde and vb and part two

MORE INFORMATION

This article provides a Visual Basic code example demonstrating how to

request information from the Employees table in the sample database

NWIND.MDB.

The following code example demonstrates how to fill a Visual Basic

text box with the entire contents of an Microsoft Access table,

including field names.

In Visual Basic, create a new form, add the following controls, and

set the appropriate properties for each control:

   Text Box

   --------

      Name:       Text1

      Multiline:  True

      Scrollbars: 3 - Both (vertical and horizontal)

   Command Button

   --------------

      Name:       Command1

NOTE: Size the text box large so that data can be seen and scrolled

easily following the DDE request.

Double click the command button and enter the following code between

the "Sub Command1_Click ()" and "End Sub" lines:

   Sub Command1_Click()

      Text1.LinkTopic = "MSACCESS|NWIND;TABLE Employees"

      Text1.LinkMode = 2     ' Establish a manual DDE link to Access

      Text1.LinkItem = "All" ' Setup the DDE request item to get ALL the

                             ' .. data from the Employees table,

                             ' .. including field names.

      Text1.LinkRequest      ' Request the data into the Text1 text box

      Text1.LinkMode = 0     ' Terminate the DDE link to Access

   End Sub

In this example, the first line specifies "MSACCESS" as the

application to communicate with and "NWIND;TABLE Employees" as the

topic of the DDE conversation. We could also specify an SQL statement

as the topic of the conversation. The following line of code is

functionally equivalent to the first line above:

   Text1.LinkTopic = "MSACCESS|NWIND;SQL Select * From Employees;"

In this example, the item "All" tells Microsoft Access to supply

Visual Basic with the entire contents of the Topic, including field

names. Microsoft Access supports a rich set of other items and topics.

For a list of supported topics and items, query on the following words

in the Microsoft Knowledge Base:

   dde and server and topics

When you run this example, be sure that Microsoft Access is running

and has the NWIND database opened.

When you run this code, the text box will be filled with the entire

contents of the Employees table. Each field will be delimited by a tab

character, Chr$(9), and each record row will end with a newline

character (a carriage return followed by a linefeed character).

Additional reference words: 1.00 1.10 2.00 vb b_vbasic


INF: Use of Constants as Field Names in a Query

 Article Number: Q98792

 CREATED: 13-MAY-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

If you use a constant (Yes, No, True, False, On, Off, or Null) as a

field name in a table and then create a query that uses any of those

fields, you receive the following error message:

   Invalid use of '.', '!', or '()' in query expression <Table>.<Field>

where <Table> is the name of the table you are using in the query and

<Field> is the name of the field in question.

A constant represents a numeric or string value that does not change.

In some respects, a constant is like a variable or a reserved word.

Unlike a variable, however, the value of a constant cannot change

during program execution.

If you receive the above error message, you must change your field

name at the table level.

REFERENCES

==========

For more information, search for "Constants" using the Help menu.

Additional reference words: 1.00 1.10 Queries ErrMsg


INF: Compound Indexes Must Restrict First Indexed Field

 Article Number: Q98793

 CREATED: 13-MAY-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Before an index can be used, queries with restrictions on multiple-field

(compound) indexes must restrict at least the first field of the index. You

can, however, also use adjacent fields in the index (up to 10 fields). If

the restriction is placed on a field other than the first field, the query

optimizer scans the table rather than using the index. This is not always

desirable, since table scans are slower than index searches for most

queries.

MORE INFORMATION

By default, when a compound index is created in Microsoft Access, no

individual indexes are assigned to the fields included in the compound

index. This behavior is by design.

For the query optimizer to use an index, you must use a comparison of

either the first field in the compound index or the first field and any

number of adjacent fields (up to 10) that make up the compound index. You

must query the indexed fields in the order they appear in the Indexes

window, beginning with the first indexed field and continuing with adjacent

fields.

NOTE: This principle also applies to using criteria with the Find

method in Access Basic.

For example, consider a table (T1) containing three fields: key_part1,

key_part2, and key_part3. If there is a composite index created on these

three fields and all fields are the primary key, then:

   SELECT * FROM T1 WHERE key_part2 = <value>

does not use the index because the first field, key_part1, is not used.

   SELECT * FROM T1 WHERE key_part1 = <value> AND key_part3 = <value>

also does not use the index, because, although key_part1 is referred to,

key_part1 and key_part3 are not adjacent fields.

However, each of the following three SQL statements do use the index

because they each include the first field, or the first field and one or

more adjacent fields of the composite index:

   a. SELECT * FROM T1 WHERE key_part1 = <value>

   b. SELECT * FROM T1 WHERE key_part1 = <value> AND key_part2 =

      <value>

   c. SELECT * FROM T1 WHERE key_part1 = <value> AND key_part2 =

      <value> AND key_part2 = <value>

The above fields are not prohibited from having indexes on them; individual

indexes can be built for each field, allowing comparisons on those fields

with index searches. Be aware, however, that indexes can take up as much

(or more) space than the data.

REFERENCES

==========

For more information on creating indexes, search for "indexes: creating"

then "Creating an Index" using the Microsoft Access Help menu.

For more information about optimizing queries with Rushmore technology,

search for "Rushmore technology" then "Optimizing Queries with Rushmore

Technology" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 index query performance multi


PRA: Invalid Results in Subreport When CanGrow = Yes

 Article Number: Q98794

 CREATED: 13-MAY-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

If a control in a subreport uses an expression or aggregate

function

and its CanGrow property is set to Yes, Microsoft Access

does not

calculate the value of the field correctly.

For example, assume your database contains a table named

Test that

has a text field called TestColumn containing the following

values:

   TestColumn

   ----------

   Mickey

   Donald

If you create a report with a single text box (Field1)

containing the

expression

   =IIf(IsNull([TestColumn]),"N/A",[TestColumn])

and you set the CanGrow property for Field1 to Yes and then

embed that

report as a subreport, you get the following incorrect

results:

   Donald

   Donald

If the calculated subreport field contains an aggregate

function,

instead of a text-based expression as above, the subreport

displays

incorrect numeric values.

RESOLUTION

Make sure that the CanGrow property of subreport fields that

use

expressions or calculations is set to No.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access version

1.0. This problem no longer occurs in Microsoft Access

version 1.1.


PRB: Form May Lose the Focus When SHIFT+F8 Is Pressed

 Article Number: Q98795

 CREATED: 13-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you press SHIFT+F8 to reverse an extend-mode selection, your

insertion point may disappear and your form may no longer be selected.

CAUSE

This behavior occurs only when you have selected a record using the

SHIFT+SPACEBAR key combination, rather than pressing the F8 key to turn

extend mode on.

When you press F8, Microsoft Access saves information regarding the

previous location of the focus, but not when you press SHIFT+SPACEBAR.

Therefore, Microsoft Access is unable to return the focus to your form

when you press SHIFT+F8.

RESOLUTION

Press F8 instead of SHIFT+SPACEBAR to select the record, or click

anywhere on your form to recover the focus.

MORE INFORMATION

This behavior appears only in Form view, not in Datasheet view.

Pressing SHIFT+SPACEBAR selects the current record or cancels your

record selection.

Pressing F8 turns extend mode on (EXT appears in the status bar). Once

extend mode is on, repeatedly pressing F8 extends the selection to the

word, the field, the single record, and finally to all records. Pressing

SHIFT+F8 reverses the selection.

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Open the Employees form.

3. From the View menu, choose Datasheet.

4. Press TAB to select the Last Name field (Davolio).

5. Press SHIFT+SPACEBAR to select the entire record.

6. Press SHIFT+F8 to cancel the selection. Note that the focus remains on

   the Last Name field.

7. From the View menu, choose Form.

8. Repeat steps 5-6 above. Note that the form no longer has the focus.

   Click anywhere on the form to restore the focus.

REFERENCES

==========

For more information on selecting records, search for "selecting records"

then "Selection Keys" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 cursor highlight blink


INF: Data Type of Value Overrides Data Type of Variable

 Article Number: Q98796

 CREATED: 13-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access internally converts values with implicit data type

definitions before assigning those values to variables. This may result

in unexpected rounding of numbers, or in the following error message:

   Invalid Number

MORE INFORMATION

You can implicitly define the data type of a value by appending a

type-declaration character at the end of the value. For example,

x=1234& implicitly defines 1234 as a Long data type (four-byte

integer).

Steps to Reproduce Behavior

---------------------------

1. Open a new module.

2. Add the following line underneath the Option Declare Database line:

      Dim v as Currency

3. Press ENTER.

4. From the View menu, choose Immediate Window.

5. In the Immediate window, type the following:

      v=123456789123.3456789#

6. Press ENTER, then type the following line

      debug.print v

   and press ENTER again.

   The value of the variable <v> is now 123456789123.3457. The number

   sign (#) implicitly defined the value as a double-precision value.

   Microsoft Access internally converted the value to that data type

   before assigning it to the currency variable.

7. Repeat steps 5-6, replacing # with other type-declaration

   characters (such as the ampersand (&), exclamation point (!), or at

   sign (@) symbol).

   The at sign defines the currency data type, which is limited to

   four decimal places. When you try to define a number with more than

   four decimal places as currency, an "invalid number" error message

   is displayed.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 25-26

Microsoft Access "Introduction to Programming," version 1.0, pages 49-51

Additional reference words: 1.00 1.10 2.00 ui misc


INF: How to Import a Microsoft Windows Cardfile Data File

 Article Number: Q98797

 CREATED: 13-MAY-1993

 MODIFIED: 17-AUG-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Microsoft Access has no routines to import a Microsoft Windows

Cardfile (.CRD) file. To import a .CRD file, you must use Access

Basic. This article describes the Access Basic function you need to

import a Windows .CRD file.

MORE INFORMATION

The function below can be used to import a Microsoft Windows Cardfile

data file. To use this function, you need to add it to a new or

existing Microsoft Access module. You can run the code from the

Immediate window, or you can call it from a command button by setting

the properties as follows:

   Command Button

   --------------

   OnPush: =Import_CRD()

In this function, you need to specify the correct path and filename of

your actual .CRD file. As an alternative, you can pass the filename

as a string to the function.

   Option Explicit

   Type CRD_Header

      Signature As String * 3 'always MGC

      Number as Integer

   End Type

   Type CRD_Record_Type

      Reserved As String * 6

      Position As Long

      Flag As String * 1

      Index As String * 40

      EndOfRecord As String * 1

   End Type

   Dim I As CRD_Record_Type

   Function Import_CRD ()

      Const FIRST_REC = 6

      Dim MyDB As Database

      Dim MyTable As Table

      Dim FileNum#

      Dim NumberOfCards%, NextRecord%, I%

      Dim CRD_Record As CRD_Record_Type

      Dim Message$

      Set MyDB = CurrentDB()

      Set MyTable = MyDB.OpenTable("CardFile")

      FileNum# = FreeFile

      'Supply the actual path and name of the file you want to

      'convert.

      Open "msaccess.crd" For Binary As FileNum#

      'The number of files in the .CRD file is at the 4 bytes offset.

      Get #FileNum, 4, NumberOfCards%

      NextRecord% = FIRST_REC

      For I% = 1 To NumberOfCards%

         Get #FileNum, NextRecord%, CRD_Record

         NextRecord% = NextRecord + &H34

         Message$ = Space$(512)

         Get #FileNum, CRD_Record.Position + 5, Message$

         MyTable.AddNew

            MyTable.Title = Mid$(CRD_Record.Index, 1)

            MyTable.Comment = Mid$(Message$, 1, InStr(Message$, Chr$(0)))

         MyTable.Update

      Next I%

      Close

   End Function

References:

For more information on the actual details of the .CRD file format,

query on the following words in the Microsoft Knowledge Base:

   cardfile and format and graphic and absolute and hexadecimal

Additional reference words: 1.00 1.10 .crd


INF: Creating Reports to Mail Merge Microsoft Access Data

 Article Number: Q98798

 CREATED: 13-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

To use a mail merge with Microsoft Access data, you can export or copy your

data to a word processor, or in Microsoft Access 2.0, you can choose the

Merge It button on the toolbar. However, you can also create a Microsoft

Access report to generate simple mail-merge documents. This article

demonstrates how to generate a mail-merge document.

MORE INFORMATION

The following is an example of a business letter that you can create:

NOTE: All values shown in angle brackets (<>) are found in the

underlying table.

KB Advertising Agency

<February 5th, 1993>

<John Doe>

<123 E. Main Street>

<Middle Town, OH 44044>

Dear <Mr. Doe>,

We are pleased to announce our new line of office furniture. As a

<valued> customer, you are entitled to a <10>% discount off our

catalog prices.

Call us today toll-free at (800) 555-1212 and receive a free

full-color catalog detailing all our top-of-the-line office products.

Sincerely,

J. Grant

Manager, Office Products

How to Create the Sample Document

---------------------------------

1. Create the following new table:

      Table: Customer

      ---------------------

      FieldName: Salutation

      DataType: Text

      FieldName: First Name

      DataType: Text

      FieldName: Last Name

      DataType: Text

      FieldName: Address

      DataType: Text

      FieldName: City

      DataType: Text

      FieldName: State

      DataType: Text

      FieldName: ZIP

      DataType: Text

      FieldName: Customer Type

      DataType: Text

      FieldName: Discount Pct

      DataType: Number

2. Enter the following records in the new table:

   Salu-   First  Last                                      Cust     Disc

   tation  Name   Name   Address   City       State  ZIP    Type     Pct

   ----------------------------------------------------------------------

   Mr.     John   Doe    123 Main  Middleton  OH     44044  Valued   10

   Mrs.    Sally  White  52A Elm   Florence   KY     45123  Special  5

   Dr.     Fred   Weiss  Box 456   Camden     SC     29332  Super    25

3. Create the following new report based on the Customer table:

   NOTE: Do not use a Microsoft Access ReportWizard to create this report.

   a. From the Layout menu in Microsoft Access 1.x, or the Format menu in

      Microsoft Access 2.0, turn off Report Hdr/Ftr and Page Hdr/Ftr (so

      that no check mark appears next to either command).

   b. Add all the table controls to the report's detail section.

   c. Delete the default text box labels.

   d. Set the following properties:

         Report: Merge Letter

         ----------------------

         RecordSource: Customer

         Section: Detail

         ---------------------------

         ForceNewPage: After Section

         CanGrow: Yes

         Control: Label

         ------------------------------

         ControlName: Company Label

         Caption: KB Advertising Agency

         Control: Text Box

         ------------------------

         ControlName: Todays Date

         ControlSource: =Date()

         Format: Long Date

         Control: Text Box

         ------------------------------------------------

         ControlName: Name Line

         ControlSource: =[First Name] & " " & [Last Name]

         Control: Text Box

         -------------------------

         ControlName: Address Line

         ControlSource: =[Address]

         Control: Text Box

         -----------------------------------------------------

         ControlName: CSZ Line

         ControlSource: =[City] & ", " & [State] & " " & [ZIP]

         Control: Text Box

         ----------------------------------------------------------------

         ControlName: Salutation Line

         ControlSource: ="Dear " & [Salutation] & " " & [Last Name] & ","

         Control: Text Box

         ------------------------------------------------------------------

         ControlName: Para 1

         ControlSource: ="We are pleased to announce our new line of office

                          furniture. As a " & [Customer Type] & "customer,

                          you are entitled to a" & [Discount Pct] & "%

                          discount off our catalog prices."

         CanGrow: Yes

         Control: Label

         ----------------------------------------------------------------

         ControlName: Rest of Letter

         Caption: Call us today toll-free at (800) 555-1212 and receive a

                  free full-color catalog detailing all our

                  top-of-the-line office products.

4. Add the following label controls:

      Sincerely,

      J. Grant

      Manager, Office Products

5. Size and position the controls, then set the font styles and sizes.

   NOTE: Press CTRL+ENTER to force new lines and paragraphs in

   controls.

6. Save the report. Print or preview the report to see the results of

   the merge.

Summary and General Notes

--------------------------

 - Fixed paragraphs should be entered in label controls.

 - Variable paragraphs should be entered in text box controls.

 - Margins are determined by the width of the control. The text will

   wrap within the width of the control, not the width of the letter.

 - The ControlName of a text box must be different from its field name

   in the table. If they are the same, the ControlName prints as a

   "#Error?" message.

Limitations

-----------

 - You cannot change the formatting of individual words. You can change

   only the formatting of the control.

 - You are limited to 255 characters in the ControlSource property of a

   text box. For long paragraphs, create one or more invisible text

   boxes to contain the text, then concatenate them in a visible text box.

Additional reference words: 1.00 1.10 2.00 mailmerge page header


PRB: CTRL+C Does Not Copy SQL Statement in Windows 3.0

 Article Number: Q98799

 CREATED: 13-MAY-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

--------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

--------

SYMPTOMS

Since you cannot choose options from the Edit menu when you

have a

dialog box open, if you want to copy the SQL text of a

query, you must

press CTRL+C instead of choosing Copy from the Edit menu.

However,

this key combination does not work if you are running

Microsoft Access

with Microsoft Windows version 3.0.

CAUSE

Even though the Microsoft Access Edit menu displays CTRL+C

as the

equivalent for the Copy command, this key combination is

defined by

Windows and not by Microsoft Access. CTRL+C is a Windows 3.1

key

combination. If you are running Windows 3.0, press CTRL+INS

instead.

NOTE: You can use either key combination in Windows 3.1.

STATUS

This behavior is by design.

MORE INFORMATION

The following are the Edit menu options and the equivalent

shortcut key

combinations for Windows 3.0 and 3.1:

   Edit Menu    Windows     Windows

   Options      3.0         3.1

   --------------------------------------------------

   Cut          SHIFT+DEL   CTRL+X or SHIFT+DEL

   Copy         CTRL+INS    CTRL+C or CTRL+INS

   Paste        CTRL+V or SHIFT+INS for both versions

Additional reference words: 1.00 1.10 UI Edit Accelerator


INF: Tile, Cascade Menu Options Inconsistent with Prog Manager

 Article Number: Q98800

 CREATED: 13-MAY-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The order in which the Tile and Cascade options appear on the Window

menu in Microsoft Access are not the same as in Microsoft Windows

Program Manager. Also, SHIFT+F4 and SHIFT+F5 are not shown as shortcut

key combinations for Tile and Cascade, respectively.

MORE INFORMATION

The Tile and Cascade menu options function in exactly the same way in

Microsoft Access as they do in Program Manager.

REFERENCES

==========

For more information on shortcut key combinations, search for "shortcut

keys" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 WinIss ui shorcut quickkey


INF: How to Print a Single Record from a Form in a Report

 Article Number: Q98801

 CREATED: 13-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to select a single record on a form and

print it in a report.

MORE INFORMATION

The following procedure explains how to print only the record you

select from the Customers form in the sample database NWIND.MDB:

1. Create a report called PrintRecordReport based on the Customers

   table.

2. Create the following macro:

      Macro: PrintRecordMacro

      -----------------------------------------------------------------

      OpenReport

         ReportName: PrintRecordReport

         View: Print Preview

         Where Condition: [Customer ID]=Forms![Customers]![Customer ID]

3. Add a command button to the Customers form and set the following

   button properties:

      Command Button

      ------------------------

      ControlName: PrintRecord

      Caption: Print Record

      OnPush: PrintRecordMacro

When you choose the command button on the form, the report opens and runs

the underlying query. The query references the form for the Customer ID and

synchronizes that Customer ID to the Customer ID on the report.

Additional reference words: 1.00 1.10 2.00


INF: Date/Time Data Type Provides Current Year Automatically

 Article Number: Q98802

 CREATED: 13-MAY-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

If you enter a partial date in a field formatted with the Date/Time

data type, Microsoft Access fills in the current year automatically.

MORE INFORMATION

If your data is formatted with the Date/Time data type and you want to

indicate the current year, it is not necessary to type the year. This

feature works for both tables and forms.

Steps to Reproduce Behavior

---------------------------

1. Create a new table, as follows:

      Table: DateTable

      --------------------------------

      FieldName: My Date [primary key]

      DataType: Date/Time

2. From the View menu, choose Datasheet.

3. Type 1/1, then press TAB to leave the field.

The value you entered is displayed as 1/1/<current year>

Additional reference words: 1.00 1.10 2.00 misc date/time


PRB: Microsoft Access Cannot Find DESKEDIT.EXE File

 Article Number: Q98803

 CREATED: 13-MAY-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Attempting to open the Microsoft Access README.TXT file or clicking

the Microsoft Access Q&A icons may produce the following error

message:

   Cannot find DESKEDIT.EXE.

CAUSE

This error results when Norton Desktop for Windows, one of the Norton

Utilities, has been deleted from your computer. This change causes

Microsoft Windows to lose the association with the .TXT files.

RESOLUTION

In Windows File Manager, reassociate your text files using Notepad, as

follows:

1. Open the Access subdirectory in File Manager.

2  Select the README.TXT file.

3. From the File menu, choose Associate.

4. In the Associate dialog box, choose Text File (NOTEPAD.EXE).

5. Press ENTER. Your text files are now reassociated.

MORE INFORMATION

Norton Utilities is manufactured by Peter Norton Computing, a vendor

independent of Microsoft; we make no warranty, implied or otherwise,

regarding this product's performance or reliability.

Additional reference words: 1.00 1.10 2.00 WinIss misc


INF: Cannot Use ANALYZER.MDB Filename for Output Database

 Article Number: Q98804

 CREATED: 13-MAY-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

The product name Analyzer is reserved for the Database

Analyzer

utility that ships with Microsoft Access. You cannot use

this name for

an output database when you are running this utility.

MORE INFORMATION

You can create a database called Analyzer (ANALYZER.MDB)

without any

problems, but you cannot use this database as an output

destination

when running the Database Analyzer utility.

You will not receive any error messages if you attempt to

use

ANALYZER.MDB as an output database, but the object(s) that

you

select will not be analyzed.

REFERENCES

==========

For more information about the Database Analyzer utility,

refer to

Question #23 in the PSSKB.TXT file. This text file is

located in your

Access program directory and can be opened in Notepad.

Additional reference words: 1.00 1.10 analyzer object out


PRB: Internal Database Error (-5207) When Attaching Tables

 Article Number: Q98805

 CREATED: 13-MAY-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SYMPTOMS

When you are attaching a French version Paradox file, the following error

message may appear:

   Internal Database Error -5027

CAUSE

The MSACCESS.INI file settings are incorrect for reading the international

file.

RESOLUTION

Set the CollatingSequence entry in the [Paradox ISAM] section of the

MSACCESS.INI file to International as follows:

   [Paradox ISAM]

   CollatingSequence = International

STATUS

This problem no longer occurs in Microsoft Access version 1.1.

MORE INFORMATION

In Microsoft Access versions 1.1 and 2.0, the error message "Wrong Paradox

sort sequence" is displayed, followed by an informative Help option that

details how to correct the problem.

REFERENCES

==========

For more information about modifying the MSACCESS.INI file, search for

"MSACCESS.INI" then "Customizing MSACCESS.INI Settings" using the Microsoft

Access Help menu.

Additional reference words: 1.00 import/export ui database 5027 errmsg


PRB: Seek Method Is Faster Than Find Method

 Article Number: Q98806

 CREATED: 13-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you are using Access Basic to find a record in an indexed field,

the Seek method may be faster than the Find method, especially in a

large table.

CAUSE

This behavior is by design.

RESOLUTION

Use the Seek method on indexed fields to optimize your search speed.

MORE INFORMATION

When you perform a Seek, you are opening a table directly and moving

to the record based on an index value. When you create a dynaset and

perform a Find, you are checking the value of the field in every

record until you find a match.

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create a new module and enter the following two functions:

      '*********************************************

      'Declarations section of the module.

      '*********************************************

      Option Explicit

      '=============================================

      'The following function uses the Seek method.

      'It quickly returns the Customer ID where the

      '   PrimaryKey field = 11070.

      '=============================================

      Function Faster ()

         Dim db As Database, tbl As Table

         Set db = CurrentDB()

         Set tbl = db.OpenTable("Orders")

         tbl.Index = "PrimaryKey"

         tbl.Seek "=", 11070

         Debug.Print tbl("customer id")

         tbl.Close

      End Function

      '=============================================

      'The following function uses the Find method.

      'It is slightly slower in returning the Customer

      '   ID where the PrimaryKey field = 11070.

      '=============================================

      Function Slower()

         Dim Criteria As String, MyDB As Database, Myset As Dynaset

         Set MyDB = CurrentDB()

         Set Myset = MyDB.CreateDynaset("Orders")

         Criteria = "[Order id] =" & 11070

         Myset.FindNext Criteria

         Debug.Print Myset("Customer id")

      End Function

3. From the View menu, choose Immediate Window.

4. In the Immediate window, type

      ?Faster()

    and press ENTER. Then type

      ?Slower()

    and press ENTER.

The Faster() function, which uses Seek, is slightly faster than the

Slower() function, which uses FindNext.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 187-188 and

426-427

Additional reference words: 1.00 1.10 2.00 ab seeking finding


PRB: Must Have Database Open to Use Database Analyzer Utility

 Article Number: Q98807

 CREATED: 13-MAY-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You receive the following error message when you start the Database

Analyzer utility:

   (2046) An error has occurred in Analyzer at: Command not

   available: OpenForm

RESOLUTION

Make sure to have a database open before starting the Database Analyzer

utility. You will receive this error message only if you start Database

Analyzer with no database open.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Add Database Analyzer to your Microsoft Access Help menu.

   For information on how to add the Database Analyzer to the Help menu,

   query on the following words here in the Microsoft Knowledge Base:

      database and analyzer and help and menu

2. Open Microsoft Access, but do not open a database. You should see only

   a File menu and a Help menu.

3. From the Help menu, choose Database Analyzer. The error message

   stated above will be displayed.


PRB: <Expression> Not Part of Aggregate Function or Grouping

 Article Number: Q98808

 CREATED: 13-MAY-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If a select query that contains an expression is converted to a totals

query, the following error message is displayed when the query is run:

   <expression> not part of aggregate function or grouping.

CAUSE

When a select query is converted to a totals query, all expressions

are assumed to contain aggregate functions and cause the Total field

to default to Expression.

RESOLUTION

To work around this problem, set the Total field to Expression and

include an aggregate function as part of the expression for Field

Name. If you cannot add an aggregate function, set Total to Group By

as shown:

   Query: Query Name

   ------------------------

   Field Name: <expression>

   Total: Group By

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

Using the sample database NWIND.MDB, complete the following steps:

1. Open the Employee List query in Design view by choosing the Query

   button in the Database window, selecting the query name, and

   choosing Design.

2. From the View menu, choose Totals to convert the query to a totals

   query.

3. From the Query menu, choose Run. The following error message is

   displayed:

      "[Last Name] & ", " & [First Name]" not part of aggregate

      function or grouping.

4. In the query grid, make the following changes:

     Query: Employee List

     -----------------------------------------------------------

     Field name: Employee Name:[Last Name] & ", " & [First Name]

     Total: Group By

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 141-149

Additional reference words: 1.00 1.10 queries aggregate error


INF: Operators as Field Names in Query Cause Error Message

 Article Number: Q98809

 CREATED: 13-MAY-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

If you use logical operators as field names in a table and then

create a query that uses any of these fields, you receive the

following error message:

   Syntax error in query expression "<Table>.<Field>".

MORE INFORMATION

To correct this problem, open the table in Design view and change the

name of the field listed in the error message to a name that is not

one of the logical operators.

The following are logical operators:

   And, Between, Eqv, IIF, Imp, In, Is, Like, Mod, Not, Or, and Xor

REFERENCES

==========

For more information, search for "logical operators" using the Microsoft

Access Help menu.

Additional reference words: 1.00 1.10 queries errmsg ui


PRA: GPF Printing Subreport with Datasheet Default View

 Article Number: Q98810

 CREATED: 13-MAY-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SYMPTOMS

Reports do not have a Datasheet view as forms do; however, forms

created with a default Datasheet view can be saved as reports.

This can cause problems in Microsoft Access.

If you save a form with the DefaultView property set to Datasheet as a

report and that report is subsequently embedded as a subreport,

Microsoft Access generates a general protection (GP) fault when the

report is previewed or printed.

This problem can occur only if you create the subreport using the Save

As Report command on the File menu. (To see this command, you must be

in Design view of the form.)

RESOLUTION

When using the Save As Report command to create a report from a form,

be sure the DefaultView property of the form is NOT set to Datasheet.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

version 1.0. This problem was corrected in Microsoft Access version 1.1.

Additional reference words: 1.00 WinIss


PRB: Paste Link to MS Excel Displays First Field Name Only

 Article Number: Q99316

 CREATED: 26-MAY-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - Microsoft Excel for Windows, versions 2.x and 3.0

---------------------------------------------------------------------

SYMPTOMS

When you paste link a table from Microsoft Access to Microsoft Excel

versions 3.0 and earlier, only the first field name of that table

appears in the spreadsheet.

CAUSE

Microsoft Excel versions 3.0 and earlier need to know the exact

dimensions of the spreadsheet area that you are pasting to before you

choose the Paste Link command.

RESOLUTION

To paste link a table to Microsoft Excel versions 3.0 and earlier,

first select the entire area on your spreadsheet. Another option is

to use the Paste command, rather than the Paste Link command.

MORE INFORMATION

The following steps will result in an unsuccessful paste link using

Microsoft Excel versions 3.0 and earlier. These same steps will

successfully paste link a table to later versions of Microsoft Excel.

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. In the Database window, select the Customers table.

3. From the Edit menu, choose Copy.

4. Start Microsoft Excel and create a new worksheet.

5. From the Microsoft Excel Edit menu, choose Paste Link.

REFERENCES

==========

Microsoft Excel "User's Guide," version 3.0, pages 318-319

Additional reference words: 1.00 1.10 2.00 excel ole/dde


INF: Exporting WordPerfect Secondary Files to Microsoft Access

 Article Number: Q99317

 CREATED: 26-MAY-1993

 MODIFIED: 10-SEP-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article describes how to export data from a WordPerfect print

merge secondary file to Microsoft Access.

MORE INFORMATION

A WordPerfect secondary file contains records, typically names and

addresses, used in a print merge with a primary file, usually a form

letter or mailing label document. To use data from a secondary file,

the information must be saved in a comma or tab delimited (separated),

unformatted text file. WordPerfect secondary files are neither comma

nor tab delimited.

A typical comma delimited text file resembles the following:

   "Joe","Smith","123 Main Street","Seattle, WA 98033"

   "Martha","Jones","4523 Williams Ave","","Redmond, WA 98052"

The equivalent WordPerfect secondary file resembles the following:

   Joe{END FIELD}

   Smith{END FIELD}

   123 Main Street{END FIELD}

   Seattle, WA 98033{END FIELD}

   {END RECORD}

   <CRLF>

   Martha{END FIELD}

   Jones{END FIELD}

   4523 Williams Ave{END FIELD}

   {END FIELD}

   Redmond, WA 98052{END FIELD}

   {END RECORD}

   <CRLF>

where <CRLF> represents a hard page break.

Problems: Secondary Files With Multi-Line Field Entries

-------------------------------------------------------

WordPerfect allows you to merge multiple lines of data in a single

field. The following record has only two fields:

   Joe Smith{END FIELD}

   123 Main Street

   Suite 101

   Seattle, WA 98033{END FIELD}

   {END RECORD}

   <CRLF>

Delimited text files use carriage returns to mark the end of a record;

these cannot be included in the field information. Each line in the

secondary file must be made a unique field before it can be prepared

as a delimited file. When you add the {END FIELD} code to a record,

the new field is represented in every record in your file. Each record

must contain the same number of fields and each field should either

contain the same type of data or remain empty.

Using the {FIELD NAMES} Section in a Secondary File

---------------------------------------------------

Fields in a secondary file can be referenced from a primary file by

number. These fields are numbered from top to bottom, or by a name

that is assigned in the optional {FIELD NAMES} section, which appears

at the top of the secondary file. The {FIELD NAMES} section may look

like this

   {FIELD NAMES}

   Name~

   Address~

   ~{END RECORD}

or like this

   {FIELD NAMES}Name~Address~~{END RECORD}

If referenced by number, the Name field is 1 and the Address field is

2. A hard page break falls between this section and the first record.

Preparing the Comma Delimited Secondary File

--------------------------------------------

WordPerfect for Windows:

WordPerfect for Windows can save secondary files directly in a comma

delimited format. However, if you have a {FIELD NAMES} section in the

file and want to preserve these names in Microsoft Access, you must

reformat the file so that each name is separated by a comma and not by

a tilde (~) character. Also, the fields should not appear on separate

lines, nor be followed by carriage returns. The following {FIELD

NAMES} section

   {FIELD NAMES}

   Name~

   Address~

   Phone~

   ~{END RECORD}

should be editing as follows:

   {FIELD NAMES}Name,Address,Phone{END RECORD}

Creating the Comma Delimited File:

1. From the File menu, choose Save As.

2. In the Save As box, type a unique file name, preferably with a .TXT

   extension.

3. In the Format box, select ASCII Delimited Text (DOS), then choose

   Save.

WordPerfect for MS-DOS:

WordPerfect for MS-DOS cannot save secondary files directly in a

delimited format. To create the comma delimited file, you need to

create a primary file and merge the secondary information into it. The

primary document will contain fields already in comma delimited

format. Once the data is merged, remove the hard page breaks

separating each record. The resulting document can be saved as a text

file that Microsoft Access can import.

Creating the Primary File:

1. Press F7, choose No, then choose No again to create a new

   WordPerfect document.

2. Type an opening quotation mark. Press SHIFT+F9, then 1 (Field).

3. In the Enter Field box, type the name of the first field if a

   {FIELD NAMES} section appears in the secondary file, or type "1" if

   there is no {FIELD NAMES} section.

4. Press ENTER. Type a closing quotation mark, followed by a comma.

5. Repeat steps 2-4 for each field in the secondary file, changing

   only the field name or field position number as appropriate. Do not

   type a comma after the last field.

6. Press ENTER to place a hard carriage return at the end of the

   record.

7. Press F10, type a unique filename in the Document To Be Saved

   box, and press ENTER.

   The primary document will resemble the following:

      "{FIELD}name~","{FIELD}address~","{FIELD}phone~"

   NOTE: It is OK if the lines wrap on the screen.

Merging the Primary and Secondary Files:

1. Press F7, choose No, then choose No again to create a new

   WordPerfect document.

2. Press CTRL+F9, then 1 (Merge).

3. In the Primary File box, type the name of the primary file and

   press ENTER.

4. In the Secondary File box, type name of the secondary file and

   press ENTER.

Removing the Residual Hard Page Breaks:

1. Press ALT+F2, then N to disallow replacements.

2. At the -> Srch prompt, press CTRL+ENTER to enter a [HPg] code.

3. Press ALT+F2 twice to pass the Replace With message.

Saving As an Unformatted Text File:

1. Press CTRL+F5, then 1 (DOS Text), then 1 (Save).

2. Type a valid document name, preferably with a .TXT extension, and

   press ENTER.

REFERENCES

==========

"WordPerfect for DOS Reference," version 5.1, pages 420-431

"WordPerfect for DOS Workbook," version 5.1, pages 237-246

"WordPerfect for Windows Reference," version 5.1, pages 300-308

"WordPerfect for Windows Workbook," version 5.1, pages 203-210

Additional reference words: 1.00 1.10


PRA: ApplyFilter Action Causes Form to be Read- Only

 Article Number: Q99318

 CREATED: 26-MAY-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

Running a macro that contains an ApplyFilter action may

cause a form

to become read-only. This problem occurs if the form is

based on a

query that contains two tables with a one-to-many

relationship and

only records from the one side are included in the output of

the

query.

RESOLUTION

There is no way to prevent the ApplyFilter action from

making the form

read-only. However, you can use one of the following methods

to filter

the records displayed in a form:

 - Base the form on a parameter query. The user will then be

prompted

   for the criteria with which to filter the records each

time the form

   is opened. For more information on parameter queries,

refer to pages

   178-181 in the Microsoft Access "User's Guide."

 - Place the form in another form as a subform. Set up the

LinkMaster

   and LinkChild properties so that one or more fields in

the main form

   filter the data in the subform. For more information on

subforms,

   refer to the pages 272-278 in the Microsoft Access

"User's Guide."

 - Use Access Basic code to control the records displayed in

the form.

   For more information, refer to pages 106-107 in the

Microsoft Access

   "Introduction to Programming" manual.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0. This problem no longer occurs in version 1.1.

Steps to Reproduce Problem

--------------------------

1. In the sample database NWIND.MDB, create a new query

based on the

   Customers and Orders tables. Join the tables on [Customer

ID].

2. Drag all fields from the Customers table to the query

grid. Drag

   down [Order ID] from the Order table. Add the criteria:

>10080 and

   clear the Show box.

3. Save the query and create a new form based on it. Drag

several

   fields from the field list to the form.

4. Create a macro with an ApplyFilter action. Set the

macro's Where

   Condition argument to:

      [Company Name] Like "c*"

5. Save the macro and drag it onto the form.

6. Switch to Form view. Verify that you can edit fields.

7. Press the macro button to apply the filter.

You can no longer edit or add records.

Additional reference words: 1.00 dynaset lock query


INF: Finding the OLE ClassKey of an Embedded Object

 Article Number: Q99319

 CREATED: 26-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access places a wrapper of information around an OLE object

before it stores the object in a table. The Name and ClassKey of the

object start at byte count 21 and are stored from there as two

zero-terminating strings. By reading the field as a text field, you

can parse out the ClassKey.

This article describes how to use Access Basic to find the ClassKey of

an embedded object with an OLE-Object data type.

MORE INFORMATION

When an OLE object is stored in a table, the ClassKey is the second

null-terminated string after the 20th byte in the object. It can be

read as text with the following Access Basic code:

NOTE: In the following sample code, an underscore (_) is used as a

line-continuation character. Remove the underscore when re-creating

this code in Access Basic.

   Function GetObjectClass$ ()

      If IsNull(screen.activeform!Photo) Then

         GetObjectClass$ = "n/a"

      Else

         MyChunk$ = Mid(screen.activeform!Photo, 21, 40)

         NullOne% = InStr(1, MyChunk$, Chr$(0))

         NullTwo% = InStr(NullOne% + 1, MyChunk$, Chr$(0))

         GetObjectClass$ = Mid(MyChunk$, NullOne% + 1,_

                               NullTwo% - NullOne% - 1)

      End If

   End Function

The GetObjectClass$() function first checks to see if the object is

null and returns the value "n/a" if it is. If the object is not null,

it assigns bytes 21 through 40 of the OLE object to the string

MyChunk$ and then searches for the first null character, the next null

character, and so forth. Finally, it sets the GetObjectClass$()

function equal to the string between the two null characters.

Using the function provided above, a control on the Employees form of

the sample database NWIND.MDB, with the properties below, displays the

ClassKey for the Photo control:

   ControlName:   ObjClassKey

   ControlSource: =GetObjectClass()

This example returns "PBRUSH" for the first photo in the Employees

table.

There are several different ways to use this information.

RegQueryValue(), a function contained in the Microsoft Windows

SHELL.DLL file, uses the ClassKey to obtain information about that

class from the REG.DAT file.

REFERENCES

==========

For more information about calling the RegQueryValue() function to get

the Class Name of an OLE object, query on article Q99322 here in the

Microsoft Knowledge Base.

Microsoft Windows "Programmer's Reference," version 3.1, Volume 2,

page 282

Additional reference words: 1.00 1.10 2.00 dll ClassName Class Key


PRA: System Hangs When Minimizing Microsoft Access Window

 Article Number: Q99320

 CREATED: 26-MAY-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Your computer stops responding (hangs) after you switch away from Microsoft

Access, start another application, switch back to Microsoft Access, and

then choose the Minimize button.

This problem occurs only if Microsoft Access is running with Windows

for Workgroups.

RESOLUTION

Clicking anywhere in the Microsoft Access window other than the Minimize

button does not cause your computer to hang. After clicking anywhere else,

you can use the Minimize button without hanging the computer.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

Steps to Reproduce Problem

--------------------------

WARNING: Following the steps below will cause your computer to hang, or

stop responding. Make sure to save any open work files on your computer

before following these steps. After following these steps, you will have to

restart your computer.

1. Start Microsoft Access.

2. From the Help menu, choose Cue Cards.

3. Select the first option, Design A Database With Tables.

   NOTE: You must be at a Cue Card screen with a gray background.

4. Switch to Program Manger and start Calculator.

5. Press CTRL+ESC to bring up Task List and select Microsoft Access.

6. Press the Minimize button.

Additional reference words: 1.00 1.10 WinIss gpf hung freeze frozen


INF: Query Optimizing Tips for Attached SQL Database Tables

 Article Number: Q99321

 CREATED: 26-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Special considerations must be made for performance optimization of

queries built on attached SQL database tables. An SQL database, for

this article, is defined as any client/server database that supports

some level of ANSI SQL as an intrinsic part of the database's

programming language. Optimal query strategy for these queries is to

ensure that all query operations are performed on the server. This

article outlines tips on how to ensure that queries against attached

SQL database tables are performed on the server.

This article assumes a basic understanding of client/server computing

environments and architectures.

MORE INFORMATION

The key to improving query performance on attached SQL database tables

is to ensure that no data is filtered on the client. Filtering data on

the client increases network traffic and does not allow for leveraging

of advanced server hardware, essentially turning a client/server

system into a file server system. To this end, keeping the query

evaluation on the server reduces overhead and keeps an application

running as fast as possible.

Generic query optimization techniques should not be ignored when you

are using attached SQL database tables. "WHERE clause" restrictions,

such as equality or range comparisons, and sorting should still be

performed on indexed fields. For more information on query

optimization, call Microsoft Consumer Sales at (800) 426-9400 to

order a "white paper" on SQL Server optimization. Other SQL database

vendors may provide the same information for their customers.

Use care when implementing intrinsic or user defined functions (UDFs)

in query fields or when using criteria that are not supported on the

server. Generally, SQL databases have functionality that corresponds

to most standard Microsoft Access functions, but each server will be

different.

Many intrinsic Microsoft Access functions have direct back-end

correspondents. Microsoft Access asks the ODBC driver about intrinsic

function support and performs the appropriate mappings.

You can use UDFs and Microsoft Access intrinsic functions without server

equivalents when they are accompanied by server-capable restrictions

that restrict the data. For example, the following query

   Query1a: SELECT * FROM MillionRowTable WHERE Funk1(col1) = 10

returns the whole table and evaluates Funk1(col1) = 10 locally, whereas

the following query

   Query1b: SELECT * FROM MillionRowTable WHERE Funk1(col1) = 10

                      AND LastName BETWEEN 'g' AND 'h'

sends the BETWEEN 'g' AND 'h' restriction to the server, returns the

qualifying rows, and evaluates Funk1(col1) on only those rows.

Non-remote-capable SELECT list items do not force a query to be

executed locally, unless they are used with unique values or a totals

query (DISTINCT/GROUP BY). For example, the following query

    Query2a: SELECT * FROM MyTable WHERE Format(col1, ...) = 10

returns the whole table and causes the WHERE clause to be evaluated

locally. However, the following query

    Query2b: SELECT Format(col1,...) FROM MyTable WHERE col2 = 10

sends "SELECT col1 FROM MyTable WHERE col2 = 10" to the server,

presumably returning far less data over the network. It then locally

evaluates Format() on the col1 values returned.

Of the following two queries, Query3a is sent completely to the

server. Query3b sends "SELECT col1 FROM MyTable" and performs the

Format() function, and therefore the DISTINCT clause, locally.

    Query3a: SELECT DISTINCT col1 FROM MyTable

    Query3b: SELECT DISTINCT Format(col1,...) FROM MyTable

The following two queries are performed as follows: Query4a is sent

completely to the server. Query4b sends "SELECT col1 FROM MyTable" and

performs the StdDev() aggregate function locally, since it's not a SQL

standard function.

    Query4a: SELECT Sum(col1) FROM MyTable

    Query4b: SELECT StdDev(col1) FROM MyTable

Crosstab queries present unique restrictions, some pertinent to all

queries, some to crosstab queries only:

1. Only standard aggregate functions, such as Count(), Sum(), Min(),

   Max(), and Avg(), can be used.

2. Aggregate functions cannot be used as row or column headers.

3. Only one aggregate function can be used in the "value."

4. Nothing can be sorted.

5. If a fixed-value list of column headers is supplied, the value

   cannot be embedded in an expression.

Restriction #1 applies to all queries against SQL databases from

Microsoft Access. Except for #4, the others are uncommon and are

crosstab/SQL database specific. Crosstab queries are not SQL standard,

and are not generally supported on SQL database servers. However, if

the rules above are not violated (which is the case for most simple

crosstab queries), Microsoft Access can reformulate the query as a

standard GROUP BY query, send it remotely, return only the aggregation

result, and transform it into a crosstab locally.

Open-ended restrictions do not use indexes on SQL databases.

Typically, a SQL WHERE clause reading

   WHERE col1 > 1000

will be slower than

   WHERE col1 between 1000 and 1000000000

This is a server problem, not a Microsoft Access problem, but it can

affect Microsoft Access performance when a SQL database is used as a

back end.

When you are using wildcard characters, take special care to ensure

that the correct wildcards are used. SQL Server supports the use of %

and _ rather than ? and * for wildcards. For more information, query

on the following words in the Microsoft Knowledge Base:

   parameter and queries and wildcards and SQL

Additional reference words: 1.00 1.10 2.00 SQL server attach query


INF: Calling RegQueryValue() to get an OLE Object Class Name

 Article Number: Q99322

 CREATED: 26-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The RegQueryValue() function, found in the Microsoft Windows SHELL.DLL

file, uses an OLE ClassKey (such as PBRUSH or MSGRAPH) to obtain

the information about that class from the REG.DAT file.

This article describes the way the RegQueryValue() function obtains the

Object Class Name from the OLE Registration Database REG.DAT file.

Although only the procedure to obtain the Object Class Name is described

here, other information, including the current location of the OLE

server and the types of <Primary VERBS> available to the object, is

also available.

MORE INFORMATION

NOTE: In the following sample code, an underscore (_) is used as a

line-continuation character. Remove the underscore when re-creating

this code in Access Basic.

   Declare Function RegQueryValue Lib "shell" (ByVal hkey&,_

      ByVal SubKeyStr$, ByVal QueryStr$, Buffsize&) As Long

   Function GetObjectName$ (TheClassKey$)

      Dim ClassName$

      ClassName$ = Space$(255)

      X& = CLng(Len(ClassName$))

      cb = RegQueryValue(1, TheClassKey$, ClassName$, X&)

      GetObjectName$ = ClassName$

   End Function

The sample function above declares a string to pass as a parameter for a

return value in the RegQueryValue() function. RegQueryValue() has the

following four parameters:

   HKEY:        The handle to a key that defines what type of

                information you want to retrieve

   lpszSubKey:  A string that contains the OLE ClassKey that you want

                to look up

   lpszValue:   A string in which to place the resulting value

   lpcb:        The maximum length of the resulting string

To use the sample function GetObjectName(), create a control on a form with

the following properties:

   ControlName: <ObjName>

   ControlSource: =GetObjectName ("PBRUSH")

Any appropriate OLE ClassKey in the REG.DAT OLE database can be passed

to the function.

REFERENCES

==========

For more information on finding the ClassKey of an embedded object, query

on article Q99319 here in the Microsoft Knowledge Base.

Microsoft Windows "Programmer's Reference," version 3.1, Volume 2,

page 282

Additional reference words: 1.00 1.10 2.00 classname class key checkpage


PRB: Paradox Character Translation Different in Win 3.0 & 3.1

 Article Number: Q99397

 CREATED: 27-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - Microsoft Windows versions 3.0 and 3.1

---------------------------------------------------------------------

SYMPTOMS

When you are importing, attaching, or exporting Paradox tables,

certain characters translate differently when you are using Microsoft

Windows version 3.0 instead of version 3.1.

CAUSE

Windows 3.0 and 3.1 use different versions of the Windows application

programming interface (API) function OemToAnsi().

STATUS

This behavior is by design in Windows 3.0 and 3.1.

MORE INFORMATION

When importing Paradox data, Windows 3.0 translates ASCII characters 246,

251, and 256 differently than Windows 3.1. The differences are shown in the

table below:

   ASCII    Windows 3.0    Windows 3.1

   -----------------------------------

   246 ÷       95 _           247 ÷

   249 ·      183 ·           149 o

   254 o      168 Ï           95 _

Paradox is manufactured by Ansa Software, a Borland company, a vendor

independent of Microsoft; we make no warranty, implied or otherwise,

regarding this product's performance or reliability.

Additional reference words: 1.00 1.10 2.00 Importing/Exporting


INF: Formatting a Label for Each Axis of a Graph

 Article Number: Q99398

 CREATED: 27-MAY-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - Microsoft Graph versions 3.0 and 5.0

---------------------------------------------------------------------

SUMMARY

The Microsoft Access GraphWizard does not give users the option to

format a label for each axis of the graph. You can modify the labels

in Microsoft Graph, but this change is not permanent. The next time

the graph is updated, the formatting is lost.

This article describes the steps to change the format permanently by

modifying the information that Microsoft Access sends to Microsoft

Graph.

MORE INFORMATION

When a graph is created using GraphWizard, a SQL statement is built.

This statement is placed in the RowSource property of the graph

object. Each time the form or report in which the graph resides is

refreshed, the SQL statement is re-executed and the results are sent

to Microsoft Graph.

This SQL statement can be modified by the user. We recommend that you

copy it to a new query, where you can test your changes.

The example below describes the steps to change the format of the

labels in a graph:

Procedure A - Create the Graph

------------------------------

For Microsoft Access 2.0:

1. Open the sample database NWIND.MDB. In the Database window, select

   the Orders table.

2. Choose the New Form button on the toolbar to create a new form.

3. Choose FormWizards. Select Graph and then choose OK.

4. Select the Order Date field from the Available Fields list and

   choose the right arrow to add it to the Fields for Graph list.

5. Repeat step 4 for Freight, then choose Next four times to accept

   the default (Group [Order Date] by: Year).

6. Choose Finish.

Note that the labels for the axes are: 1991, 1992, 1993, 1994

For Microsoft Access versions 1.0 and 1.1:

1. Open the sample database NWIND.MDB. In the Database window, select

   the Orders table.

2. On the Toolbar, choose the Forms button to create a new form.

3. Choose FormWizards. Select Graph and then choose OK.

4. To accept the defaults, press Next when the following message

   appears: "Which type of graph do you want?"

5. Select the Order Date field from the Available Fields list and

   choose the right arrow to add it to the Fields for Graph list.

6. Repeat step 5 for Freight, then choose Next twice to accept

   the default (Group [Order Date] by: Year). Choose Open.

   Note that the labels for the axes are: 1989, 1990, 1991, 1992

Procedure B - Changing the Label Format

---------------------------------------

For Microsoft Access 2.0:

1. Open your form in Design view.

2. Select the graph. If the property sheet is not displayed, choose

   Properties from the View menu.

3. With your right mouse button, click the RowSource property and choose

   Build.

4. Change the field Year([Order Date]) to Format([Order Date],"YY").

   Execute the query to verify that the years in the Order Date column are

   formatted as follows: 89, 90, 91, 92.

5. Close the query and save the changes.

6. Switch to Form view. The labels of the axes should now read as

   follows: 91, 92, 93, 94.

For Microsoft Access versions 1.0 and 1.1:

 1. Switch to Design view. Select the chart object and display the

    property sheet.

 2. Place your insertion point in the RowSource property and press

    SHIFT+F2 to open the Zoom window.

 3. Highlight the entire SQL Statement to select it. Press CTRL+C to

    copy it to the Clipboard.

 4. Create a new query by choosing the Query button on the Toolbar.

 5. From the View menu, choose SQL.

 6. Highlight all the text in the SQL dialog box to select it. Press

    CTRL+V to replace the existing text with the Clipboard contents.

 7. Choose OK. The fields [Order Date] and [Order Amount] are placed in

    the query grid.

 8. Change the field Year([Order Date]) to Format([Order Date],"YY").

    Execute the query to verify that the years in the Order Date column are

    formatted as follows: 89, 90, 91, 92.

 9. Switch to Design view. Copy the contents of the SQL dialog box

    to the Clipboard.

10. Return to the form. Select the chart object and paste the

    contents of the Clipboard into the RowSource property.

11. Switch to Form view. The labels of the axes should now read as

    follows: 89, 90, 91, 92.

Additional reference words: 1.00 1.10 2.00 chart ole embed requery label


PRB: Erroneous Characters Appear in Imported dBASE IV Database

 Article Number: Q99399

 CREATED: 27-MAY-1993

 MODIFIED: 15-SEP-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Erroneous characters, specifically Chr(236) and Chr(10), appear

approximately every 65th character in a memo field of an imported

dBASE IV database.

CAUSE

This behavior is inherent in the dBASE IV data. dBASE IV uses these

characters so that its memo editor word wraps automatically. The dBASE

IV memo editor has a fixed line length of 65 characters; the mechanism

is stored in the data so the memo editor does not have to force the

word wrap.

RESOLUTION

Using the code and procedure provided below, you can remove these

characters without damaging the data, even if you want to eventually

export the data back to dBASE IV.

MORE INFORMATION

1. Copy the following code into a new module in your database:

   Sub DB4MemoFix (TableName As String, FieldName As String)

      Dim D As Database, T As Table

      Set D = CurrentDB()

      Set T = D.OpenTable(TableName)

      T.MoveFirst

      Do Until T.EOF

         If T(FieldName) <> "" Then

            oldmemo$ = Trim(T(FieldName))

            newmemo$ = ""

            For i = 1 To Len(oldmemo$)

               If Mid(oldmemo$, i, 2) = (Chr(236) & Chr(10)) Then

                  i = i + 1

               Else

                  newmemo$ = newmemo$ & Mid(oldmemo$, i, 1)

               End If

            Next

            T.Edit

            T(FieldName) = newmemo$

            T.Update

         End If

         T.MoveNext

      Loop

      D.Close

      Debug.Print

      Debug.Print "Done"

   End Sub

2. From the File menu, choose Save.

3. From the View menu, choose Immediate Window.

4. Type the following

      DB4MemoFix <tablename>, <fieldname>

   where <tablename> is the name of the imported dBASE IV table and

   <fieldname> is the name of the memo field that contains the

   erroneous characters. For example:

      DB4MemoFix "CUST", "NOTES"

   Once the process is completed, the word "Done" will appear in the

   Immediate window and the erroneous characters will have been

   removed.

dBASE IV is manufactured by Borland International, Inc., a vendor

independent of Microsoft; we make no warranty, implied or otherwise,

regarding this product's performance or reliability.

Additional reference words: 1.00 1.10 strange


INF: Using a Conditional Macro to Confirm Changes to a Field

 Article Number: Q99400

 CREATED: 27-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to prompt the user to confirm changes to a

field using a conditional macro.

MORE INFORMATION

This following procedure uses the Employees form in the sample

database NWIND.MDB:

1. Create the following new macro by choosing the Macro button in the

   Database window and then choosing New:

   Macro Name  Condition                      Action       Defined Below

   ---------------------------------------------------------------------

   AreYouSure  MsgBox("Commit changes?",1)=2  CancelEvent        1.

                     ...                      SendKeys           2.

     AreYouSure Actions

     ------------------

     1. CancelEvent

     2. SendKeys

           Keystrokes: {esc}

           Wait: NO

   NOTE: The ellipsis in the Condition column forces Microsoft Access

   to perform the action on that line if the condition on the

   preceding line is true. Microsoft Access evaluates macro conditions

   as true or false. If the expression is true, Microsoft Access

   performs the action; if it is false, Microsoft Access ignores the

   action.

2. Save the macro as AreYouSure.

3. Open the Employees Form in Design view by choosing the Form button

   in the Database window, selecting the Employees form, and choosing

   the Design button.

4. From the View menu, choose Property to display the property sheet.

5. Select the [Hire Date] text box control to display its properties.

6. Set the properties for the Employees form and [Hire Date] text box

   control as follows:

      Form:  Employees

         Caption:  Employees Form

         ControlSource:  Employees

      Text box: Hire Date

         ControlName:  Hire Date

         ControlSource:  Hire Date

         Before Update:  AreYouSure

7. From the View menu, choose Form. When the date in the [Hire Date]

   field is edited, a confirmation message appears. Choose

   OK to confirm your change, or Cancel to cancel your change.

NOTE: This example uses the MsgBox statement instead of the MsgBox

action. The MsgBox action has only an OK Button, whereas the MsgBox

statement can also include a Cancel button.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 316-320

Microsoft Access "User's Guide," version 1.0, pages 528-554

Additional reference words: 1.00 1.10 2.00 forms macros data validation


INF: How First Line of Data is Used to Import Delimited Text

 Article Number: Q99401

 CREATED: 27-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The first line of data is extremely important when you are importing

delimited text files. Microsoft Access uses the first line of data to

determine the following:

 - The number of fields

 - The data type for each field

For this reason, it is important to verify that the first line of data

correctly reflects the rest of the data in the table. This article

discusses some of the common problems you may encounter when the first

line of data is incorrect and how to work around these problems.

MORE INFORMATION

To specify the structure that Microsoft Access should use, you can use

the following steps instead of relying on the first line of data:

1. Create a table in Microsoft Access that has the correct number of

   fields and the correct data type for each field.

2. From the File menu, choose Import.

3. Select Text (Delimited) from the Data Source list and choose OK.

4. Select the text file and choose OK.

5. In the Import Text Options dialog box, choose Append To Existing

   Table and specify the table you created in step 1.

6. Choose OK to import the file.

Determining the Number of Fields

--------------------------------

Microsoft Access scans the first line of data to determine the number

of fields in the text file. If successive records contain more fields,

these are ignored and no error message is given. For example, suppose

you have a text file that looks like the following:

   5959,"John Doe","123 Main Street"

   5960, "George Brown","55 Orange Avenue","MainTown","WA","USA"

Because the first line only contains three fields, Microsoft Access

creates the following table:

   Column 1     Column 2          Column 3

   -----------------------------------------------

   5959         John Doe          123 Main Street

   5960         George Brown      55 Orange Avenue

Note that the additional fields are ignored and no error message is

generated.

Determining the Data Types

--------------------------

Microsoft Access scans the first line to determine the data type for

each field. If the data type in the field is invalid, a "Type

Conversion Failure" error message is generated in the Import Errors

table. For example, if the following text file is imported

   5959,"John Doe","123 Main Street",8/12/90

   5960,"George Brown","55 Orange Avenue",81290

   ABCD,"Jane Bell","78 West Street",8/12/90

Microsoft Access detects four fields with the following data types:

   Field      Data Type

   --------------------

   1          Number

   2          Text

   3          Text

   4          Date/Time

The second record fails to convert because the number 81290 in the

fourth field is not a Date/Time data type, as determined by the first

record value (8/12/90). The third record fails because "ABCD" in the

first field is not a number. As a result, Microsoft Access reports

type conversion errors in each case.

Other Workarounds

-----------------

In addition to import appending the text file to an existing table, it

is also possible to use a text editor to edit the first line of data

to correctly reflect the number of fields and data types in the file.

If a field in the first row contains a number that is supposed to

belong in a text field, type double quotation marks around the number

in the first row. Microsoft Access will then correctly interpret the

field as a text field.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 72-79

Additional reference words: 1.00 1.10 2.00 import


PRB: Incorrect Btrieve Error Message, [Btrieve ISAM] section

 Article Number: Q99402

 CREATED: 27-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The following incorrect error message may be returned when you attempt

to attach or import a Btrieve file:

   Invalid entries in [Btrieve ISAM] section in WIN.INI

CAUSE

This error message is generated when Microsoft Access tries to attach

or import a Btrieve file and the settings in the [Btrieve]--not the

[Btrieve ISAM]--section of the WIN.INI file are incorrect.

RESOLUTION

Search for the [Btrieve] section in the WIN.INI file instead of the

[Btrieve ISAM] section.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

Btrieve is manufactured by Novell, Inc., a vendor independent of Microsoft;

we make no warranty, implied or otherwise, regarding this product's

performance or reliability.

Additional reference words: 1.00 1.10


INF: Sending a MAPI Mail Message Using Access Basic

 Article Number: Q99403

 CREATED: 27-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The following example includes a Microsoft Access module that

demonstrates how to send a Mail Application Programming Interface

(MAPI) message to multiple TO recipients and carbon copies (CC).

MORE INFORMATION

The following procedure explains how to use this sample module:

1. Create a form with the following controls:

   Form:  Test

   -----------

   Caption:  TestForm

   Text box:  Subject

      ControlName:  Subject

   Text box:  To

      ControlName:  To

   Text box:  CC

      ControlName:  CC

   Text box:  Attach

      ControlName:  Attach

   Text box:  Message

      ControlName:  Message

   Command button: Button0

      Caption: Send Message

      OnPush: =Mail()

2. Open either a new module or a previously created module and enter

   the following code:

   NOTE: In the following sample code, an underscore (_) is used as a

   line continuation character for easier reading. Remove the

   underscore when re-creating this code in Access Basic.

'*************************************************************

'Declarations section of the module.

'*************************************************************

Option Explicit

Option Compare Database   'Use database order for string comparisons

Type MAPIMessage

   Reserved As Long

   Subject As String

   NoteText As String

   MessageType As String

   DateReceived As String

   ConversationID As String

   Flags As Long

   RecipCount As Long

   FileCount As Long

End Type

Type MapiRecip

   Reserved As Long

   RecipClass As Long

   Name As String

   Address As String

   EIDSize As Long

   EntryID As String

End Type

Type MapiFile

   Reserved As Long

   Flags As Long

   Position As Long

   PathName As String

   FileName As String

   FileType As String

End Type

Declare Function MAPISendMail Lib "MAPI.DLL" Alias "BMAPISendMail" _

(ByVal Session&, ByVal UIParam&, Message As MAPIMessage, Recipient _

As MapiRecip, File As MapiFile, ByVal Flags&, ByVal Reserved&) As Long

Global Const SUCCESS_SUCCESS = 0

Global Const MAPI_TO = 1

Global Const MAPI_CC = 2

Global Const MAPI_LOGON_UI = &H1

'*************************************************************

' End of declarations section

'*************************************************************

'*************************************************************

' FUNCTION NAME: Mail

'

' PURPOSE:

'   Passes information on the active forms To, Subject, CC,

'   Attach, and Message text boxes to the SendMail function.

'   It ensures that each box does not have a NULL value. It also

'   displays an error message if SendMail fails.

'   This function is called from the OnPush property of the form.

'

' INPUT PARAMETERS:

'   None

'

' RETURN

'   None

'*************************************************************

Function Mail ()

   Dim F As Form, Result

   Set F = Screen.ActiveForm

   ' Make sure user has something in the To: box

   If IsNull(F!To) Or F!To = "" Then Exit Function

   ' Make sure no Null values are in the other boxes

   If IsNull(F!Subject) Then F!Subject = ""

   If IsNull(F!CC) Then F!CC = ""

   If IsNull(F!Attach) Then F!Attach = ""

   If IsNull(F!Message) Then F!Message = ""

   ' Send the message, passing information from the form

   Result = SendMail((F!Subject), (F!To), (F!CC),_

               (F!Attach), (F!Message))

   ' Test the result for any errors

   If Result <> SUCCESS_SUCCESS Then

      MsgBox "Error sending mail: " & Result, 16, "Mail"

   Else

      MsgBox "Message sent successfully!", 64, "Mail"

   End If

End Function

'*************************************************************

' FUNCTION NAME: SendMail

'

' PURPOSE:

'   This is the front-end function to the MAPISendMail function. You

'   pass a semicolon-delimited list of To and CC recipients, a

'   subject, a message, and a delimited list of file attachments.

'   This function prepares MapiRecip and MapiFile structures with the

'   data parsed from the information provided using the ParseRecord

'   sub. Once the structures are prepared, the MAPISendMail function

'   is called to send the message.

'

' INPUT PARAMETERS:

'   sSubject: The text to appear in the subject line of the message

'   sTo:      Semicolon-delimited list of names to receive the

'             message

'   sCC:      Semicolon-delimited list of names to be CC'd

'   sAttach:  Semicolon-delimited list of files to attach to

'             the message

' RETURN

'   SUCCESS_SUCCESS if successful, or a MAPI error if not.

'*************************************************************

Function SendMail (sSubject As String, sTo As String, sCC As String, _

                   sAttach As String, sMessage As String)

   Dim i, cTo, cCC, cAttach          ' variables holding counts

   Dim MAPI_Message As MAPIMessage

   ' Count the number of items in each piece of the mail message

   cTo = CountTokens(sTo, ";")

   cCC = CountTokens(sCC, ";")

   cAttach = CountTokens(sAttach, ";")

   ' Create arrays to store the semicolon delimited mailing

   ' .. information after it is parsed

   ReDim rTo(0 To cTo) As String

   ReDim rCC(0 To cCC) As String

   ReDim rAttach(0 To cAttach) As String

   ' Parse the semicolon delimited information into the arrays.

   ParseTokens rTo(), sTo, ";"

   ParseTokens rCC(), sCC, ";"

   ParseTokens rAttach(), sAttach, ";"

   ' Create the MAPI Recip structure to store all the To and CC

   ' .. information to be passed to the MAPISendMail function

   ReDim MAPI_Recip(0 To cTo + cCC  - 1) As MapiRecip

   ' Setup the "TO:" recipient structures

   For i = 0 To cTo - 1

      MAPI_Recip(i).Name = rTo(i)

      MAPI_Recip(i).RecipClass = MAPI_TO

   Next i

   ' Setup the "CC:" recipient structures

   For i = 0 To cCC - 1

      MAPI_Recip(cTo + i).Name = rCC(i)

      MAPI_Recip(cTo + i).RecipClass = MAPI_CC

   Next i

   ' Create the MAPI File structure to store all the file attachment

   ' .. information to be passed to the MAPISendMail function

   ReDim MAPI_File(0 To cAttach) As MapiFile

   ' Setup the file attachment structures

   MAPI_Message.FileCount = cAttach

   For i = 0 To cAttach - 1

      MAPI_File(i).Position = -1

      MAPI_File(i).PathName = rAttach(i)

   Next i

   ' Set the mail message fields

   MAPI_Message.Subject = sSubject

   MAPI_Message.NoteText = sMessage

   MAPI_Message.RecipCount = cTo + cCC

   ' Send the mail message

   SendMail = MAPISendMail(0&, 0&, MAPI_Message, MAPI_Recip(0), _

                  MAPI_File(0), MAPI_LOGON_UI, 0&)

End Function

'*************************************************************

' FUNCTION NAME: CountTokens

'

' PURPOSE:

'   Given a string of delimited items and the delimiter, the number

'   of tokens in the string will be returned. This function is useful

'   for dimensioning an array to store the delimited items prior to

'   calling ParseTokens.

'

' INPUT PARAMETERS:

'   sSource: A delimited list of tokens

'   sDelim:  The delimiter used to delimit sSource

'

' RETURN

'   The number of tokens in sSource, which is the number of delimiters

'   plus 1. If sSource is empty, 0 is returned.

'*************************************************************

Function CountTokens (ByVal sSource As String, ByVal sDelim As String)

   Dim iDelimPos As Integer

   Dim iCount As Integer

   ' Number of tokens = 0 if the source string is empty

   If sSource = "" Then

      CountTokens = 0

   ' Otherwise number of tokens = number of delimiters + 1

   Else

      iDelimPos = InStr(1, sSource, sDelim)

      Do Until iDelimPos = 0

         iCount = iCount + 1

         iDelimPos = InStr(iDelimPos + 1, sSource, sDelim)

      Loop

      CountTokens = iCount + 1

   End If

End Function

'*************************************************************

' FUNCTION NAME: GetToken

'

' PURPOSE:

'   Given a string of delimited items, the first item will be

'   removed from the list and returned.

'

' INPUT PARAMETERS:

'   sSource: A delimited list of tokens

'   sDelim:  The delimiter used to delimit sSource

'

' RETURN

'   sSource will have the first token removed. The function

'   returns the token removed from sSource.

'*************************************************************

Function GetToken (sSource As String, ByVal sDelim As String) _

As String

   Dim iDelimPos As Integer

   ' Find the first delimiter

   iDelimPos = InStr(1, sSource, sDelim)

   ' If no delimiter was found, return the existing string and set

   ' .. the source to an empty string.

   If (iDelimPos = 0) Then

      GetToken = Trim$(sSource)

      sSource = ""

   ' Otherwise, return everything to the left of the delimiter and

   ' .. return the source string with it removed.

   Else

      GetToken = Trim$(Left$(sSource, iDelimPos - 1))

      sSource = Mid$(sSource, iDelimPos + 1)

   End If

End Function

'*************************************************************

' SUB NAME: ParseTokens

'

' PURPOSE:

'   Extracts information from a delimited list of items and places

'   it in an array.

'

' INPUT PARAMETERS:

'   Array(): A one-dimensional array of strings in which the parsed tokens

'            will be place

'   sTokens: A delimited list of tokens

'   sDelim:  The delimiter used to delimit sTokens

'

' RETURN

'   None

'*************************************************************

Sub ParseTokens (Array() As String, ByVal sTokens As String, ByVal _

                 sDelim As String)

   Dim i As Integer

   For i = LBound(Array) To UBound(Array)

      Array(i) = GetToken(sTokens, sDelim)

   Next

End Sub

REFERENCES

==========

Microsoft Mail "Technical Reference," Chapter 4

Additional reference words: 1.00 1.10 2.00 mail application programming


PRA: SQL Delete Triggers Function Incorrectly

 Article Number: Q99404

 CREATED: 27-MAY-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

Microsoft Access appears to delete a record in an attached

SQL table,

but the record is not actually deleted. The record will

reappear when

you requery the table.

CAUSE

The Microsoft SQL Server driver that comes with Microsoft

Access

version 1.0 incorrectly indicates that the result of the SQL

delete

action is successful.

RESOLUTION

To correct this problem, you must DROP the current trigger

and CREATE

a new delete trigger on the SQL Server that uses the

RAISERROR command

instead of the PRINT command. This method causes Microsoft

Access version

1.0 to not delete the record and display the following error

messages:

   ODBC - delete failed.

   [Microsoft][ODBC SQL Server Driver][SQL Server] <MESSAGE>

(#-31073)

where <MESSAGE> is the message you specified in the

RAISERROR command.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0. This problem was corrected in Microsoft Access

version

1.1.

MORE INFORMATION

If you try to delete a record from an attached SQL table

that has a

delete trigger that performs a ROLLBACK and a PRINT action

on the SQL

Server, Microsoft Access version 1.0 appears to delete the

record and

then displays a message box asking you to verify your

deletion. The

record is actually not deleted and reappears when you

requery the

table by pressing SHIFT+F9, choosing Show All Records from

the Records

Menu, or closing and reopening the table.

In Microsoft Access version 1.1, the RAISERROR method works

the same

way that it does in version 1.0. The PRINT method works

similarly to

the way it does in version 1.0.

In version 1.0, the PRINT method appears to let you delete

the record

without a warning, then later the record reappears. In

version 1.1,

the PRINT method still does not display the message

specified by the

PRINT command; however, it does not remove the record, and

it does

display the following error message:

   ODBC - call failed.

Steps to Reproduce Problem

--------------------------

1. Create a trigger on a SQL Server table that uses the SQL

commands

   ROLLBACK and PRINT.

2. Attach the SQL table that the delete trigger was created

for by

   choosing Attach from the File menu.

3. Once the table is attached, open it in Datasheet view.

4. Select a record by clicking the gray record selector to

the left of

   the record or by choosing Select Record from the Edit

menu.

5. Delete the record by pressing the DEL key or by choosing

Delete

   from the Edit menu.

6. Choose Yes in the Confirmation dialog box that is

displayed.

The record appears to be deleted from the table. Requery the

table

by pressing SHIFT+F9. The record reappears.

REFERENCES

==========

"Microsoft SQL Server Language Reference," version 4.2,

pages 88-93,

137, 203-204, and 214-216

Additional reference words: 1.00 ODBC


INF: Part 2, DDE in Visual Basic to Request Data from Access

 Article Number: Q99405

 CREATED: 27-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This is the second in a series of two articles containing an advanced

example that demonstrates how to use Visual Basic to request data from

Microsoft Access by using dynamic data exchange (DDE).

MORE INFORMATION

The following Visual Basic example demonstrates how to use DDE to

request information by using SQL statements and the rich set of items

supported by Microsoft Access to navigate tables. Further, a

subroutine that assists in parsing data from the tab-delimited records

that are requested is provided.

Specifically, the example does the following:

1. Gets the number of records and fields in the table using the

   "FirstRow" and "FieldCount" items.

2. Creates an array to store the records when they are retrieved.

3. Requests the data from a table, one record at a time, using the

   "FirstRow" and "NextRow" items.

4. Requests a list of field names using the "FieldNames" item.

5. Uses a subroutine to parse each tab-delimited record requested from

   Access and places the data in the array mentioned above. (A separate

   array holds the field names).

6. This step is optional. Once all the data is placed in the array, a

   Visual Basic grid control will be populated with the array contents.

   Further, the grid columns will be populated with the names of the

   fields.

When you run this example, be sure that Access is running and the

sample database NWIND.MDB is open.

To use this example, create a new Visual Basic program with a text

box, a command button, and a grid control with the following

properties:

   Text Box

   --------

      Name: Text1

   Command Button

   --------------

      Name: Command1

   Grid

   ----

      Name: Grid1

NOTE: The grid control is available in the Professional Toolkit for

Visual Basic version 1.0 and ships with version 2.0 of the

Professional Edition of Microsoft Visual Basic for Windows.

Double-click the command button and type the code that follows between

the Sub Command1_Click () and End Sub lines.

NOTE: In the following sample code, an underscore (_) is used as a

line-continuation character. Remove the underscore when re-creating

this code in Access Basic.

   Dim CntRows, CntCols As Integer ' Row and column count in the table

   Dim Row, Col As Integer         ' Current row/column being filled.

   Dim Record As String            ' Record read from employees table.

   ' Get the number of records in the Employees Table

   Text1.LinkTopic = "MSACCESS|NWIND;SQL Select Count(*) As _

      EmployeeCount From Employees;"

   Text1.LinkItem = "FirstRow"   ' Setup to get the first row of data

   Text1.LinkMode = 2            ' Establish a manual link

   Text1.LinkRequest             ' Request the data into the Text1

   Text1.LinkMode = 0            ' Terminate the link

   CntRows = Val(Text1.Text)     ' Convert the result to a number

   ' Establish a DDE Link to the Employees table

   Text1.LinkTopic = "MSACCESS|NWIND;SQL Select * From Employees;"

   Text1.LinkMode = 2            ' Establish a manual link

   ' Get the number of columns in the Employees Table

   Text1.LinkItem = "FieldCount" ' Setup to get count of fields/cols

   Text1.LinkRequest             ' Request the data into Text1

   CntCols = Val(Text1.Text)     ' Convert the result to a number

   ' Create the arrays to hold employee information and field names.

   ReDim Employees(CntRows, CntCols) As String

   ReDim FieldNames(1, CntCols) As String

   ' Get the field names in the Employees table from Access

   Text1.LinkItem = "FieldNames" ' Setup to get the field names

   Text1.LinkRequest             ' Request the data into Text1

   ' Parse the tab delimited list of field names and copy it into the

   ' .. FieldNames array. (ParseRecord subroutine is listed latter)

   ParseRecord FieldNames(), 1, (Text1.Text)

   ' Request each tab delimited record of data one at a time.

   For Row = 1 To CntRows

      If Row = 1 Then

         Text1.LinkItem = "FirstRow"  ' Setup for the first record

      Else

         Text1.LinkItem = "NextRow"   ' Setup for the next record

      End If

      Text1.LinkRequest          ' Request the data into Text1

      ' Parse the tab delimited record and store it in Employees array

      ParseRecord Employees(), Row, (Text1.Text)

   Next Row

   Text1.LinkMode = 0  ' Terminate link, arrays are filled with data

   ' OPTIONAL: The following code populates a grid control with the

contents

   '           of the Employees and FieldNames arrays.

   ' Setup the Grid with the correct number of Rows and Cols

   Grid1.Rows = CntRows + 1      ' Add 1 for the row selector buttons

   Grid1.Cols = CntCols + 1      ' Add 1 for the column header buttons

   ' Fill the Grid column header with the data in the FieldNames array

   Grid.Row = 0                  ' Move to the column header row

   For Col = 1 To CntCols

      Grid.Col = Col                   ' Move to the column

      Grid.Text = FieldNames(1, Col)   ' .. and fill it with data

   Next Col

   ' Fill the Grid control rows with the data in the Employees array

   For Row = 1 To CntRows

      Grid.Row = Row                    ' Move to the row

      For Col = 1 To CntCols

        Grid.Col = Col                  ' Move to the column

        Grid.Text = Employees(Row, Col) ' Fill it with array data

      Next Col

   Next Row

   End Sub

The following subroutine, ParseRecord, is used to extract the tab-

delimited data from a record and place the data in an array in the

specified row. The subroutine takes the following three arguments:

   Array()  - A two-dimensional array of strings to store data into.

   Row      - The row position in the array to store the parsed data.

   Record   - A string with tab delimited information to parse.

Create a new module in Visual Basic with the following subroutine:

Sub ParseRecord (Array() As String, ByVal Row As Integer, _

   ByVal Record As String)

   Dim Start As Integer    ' Start position of field in record

   Dim TabStop As Integer  ' Position in the record of the next tab.

   Dim CntCols As Integer  ' The number of columns in the Array

   Dim Col As Integer      ' The current column (field) being parsed

   CntCols = UBound(array, 2)   ' Get count of columns in the array

   Start = 1       ' Start parsing with first character

   ' Find the first tab stop (ASCII character 9) in the record.

   TabStop = InStr(Start, Record, Chr$(9), 0)

   ' Loop until we fill up all but the last column (Col < CntCols)

   ' .. or until there are no more columns to read (TabStop <> 0 means

   ' .. that no tab was found)

   Col = 1

   While Col < CntCols And TabStop <> 0

      ' extract the field from the string and store it in the array

      Array(Row, Col) = Mid$(Record, Start, TabStop - Start)

      Start = TabStop + 1        ' Increment start to next tab stop

      TabStop = InStr(Start, Record, Chr$(9), 0) ' Find next tab stop

      Col = Col + 1              ' Increment to next column in array

   Wend

   Array(Row, CntCols) = Mid$(Record, Start)  ' Get last col of data

End Sub

Additional reference words: 1.00 1.10 2.00 part two vb b_vbasic


PRB: Error Message When Importing Informix Delimited Text File

 Article Number: Q99406

 CREATED: 27-MAY-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you attempt to import an Informix delimited text file that uses

the pipe (|) symbol as a delimiter, you receive the following error

message:

   Name " contains invalid characters

CAUSE

When you export in Informix as text delimited and you specify the pipe

symbol as the delimiter, Informix adds an extra pipe symbol at the end

of the line. When you import this file to Microsoft Access by

specifying "First row contains field names," Microsoft Access assumes

there is another field after the last pipe symbol. Since the value is

null, Microsoft Access returns the above error message.

RESOLUTION

 - Open the file in a text editor and add a dummy name after the last pipe

   symbol. After you import the file, you can delete this dummy field.

 - Clear the First Row Contains Field Names check box when you import the

   file. After you import the file, delete the first row of the table

   (which contains the field names instead of data). Then, switch to Design

   view and modify the table's field names.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a text file in Microsoft Windows Notepad as follows:

      A|B|C|

      1|2|3|

   Place a pipe symbol between each character. The pipe symbol is

   usually found on the backslash (\) key on your keyboard.

2. Save the file as INFORMIX.TXT.

3. Open a database in Microsoft Access.

4. From the File menu, choose Import.

5. Select Text (delimited) as your data source and choose Import.

6. Select the INFORMIX.TXT file that you created in step 1. Choose OK.

7. The Import Options dialog box appears. Select the First Row

   Contains Field Names check box, then choose the Options button.

8. In the Field Separator combo box, type the pipe symbol and choose

   OK. The above error message appears.

Informix is manufactured by Informix Software, Inc., a vendor

independent of Microsoft; we make no warranty, implied or otherwise,

regarding this product's performance or reliability.

Additional reference words: 1.00 1.10 2.00 Import\Export Informix


INF: How to Execute Macro Actions Using DDE

 Article Number: Q99407

 CREATED: 27-MAY-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.1

---------------------------------------------------------------------

SUMMARY

Microsoft Access supports the execution of certain macro actions over a

dynamic data exchange (DDE) channel.

MORE INFORMATION

The only macro actions that you can execute over a DDE channel to

Microsoft Access are those supported by the DoCmd() function in Access

Basic. For this reason, the following macro actions cannot be executed:

   AddMenu

   MsgBox

   RunApp

   RunCode

   SendKeys

   SetValue

   StopAllMacros

   StopMacro

The syntax for macro actions executed through DDE is the same as the

syntax for macro actions called by the DoCmd() function, that is:

   MacroActionName Argument1,Argument2,...,ArgumentN

You cannot use the predefined constants that are available inside Access

Basic, such as A_NORMAL, as arguments when you are executing macro

actions with DDE. Instead, you must use the actual values of the

constants. The values of the constants can be determined using the

following procedure:

1. Open a macro in Design view.

2. Select the macro action you want to use from the list of macro

   actions in the Action column.

3. In the Action Arguments section, locate the argument for which you

   need to supply a value.

4. In the list box associated with that argument, locate the option

   that you want to use.

5. Count down the list, starting at zero (0), until you reach that

   option.

The number you count to to reach the option is the number you need to

supply as the argument when you execute the macro over a DDE channel.

The following example creates a macro in Microsoft Excel that

demonstrates how to execute macro actions in Microsoft Access using DDE:

NOTE: This macro will not work in Microsoft Access version 1.0.

1. Open Microsoft Access.(This macro only works if Microsoft Access is

   already running.)

2. Open a new macro sheet in Microsoft Excel. Enter the following

   macro:

      Cell    Command

      --------------------------------------------------

      A1     MacroActionDDE

      A2

      A3    chan=INITIATE("MSACCESS","SYSTEM")

      A4    =APP.ACTIVATE("Microsoft Access",FALSE)

      A5    =EXECUTE(chan,"[opendatabase nwind.mdb]")

      A6    =EXECUTE(chan,"[beep]")

      A7    =EXECUTE(chan,"[openform categories,,,,,2]")

      A8    =EXECUTE(chan,"[beep]")

      A9    =EXECUTE(chan,"[openform categories]")

      A10   =EXECUTE(chan,"[close]")

      A11   =EXECUTE(chan,"[closedatabase]")

      A12   =TERMINATE(chan)

      A13   =APP.ACTIVATE(,FALSE)

      A14   =RETURN()

3. Size your Microsoft Access and Microsoft Excel windows so that you

   can see both applications at the same time.

4. To run the macro, select cell A3, choose Run from the Macro menu,

   and then choose OK.

The commands in cells A3 and A4 initiate a DDE channel to Microsoft

Access on the SYSTEM topic and activate the Microsoft Access application.

The command in cell A5 opens the sample database NWIND.MDB in the current

working directory using the OpenDatabase pseudo action. (Pseudo actions

are actions that are only valid over the DDE channel.)

The commands in cells A6 and A8 execute the Microsoft Access macro action

Beep.

The command in cell A7 executes the Microsoft Access macro action

OpenForm to open the Categories form in a minimized state.

The command in cell A9 executes the Microsoft Access macro action

OpenForm to open the Categories form in a normal state.

The command in cell A10 closes the currently active object in Microsoft

Access.

The command in cell A11 closes the currently opened database file using

the CloseDatabase pseudo action.

The commands in cells A12 through A14 terminate the DDE channel, activate

the Microsoft Excel application, and end the macro.

REFERENCES

==========

For more information on sending macro actions to Microsoft Access, query

on the following words here in the Microsoft Knowledge Base:

   access and dde and server and macro

Microsoft Access "Language Reference," version 1.0, pages 149-150


INF: Sending the Current Record to Word for Windows with DDE

 Article Number: Q99570

 CREATED: 02-JUN-1993

 MODIFIED: 28-DEC-1993

 VERSION(S): 1.00 1.10

-----------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

-----------------------------------------------------------

SUMMARY

This article describes the steps for creating a form that allows you

to press a button to send the current record to Microsoft Word for

Windows. The data sent is merged into a prewritten letter and printed.

The article assumes that you understand dynamic data exchange (DDE),

setting bookmarks in Word for Windows, and creating modules in

Microsoft Access.

MORE INFORMATION

NOTE: In the sample code below, an underscore is used as a

line-continuation character. Remove the underscore when re-creating

this code in Access Basic.

Step One: Create the Word for Windows Document

----------------------------------------------

1. Start Word for Windows and open a new document.

2. Type the following:

      CompanyName

      Address

      City, Region, PostalCode

      Country

   Dear ContactName,

      NorthWind Traders would like to thank you for

      your business during the past year. Enclosed

      you will find several samples of new products

      that we are excited to announce.

   Sincerely,

   NorthWind Traders.

   NOTE: Word for Windows will fail when you attempt to complete the

   merge if the field names contain spaces. If you copy text into a Word

   for Windows document, be sure to remove any and all tabs.

3. Save this document as DDEMERGE.DOC.

4. To create the bookmarks, select CompanyName and choose Bookmark

   from the Insert menu. Name the Bookmark "CompanyName" (without the

   quotation marks).

5. Repeats these steps, creating bookmarks for the fields: Address,

   City, Region, PostalCode, Country, and ContactName.

Step Two: Create The Access Basic Modules

-----------------------------------------

1. Open the sample database NWIND.MDB. (One of the following modules

   uses the function STARTAPP(), which is located in the "Introduction to

   Programming" manual.

2. Create a new module called Print Merge.

3. Place the following statement in the (declarations) section:

      Global MergeChan As Integer

      Const ID_YES = 6

4. Create a new function called Initiate_Word ().

   Function Initiate_Word ()

      Dim Chan As Variant

      Dim WordTopics As Variant

      Chan = StartApp("Winword", "System")

      On Error GoTo AlertUser:

      WordTopics = DDERequest(Chan, "Topics")

      If InStr(1, WordTopics, "DDEMERGE.DOC") = 0 Then

        DDEExecute Chan, "[FILEOPEN(""DDEMERGE.DOC"")]"

      End If

      DDETerminate Chan

      Mergechan = DDEInitiate("Winword", "DDEMERGE.DOC")

   Exit Function

   AlertUser:

      MsgBox "Access is unable to initiate a DDE _

           channel with the document DDETEST.DOC"

      Resume Next

   End Function

5. Create a new function called Send_Record().

   Function Send_Record ()

      On Error GoTo CatchBlanks

      DDEPoke Mergechan, "CompanyName",_

         Forms![Customers]![Company Name]

      DDEPoke Mergechan, "ContactName", _

         Forms![Customers]![Contact Name]

      DDEPoke Mergechan, "Address", _

         Forms![Customers]![Address]

      DDEPoke Mergechan, "City", _

         Forms![Customers]![City]

      DDEPoke Mergechan, "Region", _

         Forms![Customers]![Region]

      DDEPoke Mergechan, "PostalCode", _

         Forms![Customers]![Postal Code]

      DDEExecute Mergechan, "[FilePrint]"

      Exit Function

   CatchBlanks:

      If MsgBox("Error sending one field, it may be blank._

            Would you like to continue?", 52) = ID_YES Then

        Resume Next

      Else

        Exit Function

      End If

   End Function

6. Create a function called Terminate_MergeChan().

   Function Terminate_MergeChan ()

      DDETerminate MergeChan

   End Function

7. Choose Compile All from the Run menu and then close and save the

   module.

Step Three: Create the Form

---------------------------

1. Open the form [Customers] in Design view.

2. Set the OnOpen property of the form to:

   Form Properties

   ---------------

      OnOpen:    =Initiate_Word()

      OnClose:   =Terminate_MergeChan()

3. Add a new button to the Customers form.

   Command Button

   --------------

      Caption:   Print Letter

      OnPush:    =Send_Record()

4. Save the form and switch to Form view. Choose the Print Letter

   button.

   The current record will be sent to Word for Windows, merged into the

   document DDEMERGE.DOC and then printed.

References:

"Introduction to Programming," Chapter 9, "Dynamic Data Exchange"

"Word for Windows Technical Reference," pages 20-25

Additional reference words: 1.00 1.10 merge dde poke printmerge browse


INF: How to Order Data in a Graph

 Article Number: Q99934

 CREATED: 10-JUN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to order data in a graph more easily by changing

the graph's RowSource property to a query name, rather than using the SQL

statement that Microsoft Access generates.

MORE INFORMATION

The following steps demonstrate how to create a graph that will show all

the orders with values over $10,000, in descending order, in the Orders

table in the sample database NWIND.MDB:

1. Open the sample database NWIND.MDB.

2. Create the following new query based on the Orders table, and save

   the query as GraphQuery:

      Query: GraphQuery

      ------------------------

      Field name: Ship Name

         Show: True

      Field name: Order Amount

         Sort: Descending

         Show: True

         Criteria: >10000

3. Use the GraphWizard to create a new form based on GraphQuery.

   Select both fields for the graph.

4. Switch to Form view. Note that the orders are sorted by the Ship

   Name field.

5. From the View menu, choose Form Design. Select the graph. From the

   View menu, choose Properties to show the property sheet.

6. Change the RowSource property of the object frame, as shown below:

      Object: Object Frame

      -----------------------------

      ControlName: Embedded0

         RowSourceType: Table/Query

         RowSource: GraphQuery

7. Switch to Form view. The orders are now sorted in descending order.

Additional reference words: 1.00 1.10 2.00 queries graph wizards


PRA: Hidden Subform Maximized If Main Form Is Maximized

 Article Number: Q99935

 CREATED: 10-JUN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

In a main/subform combination where the main form is maximized and the

subform is hidden, the subform returns maximized when it is made

visible. This results in covering the entire main form.

RESOLUTION

Since the visible property is usually changed through a macro or

function, work around this problem by adding steps to the process to

restore the main form before the subform is made visible. Then,

maximize the main form. An example of this workaround is detailed

after the "Steps to Reproduce Problem" section below.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

You can reproduce this problem by using the Orders form in the

NWIND.MDB sample database. The following steps detail the macros

necessary to reproduce this problem. The resolution to this sample

problem is listed after the steps.

Steps to Reproduce Problem

--------------------------

1. Create a macro group that contains two macros. Name one "Hidden"

   and the other "Visible."

      Macro Name         Action

      ---------------------------

      Hidden             Setvalue

      Visible            Setvalue

      Hidden Macro Actions

      --------------------

      Setvalue

         Item: Forms![orders]![orders subform].Form.Visible

         Expression: 0

      Visible Macro Actions

      ---------------------

      Setvalue

         Item: Forms![orders]![orders subform].Form.Visible

         Expression: -1

2. Close and save the macro as "Show."

3. Open the Orders form and add two command buttons.

4. Set the following properties on the command buttons:

     Command Button: Button1

        Caption: Hide

        OnPush:  Show.Hidden

     Command Button: Button2

        Caption: Show

        OnPush:  Show.Visible

5. Choose View, then choose Form to open the Orders Form in Form view.

6. Maximize the Orders form by using the Maximize button in the forms

   upper-right corner.

7. Choose the Hide button to hide the subform.

8. Choose the Show button to show the subform maximized.

The main form is no longer visible.

To workaround this problem, change the Visible macro actions as

follows:

   Visible Macro Actions

   ---------------------

   Echo

      Echo On: No

   Restore

   Setvalue

      Item: Forms![orders]![orders subform].Form.Visible

      Expression: -1

   Maximize

   Echo

      Echo On: Yes

REFERENCES

==========

Microsoft Access "User's Guide," Chapter 22, "Using Macros with Forms"

Additional reference words: 1.00 1.10 Macros


PRB: Error When Opening Attached Table in Shared .MDB File

 Article Number: Q99936

 CREATED: 10-JUN-1993

 MODIFIED: 16-AUG-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you attempt to open an attached table in a shared .MDB file, one

of the following error messages may appear:

      Couldn't find file "<drive>:\<path>\<filename>"

      "<Drive>:\<path>\<filename>" isn't a valid path.

      Couldn't open file "<drive>:\<path>\<filename>"

CAUSE

The path to an attached table is hard-coded in the table properties.

For a shared .MDB file, this path is most likely invalid.

RESOLUTION

To work around this problem, either change the path to the attached

file so that it is valid or import the data.

MORE INFORMATION

To verify and correct the path for an attached table, use the

following procedure:

1. Open the table in Design view.

2. From the View menu, select Table Properties. The Description

   property contains the path to the attached table.

3. Place the .MDB file and its attached tables on a share on a

   dedicated server.

4. Use one of the following two naming conventions:

   - Choose a drive letter (for example, "u:") and make sure all

     users connect to the share using that drive letter. Use the

     same drive letter for the attached tables.

     -or-

   - Use the universal naming convention (UNC) for the attached

     tables (for example, \\<server>\<share>\<filename>).

       NOTE: To attach a database using the UNC, you need to specify

       both the UNC name and the database name where you normally

       would specify the drive and database names. For example,

       instead of logging on to the network drive, typing the database

       name, and choosing Attach Table from the File menu, you need

       only to enter the UNC name, along with the database name, in

       the Attach dialog box, as follows:

          \\OUTLAND\PUBLIC\MYDB.MDB

If the .MDB file is placed on a non-dedicated server (for example, in

Microsoft Windows for Workgroups), you must maintain two separate .MDB

files, one to share with other workstations and one for your local

machine.

Maintaining two separate copies of the .MDB file is necessary because

Windows for Workgroups does not allow a server machine to redirect to

itself. For example, if the server name is SERVERNM, the SERVERNM

machine cannot use the path \\SERVERNM\SHARE to access a file from its

own hard disk.

References:

"User's Guide," version 1.0, pages 69-72

Additional reference words: 1.00 1.10 Attach MultiUser


INF: Base Combo Box on Parameter Query to Filter Values

 Article Number: Q99937

 CREATED: 10-JUN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to filter values that appear in a combo box

by basing the combo box on a parameter query.

MORE INFORMATION

There may be situations in which you want to limit the values that

appear in a combo box. For example, you may want to show only

suppliers whose names begin with a certain letter. Although Microsoft

Access does not allow filters on combo boxes, basing your combo box on

a parameter query filters the values using a criteria clause.

This article describes the steps to create a combo box that displays

only the suppliers that meet the criteria you specify. The sample

database NWIND.MDB is used:

1. Create the following query to fill the combo box:

    Query:  Filtered Supplier List

    ------------------------------

    Type:  Select

    Field:  Company Name

       Table: Suppliers

       Sort:  Ascending

       Criteria: Like [My Criteria Box] & "*"

2. Create the following macro to update the combo box with new

   criteria:

    MacroName: CB Test Macro

    ------------------------

       Action: Requery

       ControlName: My combo box

3. Create the following unbound form to test your controls:

    Form: TestForm

    --------------

       Record Source: <None>

    TestForm Controls

    -----------------

    Combo Box: My combo box

       ControlSource: <None>

       RowSourceType: Table/Query

       RowSource: Filtered Supplier List

    Text Box: My Criteria Box

       After Update:  CB Test Macro

4. Open the form in Form view. Choose the arrow button. (Do not enter

   any value in the Criteria box.) Note that all suppliers are listed

   because you have not yet entered a filter criteria.

5. Type a single letter in the Criteria box (for example, "E").

6. Choose the arrow button. Note that only suppliers whose names begin

   with the letter "E" are displayed.

7. Give the Criteria box the focus. Type a new letter (for example,

   "P").

8. Choose the arrow button. Note that now only suppliers whose names

   begin with the letter "P" are displayed.

Additional reference words: 1.00 1.10 2.00 limit drop down list box ddb


INF: Sample Function to Remove Alphas from a Numeric Field

 Article Number: Q99938

 CREATED: 10-JUN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to create a sample Microsoft Access function

called RemoveAlphas() to remove alpha, or nonnumeric, characters from an

alphanumeric string. All nonnumeric characters will be removed.

A common use for the RemoveAlphas() function is to remove the parentheses,

dashes, and spaces from a telephone number or social security number field.

The following strings contain parentheses, dashes, and spaces:

   "(206) 635-7050"

   "206-635-7050"

   "535-87-4529"

After the RemoveAlphas() function is run, these strings will be:

   "2066357050"

   "2066357050"

   "535874529"

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

The following example demonstrates how to create the RemoveAlphas()

function, and how to use it either while data is being entered, or in an

update query to remove nonnumeric characters from phone numbers in a

table.

How to Create the RemoveAlphas() Function

-----------------------------------------

1. Create a new module.

2. In the Module window, type "Option Explicit" (without the quotation

   marks).

3. From the Edit menu, choose New Procedure.

4. Type "RemoveAlphas" (without the quotation marks) in the Name box, and

   select Function in the Type box. Choose OK.

5. Type the following function in the Module window:

      Function RemoveAlphas (AlphaNum)

         Dim Clean As String

         Dim Pos, A_Char$

         Pos = 1

         For Pos = 1 To Len(AlphaNum)

            A_Char$ = Mid(AlphaNum, Pos, 1)

            If A_Char$ >= "0" And A_Char$ <= "9" Then

              Clean$ = Clean$ + A_Char$

            End If

         Next Pos

         RemoveAlphas = Clean$

         AlphaNum = Clean$

      End Function

6. Save the module with any unique name.

How to Use the RemoveAlphas() Function in Data Entry

----------------------------------------------------

You can use the RemoveAlphas() function to remove dashes or parentheses

while phone numbers are being typed into a field.

For a field called Phone, add the following AfterUpdate property to the

Phone text box on a form:

   =RemoveAlphas([Phone])

How to Use the RemoveAlphas() Function in an Update Query

---------------------------------------------------------

1. Create a new query based on the table with the phone number field.

2. Place the phone number field in the first column of the query grid.

3. From the Query menu, choose Update.

4. In the Update To row, enter the following for a field named Phone:

      RemoveAlphas([Phone])

5. Run the query.

Additional reference words: 1.00 1.10 2.00 AB ssn hyphens


INF: How to Communicate with NetDDE

 Article Number: Q99939

 CREATED: 10-JUN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article demonstrates how to use NetDDE to communicate with Microsoft

Access on a remote computer. This article assumes that you are familiar

with DDE communications on a local computer, and with the capabilities of

Microsoft Access as a DDE server.

This article also assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

In order to establish a link to a remote application, a DDE share must be

created on the remote computer. A DDE share is a name that represents an

application name, a topic, and any permissions for that topic. A DDE

conversation can only occur with applications and topics assigned to share

names on the remote computer. Note that a utility called Network DDE Share

Manager (provided with the Windows for Workgroups Resource Kit) can be used

to create and edit DDE share names.

How to Create the DDE Share

---------------------------

The following steps demonstrate how to create a DDE share for the Employees

table in the sample database NWIND.MDB:

1. Start the Network DDE Share Manager. From the Share menu, choose New.

2. Type "Northwind Employees" (without the quotation marks) in the Share

   Name box.

3. Type "MSACCESS.EXE" (without the quotation marks) in the Application

   Name box and "NWIND.MDB;TABLE Employees" (without the quotation marks)

   in the Topic Name box. The password information is optional and can be

   left empty.

4. From the File menu, choose Save.

How to Communicate with the Remote Microsoft Access DDE Share

-------------------------------------------------------------

NOTE: Before running the following function, make sure that Microsoft

Access is running on the remote computer and that the NWIND.MDB database is

open.

Create the following module function in Microsoft Access on your local

computer:

NOTE: In the following sample code, an underscore (_) is used as a

line-continuation character. Remove the underscore when re-creating

this code in Access Basic.

   Option Explicit

   Function GetRemoteEmployeeInfo()

      Dim iChan As Integer

      Dim EmpRecord As String, FieldNames As String

      iChan = DDEInitiate("\\RemoteMachineName\NDDE$", _

      "Northwind Employees")

      FieldNames = DDERequest(iChan, "FieldNames")

      MsgBox FieldNames, 0, "Employee Table Field Names"

      On Error Resume Next

      EmpRecord = DDERequest(iChan, "FirstRow")

      Do Until EmpRecord = ""

         MsgBox EmpRecord, 0, "Employee Record"

         EmpRecord = ""

         EmpRecord = DDERequest(iChan, "NextRow")

      Loop

   End Function

Change the first argument of the DDEInitiate command (RemoteMachineName) to

reference the name of your remote computer.

When you run this function from the Immediate window, a message box will

display a list of field names in the Employees table. Next, a series of

message boxes will appear displaying each record from the table. The field

data will be delimited by a tab character.

The DDEInitiate Statement

-------------------------

Note the arguments used in the DDEInitiate command to establish the link

with the remote share. The application name is the net DDE server

application NDDE$ located on the remote computer "\\RemoteMachineName".

NDDE$ is a system service application that is run automatically by Windows

for Workgroups in the background. This application is always running and

present when Windows for Workgroups is running and cannot be terminated.

When NDDE$ receives the topic "Northwind Employees" it checks the list of

available DDE shares on the local computer. If it finds the share, it will

validate any permissions on the share and prompt for a password if one is

required. After the validation is complete, NDDE$ establishes a local DDE

link with the application name and topic assigned to the share name.

Once the link has been established, communication with the client

application proceeds as if it were another application on the local

computer. NDDE$ becomes the liaison between the two applications across the

network.

REFERENCES

==========

For more information on Microsoft Access as a DDE server, query on the

following words here in the Microsoft Knowledge Base:

   dde and server

Microsoft Windows for Workgroups "Resource Kit," Chapter 11

Additional reference words: 1.00 1.10 2.00 dynamic data exchange


INF: How to Wait for a Shelled Process to Finish

 Article Number: Q99940

 CREATED: 10-JUN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you are using the Shell() function or the RunApp macro action to

run another program or process, Microsoft Access does not wait for the

shelled process to finish before processing the next line in the macro

or function. This causes problems for macros and functions whose

subsequent actions depend on the results of the shelled process.

This article includes a function called WaitShell(), which, given an

application name or process to run, starts the process and waits for

it to terminate.

MORE INFORMATION

The following Microsoft Access function, WaitShell(), uses

GetModuleUsage, a Microsoft Windows API function, to determine if the

shelled process has terminated. The Shell() function, if it

successfully starts the process, returns a handle to the process

module. If the process is no longer running, the handle is invalid and

GetModuleUsage returns a value of 0. WaitShell() simply loops until

the module is no longer valid.

NOTE: You may have the following GetModuleUsage Windows API function

defined in an existing Microsoft Access library. If you receive a

duplicate procedure name error message, delete the Declare statement

from your code.

   Option Explicit

   Declare Function GetModuleUsage% Lib "Kernel" (ByVal hModule%)

   Function WaitShell (AppName$)

      Dim hMod%

       hMod% = Shell(AppName$, 1)

       If (hMod% > 32) Then

          While (GetModuleUsage(hMod%))

             DoEvents

          Wend

       Else

          MsgBox "Unable to start " & AppName$

       End If

   End Function

To test this function, create and run the following Microsoft Access

macro

   Action

   ------

   RunCode

   MsgBox

   Macro Actions

   -------------

   RunCode

      Function Name: =WaitShell("Command.com")

   MsgBox

      Message:       Done!

 -or-

run the following Microsoft Access function:

   Function TestWaitShell()

      x=WaitShell("Command.com")

      MsgBox "Done!"

   End Function

Both examples above launch instances of the DOS prompt, which remain

until you terminate them by typing "exit" at the command line and

pressing ENTER.

REFERENCES

==========

Microsoft Windows "Programmer's Reference, Volume 2: Functions,"

version 3.1, pages 403-404

Additional reference words: 1.00 1.10 2.00 terminate shell


INF: How to Calculate a Credit Card Expiration Date

 Article Number: Q99941

 CREATED: 10-JUN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

If you enter a credit card expiration date (month/year) in a date/time

field on a form, Microsoft Access assumes that the card expires on the

first day of the month. This article includes a function that

correctly calculates the expiration date as the last day of the month.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

Use the following function, ExpirationDay(), in the AfterUpdate

property of an expiration text box on your form. The function will

replace the date entered in the text box with the date computed for

the last day of the month/year.

Given a date/time field bound to a text box with the ControlName

property set to "Expiration", the AfterUpdate property should read:

   =ExpirationDay([expiration])

Create a module with the following function:

 Option Explicit

 Function ExpirationDay (dt)

   If Not IsNull(dt) Then

     dt = DateAdd("m", 1, DateAdd("d", (-1 * DatePart("d", dt)), dt))

   End If

 End Function

You can use the following derivative of the ExpirationDay() function

in calculated fields in a query:

   NOTE: In the following sample code, an underscore (_) is used as a

   line continuation character. Remove the underscore when re-creating

   this code in Access Basic.

   Function ExpirationDay (ByVal dt)

      If Not IsNull(dt) Then ExpirationDay = DateAdd("m", _

          1, DateAdd("d", (-1 * DatePart("d", dt)), dt))

   End Function

Additional reference words: 1.00 1.10 2.00 expiration date


PRA: Timeout While Waiting for DDE Response

 Article Number: Q99942

 CREATED: 10-JUN-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Microsoft Access generates the message "Timeout while waiting for DDE

response" when you try to initiate a dynamic data exchange (DDE) link

with another application.

CAUSE

This error occurs when the function attempting to initiate the link is

invoked using a RunCode action in a macro and the RunCode action macro

is called from another application using DDE.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

versions 1.0 and 1.1. This problem no longer occurs in Microsoft Access

version 2.0.

MORE INFORMATION

Microsoft Access takes time-outs with all attempts to perform DDE to

other applications if the other application is currently conversing

with Microsoft Access as a DDE server.

Steps to Reproduce Problem

--------------------------

The following instructions demonstrate the problem by showing how to

use Word for Windows to run a Microsoft Access macro that attempts to

initiate a DDE conversation with Microsoft Excel.

1. Start Microsoft Excel with the default worksheet Sheet1 and type some

   text in cell A1, or row 1, column 1.

2. Start Microsoft Access and create the following macro called "Test":

      Test Actions

      ------------

      RunCode

         Function Name: =TestDDE()

3. Create the following Access Basic function:

      Option Explicit

      Function TestDDE ()

         Dim chan

         chan = DDEInitiate("excel", "sheet1")

         MsgBox DDERequest(chan, "R1C1")

         DDETerminate chan

      End Function

4. Start Word for Windows and choose Macro from the Tools menu.

5. In the Macro Name box, type "test" (without the quotation marks),

   and press the Edit button.

6. Type the following macro in the editing window:

      Sub MAIN

         chan = DDEInitiate("msaccess", "system")

         DDEExecute chan, "test"

         DDETerminate chan

      End Sub

7. Run the macro by choosing the Start button on the macro toolbar

   or by pressing ALT+SHIFT+S.

Approximately 45 to 60 seconds later the following message is

generated by Microsoft Access:

   Timeout while waiting for DDE response

Additional reference words: 1.00 1.10 Dynamic Data Exchange


PRB: Rectangles Appear When Pasting in the Query Grid

 Article Number: Q99943

 CREATED: 10-JUN-1993

 MODIFIED: 29-NOV-1993

 VERSION(S): 1.00 1.10

----------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

----------------------------------------------------------------------

SYMPTOMS

When you are using the query grid, an attempt to cut and paste (or to copy

and paste) an entire criteria row to a single cell places rectangular

characters in the cell.

CAUSE

In Microsoft Access, when you cut or copy an item to the Clipboard, the

item is copied to the Clipboard as tab-separated data. When you paste a row

into a single cell, the tabs appear as rectangular characters.

RESOLUTION

Select an object to paste to that has the same size as the object you cut

or copied.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the Employee Sales by Country [Parameter] query in Design view in

   the sample database NWIND.MDB.

2. Select the entire Criteria row in the query grid (click the mouse once

   at the left side of the row when the mouse pointer changes to a solid

   right arrow).

3. From the Edit menu, choose either Cut or Copy.

4. Select any cell on the query grid and choose Paste from the Edit menu.

Note that the pasted value shows rectangular characters.

REFERENCES

==========

For more information on pasting information in the query grid, query on the

following words here in the Microsoft Knowledge Base:

   queries and paste

Additional reference words: 1.00 1.10


PRA: Cannot Export Paradox/dBase Tables

 Article Number: Q99944

 CREATED: 10-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

In Microsoft Access, you cannot export a Paradox or dBASE table over the

top of an existing corrupted Paradox or dBASE database file. If you try to

do so, you receive the following error message:

   <path\filename> This file already exists.

   Replace existing file?.

If you choose the Yes button, you receive the following error message:

   Table '<tablename>' already exists.

This error occurs with both dBASE and Paradox formats. Other database

exports correctly allow you to overwrite existing database files.

CAUSE

Microsoft Access tries to open the file to verify its contents instead

of simply overwriting it.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce the Problem

------------------------------

1. Copy your CONFIG.SYS file to CONFIG.DB. (This will simulate a

   corrupted Paradox database.)

2. In Microsoft Access, choose Export from the File menu, select

   Paradox 3.X and any table.

3. Specify CONFIG.DB as the output file and choose OK.

4. Choose Yes to the "Replace existing file?" message.

You receive the error message "Table 'CONFIG#DB already exists."

Additional reference words: 1.00 1.10 2.00 Import/Export


PRA: Null Boolean Values Default to False

 Article Number: Q99945

 CREATED: 10-JUN-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Null values appearing in a boolean field always default to false in

tables, forms, and reports.

CAUSE

Null values are not supported in boolean fields. When a null value is

inadvertently placed in a boolean field (by a query, for example), the

null value is ignored. By default, "false" incorrectly appears in the

field.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1, and 2.0. We are researching this problem and will post new

information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

 1. Open the sample database NWIND.MDB and create a new table called

    Table1. (No primary key required.)

 2. In Design view, create a field in Table1 named Test with the data

    type Text.

 3. Create another table and name it Table2. In Design view, create

    two fields:

       Name    DataType

       ----------------

       Test    Text

       Bool    Yes/No

 4. Enter the following data in Table1:

       Test

       ----

        A

        B

        C

 5. Enter the following data into Table2:

       Test     Bool

       -------------

       A        Yes

       B        No

 6. Create a make-table query using Table1 and Table2. Give the new

    table a name, such as "Bogus."

 7. Create a join between Table1 and Table2 by dragging the

    Test field from Table1 and dropping it onto Table2.

 8. Edit the join properties by double-clicking the join line or by

    selecting Join Properties from the View menu. Select relationship #2.

    This includes all records from Table1 and only those records from

    Table2 where the joined fields are equal.

 9. Drag the Test field from Table1 and the Bool field from Table2

    onto the query grid.

10. Execute the make-table query by selecting Run from the Query menu

    or by clicking the Run button on the toolbar.

A dialog box states "3 row(s) will be copied into new table."

Open the table Bogus and note its contents:

   Test    Bool

   ------------

   A       -1

   B        0

   C        0

Note that a value of zero (0) has incorrectly been placed for the

value of Bool for Test value C (0 = No, -1 = Yes). Change the Bool

field's format in Design view to view the values as True/False,

Yes/No, and so forth.

REFERENCES

==========

For more information on Boolean values, search for "Boolean" using the

Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 tables


INF: How to Use the Parent Property of a Subform

 Article Number: Q100025

 CREATED: 14-JUN-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to use a subform's Parent property to

return the name of its parent form.

MORE INFORMATION

The following is the correct syntax for the Parent property in macro

actions called from a subform:

   Forms![Main Form Name]![Subform ControlName].Form.Parent.Formname

   -or-

   Form.Parent.Formname

   -or-

   Parent.Formname

In a Microsoft Access version 2.0 event procedure use:

   Me.Parent.Name

NOTE: In Microsoft Access 2.0, use the Name property instead of FormName.

The following example demonstrates how to use the Parent property in a

macro:

1. Open the sample database NWIND.MDB.

2. Create and save the following macro:

      Macro: Get Parent Name

      ---------------------------------------------------------------

      Action: MsgBox

         Message: =Forms!Orders![Orders Subform].Form.Parent.Formname

         Title: Parent Form Name

2. Open the "Orders Subform" form in Design view. Add the "Get Parent

   Name" macro to the Product ID field:

      Object: Text Box

      ------------------------------

      ControlName: Product ID

         OnDblClick: Get Parent Name

3. Save and close "Orders Subform."

5. Open the Orders form. Double-click the Product ID field in the

   subform. The parent form name, Orders, will display.

6. Close the Orders form. Open the "Orders Subform" form in Design view,

   and remove the macro added in step 2.

Additional reference words: 1.00 1.10 2.00 main mainform sub


PRA: RunMacro May Not Work with Large Repeat Count

 Article Number: Q100126

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you try to execute a RunMacro action with a Repeat Count argument

greater than 32,767, either Microsoft Access may use an unexpected

Repeat Count argument or the following error message may appear:

   Repeat Count argument in RunMacro action can't be less than 0

CAUSE

Microsoft Access does not explicitly check for Repeat Count arguments

greater than 32,767. Such values may wrap around either to a negative

number or to an unexpected positive number. If the resulting value is

negative, Microsoft Access displays the above error message. If the

value is positive, Microsoft Access runs the macro using the Repeat

Count argument that it evaluated.

RESOLUTION

Make sure that your Repeat Count argument falls between 0 and 32,767.

If you need to run a macro more than 32,767 times, nest your macros.

For example, if you need to run a macro 60,000 times, use the

following three steps:

1. Create a macro (Macro1) that has a RunMacro action with a

   Repeat Count argument of 30,000.

2. Create another macro (Macro2) that has a RunMacro action with a

   Repeat Count argument of 2.

3. Instruct Macro2 to run Macro1.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

versions 1.0 and 1.1. This problem no longer occurs in Microsoft Access

version 2.0.

MORE INFORMATION

If the Repeat Count argument falls between 0 and 32,767, Microsoft

Access returns the expected results (no repeat).

If the Repeat Count argument falls between 32,767 and 65,535,

Microsoft Access returns the error message listed above in the

"Symptoms" section.

If the Repeat Count argument is greater than 65,535, Microsoft Access

returns either the expected results (no repeat), the error message, or

unexpected results.

Steps to Reproduce Behavior

---------------------------

1. Open a blank, unbound form and save it as as Test Form.

2. Create two macros (Increment by One and RepeatCount Test) as

   follows:

      Macro Name         Action

      ---------------------------

      Increment by One   SetValue

      RepeatCount Test Actions

      ------------------------

      SetValue

         Item: [field0]

         Expression: [field0]+1

      Macro Name         Action

      ---------------------------

      RepeatCount Test   RunMacro

                         MsgBox

      RepeatCount Test Actions

      ------------------------

      RunMacro

         Macro Name: Increment by One

         Repeat Count: 32767

      MsgBox

         Message: Done

3. Add three controls to Test Form, as follows:

      Object: Text Box

      -----------------

      ControlName: Field0

         ControlSource: <leave blank>

      Object: Command Button

      ----------------------

      ControlName: Increment

         Caption: Increment

         OnPush: Increment by One

      Object: Command Button

      ----------------------

      ControlName: Repeat

         Caption: Repeat

         OnPush: RepeatCount Test

4. Open Test Form in Form view. Type "1" in Field0, then choose

   Increment. Note that each time you choose Increment, the value in

   Field0 increases by 1.

5. Type "1" in Field0, then choose Repeat. When the RepeatCount Test

   macro has run, the message "Done" is displayed. Note that the value

   in Field0 is now 32,767.

   To test different Repeat Count arguments, open the RepeatCount Test

   macro in Design view, change the Repeat Count argument, and repeat

   step 5.

Additional reference words: 1.00 1.10 macros RepeatCount ui


PRA: List Box Controls on Forms Painted Incorrectly

 Article Number: Q100127

 CREATED: 16-JUN-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The gray dotted box that surrounds the top row in a list box,

indicating no selection, disappears when you scroll down from the top

row and minimize the form.

CAUSE

This problem occurs because list box controls on forms are painted

incorrectly, but only when you minimize and then restore a form whose

current control is a list box in which there is no selection and the

top row is scrolled out of view.

RESOLUTION

Any event that causes the form to repaint, such as pressing the F9 key

or selecting an item from the list box, causes the gray dotted box to

reappear.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1 and 2.0. We are researching this problem, and will post new

information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB.

2. Create a new, blank form.

3. Place a list box control on the form and set its RowSource property

   to Employee List.

4. Switch to Form view. Note that the first item in the list is

   surrounded by a gray dotted box.

5. Scroll down the list until the first item in the list no longer

   appears.

6. Minimize the form, then maximize it.

7. Scroll up the list until the first item in the list is visible again.

   Note that the gray dotted box is no longer visible.

8. Press the F9 key once to force the form to repaint. The gray dotted

   box reappears around the first item in the list.

Additional reference words: 1.00 1.10 2.00 forms repaint caret


PRA: Importing Numeric Column Names in Spreadsheets

 Article Number: Q100128

 CREATED: 16-JUN-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SYMPTOMS

Microsoft Access replaces the numeric column names in your

imported

spreadsheet with other numbers.

RESOLUTION

Before you import your spreadsheet, format the column names

as text by

typing a single quotation mark (') in front of each number.

Or, after

you import your spreadsheet to a Microsoft Access table,

switch to

Design view and change the field names.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

versions 1.0 and 1.1. We are researching this problem and

will post

new information here in the Microsoft Knowledge Base as it

becomes

available.

MORE INFORMATION

Numeric column names in imported spreadsheets are ignored,

regardless

of the spreadsheet format. Microsoft Access replaces any

numeric

column names with column numbers in the destination table.

Steps to Reproduce Problem

--------------------------

1. Create a new spreadsheet in Microsoft Excel. Enter the

following

   records in cells A1 through C2:

      A1: 25

      B1: 1

      C1: 2

      A2: 123456789

      B2: dog

      C2: cat

2. Save the spreadsheet as IMPTEST.XLS, then close Microsoft

Excel.

3. Open a database in Microsoft Access.

4. From the File menu, choose Import.

5. In the Import box, select Microsoft Excel as the data

source.

   Choose OK.

6. In the Select File box, select IMPTEST.XLS, then choose

Import.

7. In the Import Spreadsheet Option box, select the First

Row Contains

   Field Names check box. Choose OK.

8. In the Import Result box, choose OK, then close the

Select File

   box.

9. Open the IMPTEST table. Note that Microsoft Access has

replaced the

   numeric column names with the actual column numbers from

the

   spreadsheet.

Additional reference words: 1.00 1.10


PRB: Editing Allowed Although AllowEditing Set to Unavailable

 Article Number: Q100129

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Even though a form's AllowEditing property is set to Unavailable, you

can edit, add, or delete records in the form.

RESOLUTION

This behavior is by design. To set a form so that records cannot be

edited, set the DefaultEditing property to Read Only and the

AllowEditing property to Unavailable.

MORE INFORMATION

The form's DefaultEditing property determines whether you can modify

records in the form. You can set the DefaultEditing property to Read

Only, Data Entry, or Allow Edits.

The AllowEditing property on a form determines whether the Allow

Editing command on the Records menu is available when you open the

form. If the Allow Editing command is available, you can override the

form's DefaultEditing property.

REFERENCES

==========

For more information on the AllowEditing and DefaultEditing

properties, search for "allow editing" then "AllowEditing,

DefaultEditing Properties" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 ui


PRB: Negative GroupOn Interval Reverses Sort Order

 Article Number: Q100130

 CREATED: 16-JUN-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When a nontext field on a Microsoft Access report is sorted in

ascending order and is grouped on an interval, the sort order will be

descending, not ascending, if the interval is set to -1.

RESOLUTION

This behavior is by design. With the interval set to -1, the report is

sorted on the negative result of the expression or interval.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB. Create an new report based on

   the "Order Details" table.

2. From the View menu, choose Sorting And Grouping. Select Order ID

   for the first field. Fill out the Sorting And Grouping box as

   follows:

      Sorting And Grouping

      --------------------------

      Field/Expression: Order ID

      Sort Order: Ascending

      Group Properties

      ------------------

      Group Header: Yes

      Group On: Interval

      Group Interval: -1

3. Drag the Order ID field from the Field List box onto the report.

4. Preview the report. Note that the sort order is descending.

Additional reference words: 1.00 1.10 date time numeric


INF: How to Create a Parameter In() Statement

 Article Number: Q100131

 CREATED: 16-JUN-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes a way to create a query by using the In()

operator with multiple values.

The method shown below uses a query that calls a function, which then

is passed two parameters. The first parameter is the name of a field

that exists in the table on which the query is based. The second

parameter prompts the user to enter a list of values. The function

processes the user's entries as the list of multiple parameters for

the In() operator.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

MORE INFORMATION

The following example is based on the sample database NWIND.MDB:

1. Create a new module with the following two functions:

      '************************************************************

      'Declarations section of the module.

      '************************************************************

      Option Explicit

      '============================================================

      ' The GetToken() function defines the delimiter character.

      '============================================================

      Function GetToken (stLn, stDelim)

         Dim iDelim as Integer, stToken as String

         iDelim = InStr(1, stLn, stDelim)

         If (iDelim <> 0) Then

            stToken = LTrim$(RTrim$(Mid$(stLn, 1, iDelim - 1)))

            stLn = Mid$(stLn, iDelim + 1)

         Else

            stToken = LTrim$(RTrim$(Mid$(stLn, 1)))

            stLn = ""

         End If

         GetToken = stToken

      End Function

      '============================================================

      ' The InParam() function is the heart of this article. When

      ' the query runs, this function causes a query parameter

      ' dialog box to display so that you can enter a list of values.

      ' The values you enter are interpreted in the same way as if you

      ' had entered them within the parentheses of the In() operator.

      '============================================================

      Function InParam (Fld, Param)

         Dim stToken as String

         If IsNull(Fld) Then Fld = ""

         Do While (Len(Param) > 0)

           stToken = GetToken(Param, ",")

           If stToken = LTrim$(RTrim$(Fld)) Then

              InParam = -1

              Exit Function

           Else

              InParam = 0

           End If

         Loop

      End Function

2. Close and save the module.

3. Create a new query based on the Customers table. Drag any fields

   you want to the query grid.

4. Add the following field to the query grid:

      FieldName: InParam([Customer ID],[Enter a list of IDs separated

                  by commas and no spaces:])

      Show: False

      Criteria: True

   NOTE: The value InParam(...) shown for the FieldName should be

   entered as one statement on a single line. The InParam() function

   works with Integer fields as well as with Text fields.

5. From the Query menu, choose Parameters. Enter the following

   parameter with a Text data type:

      Enter a list of ID's separated by commas and no spaces:

6. Choose OK and run the query.

   You are prompted to enter a list of parameters. The following

   message is displayed in the dialog box:

      Enter a list of ID's separated by commas and no spaces:

7. Type the following values, without spaces:

      BLUEL,CACTP,DOLLC

   NOTE: In version 2.0, type

      CHOPS,EASTC,FAMIA

   All records meeting the above criteria are displayed.

Additional reference words: 1.00 1.10 2.00 Queries AB parameters IN


INF: Four Ways to Move to a Record from a Combo Box Selection

 Article Number: Q100132

 CREATED: 16-JUN-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

------------------------------------------------------------

SUMMARY

Listed below are four different methods of moving to a specific record

based on a combo box selection:

1. In the AfterUpdate property of the combo box, call a macro using

   the FindRecord action.

2. In the AfterUpdate property of the combo box, call a macro using

   the ApplyFilter action.

3. Use a Form/Subform, with the combo box in the main form and the

   data in the subform, bound by the LinkMasterFields and

   LinkChildFields properties.

4. Base the form on a query joining two tables and bind the combo

   box to the field that controls the join, using the row fix-up or

   dynamic lookup techniques.

MORE INFORMATION

These four methods are outlined in the sections below and are based on

the sample database NWIND.MDB.

The following table compares the features (benefits and drawbacks) of

the four methods:

   Method Number:                  1   2   3   4

   ---------------------------------------------

   Requires no code/macros                 x   x

   Saves on subforms               x   x       x

   Can scroll to other records     x       x   x

   Does not require a query        x   x   x

   Can edit records                x   x   x

   ---------------------------------------------

NOTE: These methods can also apply to text boxes.

Method 1

--------

1. Create a form called ComboTest based on the Products table. You must

   include at least the Product ID field on the new form. (Additional

   fields can help to illustrate that you have changed records based

   on the value selected in the combo box.) Set the DefaultView

   property to Single Form.

      Object: Text Box

      -------------------------

      ControlName: Product ID

      ControlSource: Product ID

      Visible: Yes

2. Create an unbound combo box called Combo1 with the properties

   described below. The combo box can be located anywhere on the form,

   but preferably in the form header or footer.

      Object: Combo Box

      ---------------------------------

      ControlName: Combo1

      ControlSource: <leave blank>

      RowSourceType: Table/Query

      RowSource: Products

      ColumnCount: 4

      ColumnWidths: 0 in;0 in;0 in;2 in

      BoundColumn: 1

      After Update: Locate Product

3. Create a new macro called Locate Product with two actions:

      Macro: Locate Product

      ----------------------------

      GoToControl

         ControlName: [Product ID]

      FindRecord

         Find What: =Combo1

         Find First: Yes

4. Switch to Form view. Note that when you choose a product name in

   the combo box, you are moved to the record selected and the

   appropriate Product ID is displayed.

Another example of this method is illustrated in the Suppliers form in

NWIND.MDB in Microsoft Access version 1.x, and in the Products And

Suppliers form in Microsoft Access version 2.0.

Method 2

--------

1. Repeat steps 1 and 2 from Method 1 described above.

2. Create a macro called Locate Product with one action:

      Macro: Locate Product

      ------------------------------------------------

      ApplyFilter

         Where:[Product ID]=Forms![ComboTest]![Combo1]

The Product ID field is the bound field in the combo box. While the

combo box displays the Product Name information, it is bound to (or,

holds internally) the value of the Product ID.

This method is similar to the Suppliers form in NWIND.MDB, which uses

the buttons to filter records from A to Z. Also, see the Alpha Apply

Filter Buttons macro.

Method 3

--------

1. Create a new, unbound form. Add a combo box with the following

   properties:

      Object: Combo Box

      ---------------------------------

      ControlName: Combo1

      ControlSource: <leave blank>

      RowSourceType: Table/Query

      RowSource: Products

      ColumnCount: 4

      ColumnWidths: 0 in;0 in;0 in;2 in

      BoundColumn: 1

2. Create a second form based on the Products table to use as a

   subform. Include at least the Product ID field. (Additional fields

   can help to illustrate that you have changed records based on the

   value selected in the combo box.) Set the DefaultView property to

   Single Form.

      Object: Text Box

      -------------------------

      ControlName: Product ID

      ControlSource: Product ID

      Visible: Yes

3. Save the form, then use it to create a subform control on the first

   form by dragging it from the Database window to the Detail section

   of the first form.

4. Set the subform control properties as follows:

      Object: Subform

      -----------------------------

      LinkChildFields: [Product ID]

      LinkMasterFields: Combo1

By changing the value in Combo1, Microsoft Access ensures that the

records in the subform match the combo box.

The Orders form in NWIND.MDB illustrates this method. The Order

Details subform is related by the LinkMasterFields and

LinkChildFields properties.

Method 4

--------

1. Create a table called Prd containing a single field Product ID. Set

   the data type to Number and the field size to Long Integer. No primary

   key is necessary.

2. Create a single blank record.

3. Create a query called Prd Query based on a join between the Product

   ID fields of the Prd and Products tables. Include the following

   attributes in the query:

      Query: Prd Query

      -----------------------------------------------

      Field: Product ID

         TableName: Prd

         Show: X

      Field: <any other fields you are interested in>

         TableName: Products

4. Create a form based on Prd Query and add all fields. You must add at

   least the Product ID field.

5. Delete the text box control for Product ID and re-create it as a

   combo box, as follows:

      Object: Combo box

      ----------------------------------

      ControlName: Product ID

      ControlSource: Product ID

      RowSourceType: Table/Query

      RowSource: Products

      ColumnCount: 4

      ColumnWidths: 0 in;0 in ;0 in;2 in

      BoundColumn: 1

The Orders form in NWIND.MDB illustrates this method. It allows the

customer name and address to be selected based on the Customer ID

combo box. By changing the Customer ID in the Orders table, the

related Customers record is changed and the corresponding fields are

updated on the form. For another example, see the Products And

Suppliers form.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 270-284 and 545-548

Microsoft Access "User's Guide," version 1.1, pages 274-288 and 549-552

Microsoft Access "User's Guide," version 2.0, Chapter 17, "Creating Forms

Based on More Than One Table"

For more information on the dynamic lookup or row fix-up techniques,

query on the following words here in the Microsoft Knowledge Base:

   dynamic and lookup

   -or-

   row and fix-up

For more information on how to reference controls on a form, search

for "Identifiers in Expressions" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 Forms Controls Text box


PRB: Form Is Inaccessible When Debugging Run-Time Error

 Article Number: Q100133

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If a form calls an Access Basic function that is halted due to a

run-time error, the form will become inaccessible.

CAUSE

When a program halts due to a run-time error, the form's handle is not

released by the system. Even though the program is no longer running,

the handle is still in use.

RESOLUTION

To release the form handle after the program has halted, choose

Reinitialize from the module's Run menu.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create and save a form with the following command button on it:

      Object: Command Button

      ----------------------

      ControlName: Run Code

      Caption: Run Code

      OnPush: =Test()

   NOTE: In Microsoft Access version 2.0, use OnClick instead of OnPush.

2. In a new module, create and save the following function named

   Test():

      Function Test()

         Dim x as String

         x = left("abc", -1)

      End Function

3. Open the form that was created in step 1.

4. Choose the Run Code button. The program will halt and the error

   message "Illegal function call" will be displayed.

5. Choose OK.

6. Minimize the module in which the function is being displayed.

7. Try to choose the Run Code button again, or try to move the form.

   Note that you cannot manipulate the form or anything on it. This is

   because the form handle is not available.

8. To release the form handle after the program has halted, choose

   Reinitialize in Access 1.x, or Reset in Access 2.0, from the module's

   Run menu.

REFERENCES

==========

Microsoft Access "Introduction to Programming," Chapter 4

Additional reference words: 1.00 1.10 2.00 AB


PRB: BeforeUpdate and AfterUpdate Field Properties Not Working

 Article Number: Q100134

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The macro or function attached to a field's BeforeUpdate or AfterUpdate

property does not run.

CAUSE

A field's BeforeUpdate and AfterUpdate events will not be triggered if

the field was modified by a macro or by Access Basic code.

RESOLUTION

This behavior is by design. You can work around this behavior by

causing the macro or Access Basic code that modifies the field to

manually trigger the event pointed to by the field's BeforeUpdate or

AfterUpdate property.

MORE INFORMATION

Steps to Reproduce Behavior

--------------------------

1. Open the sample database NWIND.MDB.

2. Create and save the following macro:

      Macro Name       Actions

      -------------------------

      Test1            OpenForm

                       SetValue

      Test1 Actions

      --------------------------------------

      OpenForm

         Form Name: Employees

      SetValue

         Item: Forms![Employees]![Last Name]

         Expression: Null

3. Open the Employees form in Design view and add the Required Entry

   macro to the Last Name field's BeforeUpdate property.

4. Close the Employees form.

5. Run the Test1 macro. Note that it successfully blanked out the

   employee's last name (you can press ESC twice to get it back).

   If the field's BeforeUpdate event had been triggered, the Required

   Entry macro would not have allowed the field to be blank.

6. Try to remove the employee's last name manually. The Required Entry

   macro will be triggered, displaying the following message:

      You must enter a last name

7. Do not save changes when closing the Employees form.

Additional reference words: 1.00 1.10 2.00 before after update ui


INF: How to Search for Characters or Strings in Records

 Article Number: Q100135

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article demonstrates three methods for searching and identifying

records containing a particular character or string. In the example

below, we search for an asterisk (*) character.

MORE INFORMATION

Say, for example, you have a table of names. Some of the names have

an asterisk character embedded in them, and you would like a list of

all the names containing asterisks.

First Method--Using the InStr() Function

----------------------------------------

One solution is to use the InStr() function. The InStr() function

returns the position of the first occurrence of a string within

another string. The example below uses the InStr() function to

determine whether or not the asterisk character exists in the names in

the table. If it does, it becomes a member of the query's dynaset.

1. Start Microsoft Access, open a database, and create a new table

   called Nametest.

2. Create a text field called Names and enter the following data into

   the table:

      Names

      -----

      *Pat

      Pat*

      Tom

      Ri*ck

      Harry

3. Create a new query based on the Nametest table.

4. Drag the Names field from the field list box into the query grid.

5. In the Field row of the query grid, next to the Names column, type

   in the expression:

      NewField: InStr(1,[Names],"*")

6. In the Criteria row of the same column, enter:

      >0

7. Uncheck the Show check box of that column.

8. Run the query by choosing Run from the Query menu.

You should get the results:

   *Pat

   Pat*

   Ri*ck

This method can be used to obtain a dynaset containing any sequence

of characters -- just change the asterisk in the expression above

to match the string or character you want to search for.

Second Method--Using the Like Operator

--------------------------------------

The Like Operator returns a dynaset that matches a pattern. The example

below uses the Like Operator to determine whether or not the asterisk

character exists in the names in the table. If it does, it becomes a member

of the query's dynaset.

1. Start Microsoft Access, open a database, and create a new table

   called Nametest.

2. Create a text field called Names and enter the following data into

   the table:

      Names

      -----

      *Pat

      Pat*

      Tom

      Ri*ck

      Harry

3. Create a new query based on the Nametest table.

4. Drag the Names field from the field list box onto the query grid.

5. In the Criteria row of the same column, enter:

      Like "*[*]*"

   The first and last * are wildcards, much like the MS-DOS asterisk

   wildcard. The [*] tells Microsoft Access to look for the character

   asterisk  and not to use it as a wildcard.

6. Run the query. You should get the results:

   *Pat

   Pat*

   Ri*ck

This is another method that can be used to obtain a dynaset containing

any sequence of characters -- just change the [*] in the criteria

above to match the string or character you want to search for.

If you are searching for a character that Microsoft Access interprets as a

wildcard, such as *#?[]!-, it must be inside square brackets. For example:

   * should be entered as [*]

   # should be entered as [#]

   ? should be entered as [?]

   [ should be entered as [[]

   ] should be entered as []]

   ! should be entered as [!]

   - should be entered as [-]

Third Method--Using the Find Command

------------------------------------

The Find command searches for the data you specify in the current

table or dynaset. The find command is available in the Datasheet view

of a table, query, or form and in the Form view of a form. The find

dialog box remains open after each search. This enables you to find as

many occurrences as you want without having to choose the find command

repeatedly. This method finds each name with an asterisk one at a

time.

1. Start Microsoft Access, open a database, and create a new table

   called Nametest.

2. Create a text field called Names and enter the following data into

   the table:

      Names

      -----

      *Pat

      Pat*

      Tom

      Ri*ck

      Harry

3. Choose the Edit menu and the Find option.

4. Type in [*]and choose Any Part of Field for Where:.

5. Choose the Find First button and you should get the result:

     *Pat

6. Choose the Find Next button and you should get the result:

     Pat*

7. Choose the Find Next button again and you should get the result:

     Ri*ck

This method can also be used to find any sequence of characters --

just change the [*] in the Find What: to match the string or character

you want to search for. Please see method two regarding searching for

a character that Microsoft Access interprets as a wildcard, such

as *#?[]!-.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 259, 279-280

Microsoft Access "User's Guide," version 1.0, Chapter 15, "Finding and

Sorting Data," pages 370-375

Microsoft Access "User's Guide," version 1.1, Chapter 15, "Finding and

Sorting Data," pages 374-379

Additional reference words: 1.00 1.10 2.00


INF: Two Functions to Calculate Age in Months and Years

 Article Number: Q100136

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article explains how to create a function to calculate the age of

a person or thing based on a given date.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

Enter the following code in a module:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   '==========================================================

   ' General Declaration

   '==========================================================

   Option Explicit

   '*************************************************************

   ' FUNCTION NAME: Age()

   '

   ' PURPOSE:

   '    Calculates age in years from a given date to today's date.

   '

   ' INPUT PARAMETERS:

   '    StartDate: The beginning date (for example, a birth date).

   '

   ' RETURN

   '    Age in years.

   '*************************************************************

   Function Age (varBirthDate As Variant)

      Dim varAge As Variant

      If IsNull(varBirthdate) then Age = 0: Exit Function

      varAge = DateDiff("yyyy", varBirthDate, Now)

      If Date < DateSerial(Year(Now), Month(varBirthDate),_

                           Day(varBirthDate)) Then

         varAge = varAge - 1

      End If

      Age = varAge

   End Function

   '*************************************************************

   ' FUNCTION NAME: AgeMonths()

   '

   ' PURPOSE:

   '    Compliments the Age() function by calculating the number of months

   '    that have expired since the last month supplied by the given date.

   '    If the given date is a birthday, the function returns the number of

   '    months since the last birthday.

   '

   ' INPUT PARAMETERS:

   '    StartDate: The beginning date (for example, a birthday).

   '

   ' RETURN

   '    Months since the last birthday.

   '*************************************************************

   Function AgeMonths(ByVal StartDate As String)

      Dim tAge As Double

      tAge = (DateDiff("m", StartDate, Now))

      If (DatePart("d", StartDate) > DatePart("d", Now)) Then

          tAge = tAge - 1

      End If

      If tAge < 0 Then

         tAge = tAge + 1

      End If

      AgeMonths = tAge Mod 12

   End Function

Testing the Age() and AgeMonths() Functions

-------------------------------------------

The following steps describe how to test the Age() and AgeMonths()

functions:

1. Open a module or create a new one.

2. From the View menu, choose Immediate Window.

3. Assume your friend's birth date was November 15, 1967 and today is

   June 3, 1993. Type the following in the Immediate window and press

   ENTER:

      ? Age("11/15/67")

   Microsoft Access responds with the value 25 (years).

4. Type the following and press ENTER:

      ? AgeMonths("11/15/67")

   Microsoft Access responds with the value 6, indicating that six

   months have passed since this person's last birthday. Your friend

   is 25 years and six months old.

Using the Age() and AgeMonths() Functions

-----------------------------------------

The following procedure explains how to mark old orders by placing the

age value in a new control:

1. In the sample database NWIND.MDB, enter the Age() and AgeMonth()

   functions in a new module.

2. Open the Orders form in Design view and add an unbound text box.

3. Type the following in the ControlSource property of the new

   control:

      =Age([Order Date]) & " ys " & AgeMonths([Order Date]) & " mo"

4. Switch to Form view. The age of the order is displayed in the new

   control.

Additional reference words: 1.00 1.10 2.00 birth birthday birthdate age


INF: Creating Queries to Execute Cascading Updates

 Article Number: Q100137

 CREATED: 16-JUN-1993

 MODIFIED: 22-AUG-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article demonstrates how to create a query that automatically

updates the many side of a one-to-many relationship when you change a

value on the one side.

NOTE: You can do this only if referential integrity is not enforced

in the relationship.

MORE INFORMATION

In the sample database NWIND.MDB, there is a one-to-many relationship

between the Categories and Products tables. The following steps

explain how to create a query that automatically updates information

in the Products table (many side) whenever you change a value in the

Categories table (one side).

1. Open NWIND.MDB.

2. Make a copy of the Categories table and name it Categories Test.

   Make a copy of the Products table and name it Products Test.

3. From the Edit menu, choose Relationships. Establish a one-to-many

   relationship between Categories Test and Products Test on the

   Category ID field. Do not enforce referential integrity.

4. Create a new query based on the Categories Test and the Products

   Test tables. From the View menu, choose Table Names.

5. Drag the Category ID field from both the Categories Test and

   Products Test tables to the QBE grid.

6. From the Query menu, choose Update. Design your query as follows:

      Query: UpdateManySide

      ----------------------

      FieldName: Category ID

         Table: Categories Test

         Update To: [Enter New Value]

         Criteria: [Enter Old Value]

      FieldName: Category ID

         Table: Products Test

         Update To: [Enter New Value]

         Criteria: [Enter Old Value]

7. From the Query menu, choose Run.

8. In the Enter New Value box, type "FISH" and choose OK. In the Enter

   Old Value box, type "SEAF". Note that Microsoft Access tells you

   how many records will be updated. Choose OK and save the query.

9. Open the Categories Test and Products Test tables. Note that "SEAF"

   has been changed to "FISH" on both the one side (Categories Test)

   and the many side (Products Test) of the one-to-many relationship.

Additional reference words: 1.00 1.10 queries one-to-many relationship


PRB: New OLE Field is Created as Text Box in a New Form

 Article Number: Q100138

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

With a form open in Design view, you drag an OLE field from the field

list onto the form. Microsoft Access creates a text box instead of a

bound object frame. When you switch to Form view, you can type text in

the text box. However, if you open the table the form is based on, you

see "Invalid Object" in the OLE field.

CAUSE

If you have a form open in Design view, and then open the table the

form is based on in Design view and add an OLE field that you then

drag onto the form, this behavior will occur.

RESOLUTION

Save and reopen the form before dragging the new OLE field onto the

form. After the form has been saved and reopened, an OLE field that is

dragged from the field list onto the form will correctly generate a

bound object frame.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create and save the following table as Table1:

      Table: Table1

      -----------------

      Field Name: Stuff

      Data Type: Text

2. Create a new form based on Table1 and do not save it. Place the

   field named Stuff on the form.

      Object: Text box

      ---------------------

      Control Name: Stuff

      Control Source: Stuff

3. With the form still open in Design view, open Table1 in Design view

   and add the following field. Save and close Table1.

      Table: Table1

      ---------------------

      Field Name: Photo

      Data Type: OLE Object

4. With the form selected, show the field list by choosing Field List

   from the View menu. Drag the new OLE field, Photo, from the field

   list onto the form. Microsoft Access will create a text box instead

   of a bound object frame.

Additional reference words: 1.00 1.10 2.00 update


INF: Database Normalization Basics

 Article Number: Q100139

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article explains database normalization terminology for

beginners. A basic understanding of this terminology is helpful when

discussing the design of a relational database.

MORE INFORMATION

Description of Normalization

----------------------------

Normalization is the process of organizing data in a database. This

includes creating tables and establishing relationships between those

tables, according to rules designed both to protect the data and to

make the database more flexible by eliminating two factors: redundancy and

inconsistent dependency.

Redundant data wastes disk space and creates maintenance problems. If

data that exists in more than one place must be changed, the data must

be changed in exactly the same way in all locations. A customer

address change is much easier to implement if that data is stored only

in the Customers table and nowhere else in the database.

What is an "inconsistent dependency"? While it is intuitive for a user

to look in the Customers table for the address of a particular

customer, it may not make sense to look there for the salary of the

employee who calls on that customer. The employee's salary is related

to, or dependent on, the employee and thus should be moved to the

Employees table. Inconsistent dependencies can make data difficult to

access; the path to find the data may be missing or broken.

There are a few rules for database normalization. Each rule is called

a "normal form." If the first rule is observed, the database is said

to be in "first normal form." If the first three rules are observed,

the database is considered to be in "third normal form." Although

other levels of normalization are possible, third normal form is

considered the highest level necessary for most applications.

As with many formal rules and specifications, real world scenarios do

not always allow for perfect compliance. In general, normalization

requires additional tables and some customers find this cumbersome. If

you decide to violate one of the first three rules of normalization,

make sure that your application anticipates any problems that could

occur, such as redundant data and inconsistent dependencies.

NOTE: The following descriptions include examples.

First Normal Form

-----------------

 - Eliminate repeating groups in individual tables.

 - Create a separate table for each set of related data.

 - Identify each set of related data with a primary key.

Do not use multiple fields in a single table to store similar data.

For example, to track an inventory item that may come from two

possible sources, an inventory record may contain fields for Vendor

Code 1 and Vendor Code 2.

But what happens when you add a third vendor? Adding a field is not

the answer; it requires program and table modifications and does not

smoothly accommodate a dynamic number of vendors. Instead, place all

vendor information in a separate table called Vendors, then link

inventory to vendors with an item number key, or vendors to inventory

with a vendor code key.

Second Normal Form

------------------

 - Create separate tables for sets of values that apply to multiple

   records.

 - Relate these tables with a foreign key.

Records should not depend on anything other than a table's primary key

(a compound key, if necessary). For example, consider a customer's

address in an accounting system. The address is needed by the

Customers table, but also by the Orders, Shipping, Invoices, Accounts

Receivable, and Collections tables. Instead of storing the customer's

address as a separate entry in each of these tables, store it in one

place, either in the Customers table or in a separate Addresses table.

Third Normal Form

-----------------

 - Eliminate fields that do not depend on the key.

Values in a record that are not part of that record's key do not

belong in the table. In general, any time the contents of a group of

fields may apply to more than a single record in the table, consider

placing those fields in a separate table.

For example, in an Employee Recruitment table, a candidate's

university name and address may be included. But you need a complete

list of universities for group mailings. If university information is

stored in the Candidates table, there is no way to list universities

with no current candidates. Create a separate Universities table and

link it to the Candidates table with a university code key.

EXCEPTION: Adhering to the third normal form, while theoretically

desirable, is not always practical. If you have a Customers table

and you want to eliminate all possible interfield dependencies, you

must create separate tables for cities, ZIP codes, sales

representatives, customer classes, and any other factor that may

be duplicated in multiple records. In theory, normalization is

worth pursing; however, many small tables may degrade performance

or exceed open file and memory capacities.

It may be more feasible to apply third normal form only to data that

changes frequently. If some dependent fields remain, design your

application to require the user to verify all related fields when any

one is changed.

Other Normalization Forms

-------------------------

Fourth normal form, also called Boyce Codd Normal Form (BCNF), and

fifth normal form do exist, but are rarely considered in practical

design. Disregarding these rules may result in less than perfect

database design, but should not affect functionality.

***********************************

*  Examples of Normalized Tables  *

***********************************

Normalization Examples:

Unnormalized table:

    Student#   Advisor   Adv-Room  Class1   Class2   Class3

    -------------------------------------------------------

    1022       Jones      412      101-07   211-02   214-01

1. First Normal Form:  NO REPEATING GROUPS

   Tables should have only two dimensions. Since one student has

   several classes, these classes should be listed in a separate

   table. Fields Class1, Class2, & Class3 in the above record are

   indications of design trouble.

   Spreadsheets often use the third dimension, but tables should not.

   Another way to look at this problem: with a one-to-many

   relationship, do not put the one side and the many side in the same

   table. Instead, create another table in first normal form by

   eliminating the repeating group (Class#), as shown below:

     Student#   Advisor   Adv-Room    Class#

     ---------------------------------------

     1022      Jones      412       101-07

     1022      Jones      412       143-01

     1022      Jones      412       159-02

     4123      Smith      216       201-01

     4123      Smith      216       211-02

     4123      Smith      216       214-01

2. Second Normal Form:  ELIMINATE REDUNDANT DATA

   Note the multiple Class# values for each Student# value in the

   above table. Class# is not functionally dependent on Student#

   (primary key), so this relationship is not in second normal form.

   The following two tables demonstrate second normal form:

    Students:   Student#    Advisor   Adv-Room

                ------------------------------

                1022        Jones       412

                4123        Smith       216

    Registration:   Student#    Class#

                    ------------------

                    1022        101-07

                    1022        143-01

                    1022        159-02

                    4123        201-01

                    4123        211-02

                    4123        214-01

3. Third Normal Form: ELIMINATE DATA NOT DEPENDENT ON KEY

   In the last example, Adv-Room (the advisor's office number) is

   functionally dependent on the Advisor attribute. The solution is to

   move that attribute from the Students table to the Faculty table,

   as shown below:

    Students:   Student#    Advisor

                -------------------

                1022        Jones

                4123        Smith

    Faculty:    Name    Room    Dept

                --------------------

                Jones   412     42

                Smith   216     42

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 18-19

"FoxPro 2 A Developer's Guide," Hamilton M. Ahlo Jr. et al., pages

220-225, M & T Books, 1991

"Using Access for Windows," Roger Jennings, pages 799-800, Que

Corporation, 1993

Additional reference words: 1.00 1.10 2.00 BCNF relational model normal


INF: How to Use TimeValue() to Calculate Difference in Times

 Article Number: Q100141

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to use the TimeValue() function to find the

difference between two values that have Date/Time data types and that

occur within a 24-hour period.

MORE INFORMATION

To set up an example that uses the TimeValue() function, create a form

with the following text boxes:

   Object: Text Box

   ----------------

   ControlName: Start_Time

   Object: Text Box

   ----------------

   ControlName: End_Time

To calculate the difference between the times in these two fields,

create a third text box with the following properties:

NOTE: In the following sample code, an underscore (_) is used as a

line-continuation character. Remove the underscore when re-creating

this code.

   Object: Text Box

   ----------------

   ControlName: Time_Difference

   ControlSource: =Format(TimeValue([End_Time])_

                   -TimeValue([Start_Time]),"Short Time")

Note that in the example above, the Format() function is used to

format the time difference. Short Time displays the difference in

hours and minutes.

REFERENCES

==========

For more information on formatting values, search for "format" then

"format, format$" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


INF: How to Not Display the Form Name in the Caption Bar

 Article Number: Q100142

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

Microsoft Access will display the name of the form in the caption bar

by default.

To alter the form so that it does not display a caption, type a single

space in the Caption property of the form.

Additional reference words: 1.00 1.10 2.00 Forms


INF: How to Remove the Menu Bar from a Form

 Article Number: Q100143

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

To remove the menu bar from a form, enter =1 (or any Access Basic

function that evaluates to a numeric result) in the OnMenu property of

the form in Microsoft Access version 1.x, or in the MenuBar property in

Microsoft Access version 2.0.

MORE INFORMATION

Entering =1 causes Microsoft Access to evaluate the property. Because

there is nothing to place in the menu bar, the menu bar is not displayed.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 339-340

Additional reference words: 1.00 1.10 2.00


PRB: Show All Records Menu Choice not Available

 Article Number: Q100144

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

While in a form, the Show All Records command on the Records menu is

not available.

CAUSE

There are three possible causes for this behavior:

 - The form's AllowFilters property is set to No.

 - The form is not bound to a table or query.

 - The form is a subform whose main form meets one of the above criteria.

RESOLUTION

Set the form's AllowFilters property to Yes, or bind the main form to a

table or query by adding that table or query to the form's RecordSource

property.

STATUS

This behavior is by design.

MORE INFORMATION

When the AllowFilters property is set to No, the following commands on

the Records menu will not be available: Edit Filter/Sort, Apply

Filter/Sort, and Show All Records.

REFERENCES

==========

For more information on the AllowFilters property, search for

"AllowFilters" then "AllowFilters Property" using the Microsoft Access

Help menu.

Additional reference words: 1.00 1.10 2.00 default sort allow filters


PRB: Excess or Garbled Information Appears in List Box

 Article Number: Q100145

 CREATED: 16-JUN-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SYMPTOMS

When you are viewing a form that has a list box, unwanted or excess

information appears in the list box.

CAUSE

There is a control located underneath the list box.

RESOLUTION

In Design view, remove the underlying control, or reposition the list

box.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version

1.0. This problem no longer occurs in Microsoft Access version 1.1.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Open the Employees form in Design view.

3. Add a list box with the following properties to the form:

      Object: list box

      --------------------------

      ControlName: List Box Test

      ControlSource: Employee ID

      RowSourceType: Table/Query

      RowSource: Employees

      Left: 2.99 in

      Top: 0.67 in

4. Position the new list box on top of the First Name control.

5. View the form in Form view.

6. Move among the records in the form. At first, the list box displays

   the correct information, but as you move among the records the

   information in the underlying control begins to appear in the list

   box, making the information appear garbled.


INF: How to Print Duplicate Mailing Labels for Each Record

 Article Number: Q100146

 CREATED: 16-JUN-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to print multiple labels for each customer

record. The example that follows uses the Customers table in the

sample NWIND.MDB database.

MORE INFORMATION

The following example generates 10 labels for each customer record:

1. In the sample database NWIND.MDB, create a new table called Label Count

   with one number field. Use the default properties and do not create a

   primary key. Enter a 1 in the first record, 2 for the second record, and

   so on.

      Table: Label Count

      ------------------

      FieldName: Count

         DataType: Number

2. Create a new query based on the Label Count and Customers tables:

      Query: LabelQuery

      ---------------------------------

      Type: Select Query

      Tables: Label Count and Customers

      Join: None

3. From the View menu, choose Totals so that all fields are set to

   Group By, as follows:

      Field: Company Name

         Table: Customers

         Total: Group By

      Field: Contact Name

         Table: Customers

         Total: Group By

      Field: Address

         Table: Customers

         Total: Group By

      Field: City

         Table: Customers

         Total: Group By

      Field: Region

         Table: Customers

         Total: Group By

      Field: Postal Code

         Table: Customers

         Total: Group By

     Field: Count

         Table: Label Count

         Total: Group By

         Criteria: <= [Enter Number of Labels to Print for Each

                   Customer]

   NOTE: The Count field in the Label Count table can have an optional

   parameter value specified in the Criteria field to enter the number of

   labels to print for each record in the Customers table. If this query is

   used without a parameter value, 10 identical labels are printed for each

   record in the Customers table.

4. Using the Microsoft Access ReportWizard, create a new mailing label

   report based on the LabelQuery query. If you specify a parameter value,

   you are prompted to enter the number of labels to print for each

   customer record.

Additional reference words: 1.00 1.10 2.00 multiple many labels


PRB: Error When Using OpenQueryDef Method on Parameter Query

 Article Number: Q100147

 CREATED: 16-JUN-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you are using the OpenQueryDef method on a parameter query, the

error message "Couldn't Find Object" appears when you re-create the

sample code on page 137 of the Microsoft Access "Introduction to

Programming" manual.

CAUSE

There are three likely causes for this error message:

 - The name of the query you are trying to open is misspelled

 - The parameter is misspelled

 - The parameter is not explicitly defined

In the sample code on page 137, both the query name and the parameter are

misspelled.

RESOLUTION

The following sample function is a correction to the errors in the sample

on page 137 of the Microsoft Access "Introduction to Programming" manual:

   '*****************************************************************

   ' Declarations section of the module

   '*****************************************************************

   Option Explicit

   Function TestQP ()

      Dim db As Database, Q As QueryDef, DataRecs As Dynaset

      Set db = CurrentDB()

      Set Q = db.OpenQueryDef("Products by Category (Parameter)")

      Q![Enter a category id:] = "COND"    'This is an explicit parameter

      Set DataRecs = Q.CreateDynaset()

      DataRecs.Close

      Q.Close

   End Function


INF: OpenDatabase and CloseDatabase Pseudo Actions

 Article Number: Q100148

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.1 and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access includes two "pseudo actions," or dynamic data exchange

(DDE) commands, called OpenDatabase and CloseDatabase. These commands are

available through the DDE SYSTEM topic, and allow you to open and close

Microsoft Access databases over a DDE channel.

MORE INFORMATION

The syntax for the OpenDatabase and CloseDatabase pseudo actions is

   OpenDatabase <Database_Location>

   CloseDatabase

where <Database_Location> is the path and filename of the Microsoft

Access database to be opened. The CloseDatabase action does not take a

parameter since Microsoft Access can have only one database open at a

time.

The following sample Microsoft Excel macro demonstrates how the

OpenDatabase and CloseDatabase pseudo actions work.

NOTE: This macro will not work with Microsoft Access version 1.0.

1. Start Microsoft Access (Microsoft Access must already be running

   in order for this macro to work).

2. Open a new macro sheet in Microsoft Excel. Enter the following

   macro:

      Cell    Command

      -------------------------------------------------

      A1      PseudoOpenCloseDDEExample

      A2

      A3      chan=INITIATE("MSACCESS","SYSTEM")

      A4      =APP.ACTIVATE("Microsoft Access",FALSE)

      A5      =EXECUTE(chan,"[opendatabase nwind.mdb]")

      A6      =EXECUTE(chan,"[Sample AutoExec]")

      A7      =EXECUTE(chan,"[closedatabase]")

      A8      =TERMINATE(chan)

      A9      =APP.ACTIVATE(,FALSE)

      A10     =RETURN()

3. Size your Microsoft Access and Microsoft Excel windows so that you

   can view both applications at the same time.

4. Select cell A3. From the Macro menu, choose Run, and then choose

   OK.

The commands in cells A3 and A4 initiate a DDE channel to Microsoft

Access on the SYSTEM topic and activate the Microsoft Access

application.

The command in cell A5 opens the sample database NWIND.MDB in the

current working directory, using the OpenDatabase pseudo action.

The command in cell A6 runs the Sample AutoExec macro in the NWIND.MDB

database.

The command in cell A7 closes the currently opened database file using

the CloseDatabase pseudo action.

The commands in cells A8-A10 terminate the DDE channel, activate the

Microsoft Excel application, and end the macro.

REFERENCES

==========

For more information on using macro actions in DDE, query on the

following words here in the Microsoft Knowledge Base:

   dde and macro and action

Additional reference words: 1.00 1.10 2.00 OLE/DDE server


INF: How to Use the Quit Macro Action

 Article Number: Q100149

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.1 and 2.0

---------------------------------------------------------------------

SUMMARY

This article demonstrates how to use the Quit macro action to quit

Microsoft Access over a dynamic data exchange (DDE) channel.

MORE INFORMATION

The syntax for the Quit action is:

   Quit

There are no parameters for the Quit action.

The following sample Microsoft Excel macro demonstrates the Quit macro

action.

NOTE: This macro will not work with Microsoft Access version 1.0.

1. Open a new macro sheet in Microsoft Excel and enter the following

   macro:

      Cell     Command

      ------------------------------------------------

      A1       QuitDDEExample

      A2

      A3       =APP.MINIMIZE()

      A4       =ERROR(FALSE)

      A5       =APP.ACTIVATE("Microsoft Access",FALSE)

      A6       chan=INITIATE("MSACCESS","system")

      A7       =APP.ACTIVATE("Microsoft Access",FALSE)

      A8       =EXECUTE(chan,"[QUIT]")

      A9       =TERMINATE(chan)

      A10      =APP.ACTIVATE(FALSE)

      A11      =RETURN()

2. Before running this macro, size your Microsoft Access and Microsoft

   Excel windows so that you can view both applications at the same

   time.

3. To run the macro, select cell A3. From the Macro menu, choose Run

   and then choose OK.

REFERENCES

==========

For more information on using macro actions in DDE, query on the

following words here in the Microsoft Knowledge Base:

   access and 1.1 and dde and macro and action

Additional reference words: 1.00 1.10 2.00 OLE/DDE server


PRB: Macro on Subform Control Executed by Main Form

 Article Number: Q100150

 CREATED: 16-JUN-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If a macro is attached to the OnEnter or OnExit property of the first

control in the tab order of a subform, the macro will run each time

you move from one record to another in the main form.

In addition, a macro attached to the OnEnter property of the first

control in the tab order of the subform will run when the main form is

opened, and a macro attached to the OnExit property of the first

control in the tab order of the subform will run when the main form is

closed.

CAUSE

To cause a macro to run only when you are actually moving in and out

of the subform, a test condition with a flag can be used. A macro can

set a flag on the main form to indicate whether the subform was

entered by moving into the subform from the main form. The macro

attached to the subform's OnEnter and OnExit properties can check this

flag to see if you really did move into the subform and continue

running if appropriate. The following steps demonstrate how to set up

and test for this condition.

RESOLUTION

1. Create the following macro called Subform Flag:

      Macro Name     Action

      -----------------------

      Set            SetValue

      UnSet          SetValue

      Subform Flag Actions

      -----------------------

      SetValue

         Item: [Subform Flag]

         Expression: True

      SetValue

         Item: [Subform Flag]

         Expression: False

2. For a form named MyForm, create an unbound text box on the main

   form with the following properties:

      Form: MyForm

      Text Box: Subform Flag

         Name: Subform Flag (in version 1.x, ControlName: Subform Flag)

         Visible: No

         Default Value: False

3. Select the subform control on the main form and change the

   following properties:

      Form: MyForm Subform:

         On Enter: Subform Flag.Set

         On Exit: Subform Flag.UnSet

4. Add the following macro action to the top of the macro that is

   attached to the OnEnter or OnExit property of the first control in

   the tab order of the subform. The macro will not perform any other

   actions if the subform flag is not set.

      Condition                       Action

      -----------------------------------------

      Parent![Subform Flag] = False   StopMacro

The macro attached to the OnEnter property of the first control

in the subform will not run if you enter the control from the main

form and the control is in the selected record on the subform (denoted

by a triangle in the record selector). As a result, the macro will not

run when you enter the subform by pressing TAB, or by clicking the

first control in the selected record on the subform. However, the

macro will run if you click this control on a different record in the

subform.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB and create the following macro called

   Test:

      MacroName     Action

      --------------------

      Test          MsgBox

      Test1 Actions

      --------------------

      MsgBox

         Message: Testing!

2. Open the "Orders Subform" and change the OnEnter and OnExit

   properties of the Property ID box to Test.

      Form: Orders Subform

         OnEnter: Test

         OnExit: Test

3. Save the "Orders Subform," open the Orders form, and move among the

   records. The message "Testing!" will appear twice for each record.

REFERENCES

==========

Microsoft Access "User's Guide," versions 1.0 and 1.1, Chapter 22, "Using

Macros with Forms"

Microsoft Access "User's Guide," version 2.0, Chapter 25, "Using Macros

with Forms"

Additional reference words: 1.00 1.10 2.00 Exit Enter


PRA: TrueType Fonts Shift Vertically on HP LJ4 Printer

 Article Number: Q100151

 CREATED: 16-JUN-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

When you print a Microsoft Access form or report formatted

with a

TrueType font to a Hewlett-Packard (HP) LaserJet 4 printer,

the text

in the controls is shifted vertically. These symptoms also

occur with

the IBM 4029 printer.

CAUSE

The HP LaserJet 4 and IBM 4029 printer drivers are reporting

incorrect

font metrics for some TrueType fonts. This problem causes

Microsoft

Access to incorrectly compensate by shifting the fonts

vertically when

sending the form or report to the printer.

RESOLUTION

Use a non-TrueType font when you print to either the HP

LaserJet 4 or

IBM 4029 printer, or use another printer driver that is

compatible

with these printers (for example, the HP LaserJet 3 printer

driver).

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0, using HP LaserJet 4 printer driver versions

31.1.03 and

31.V1.08, or the IBM 4029 printer driver. This problem no

longer occurs

in Microsoft Access version 1.1.

MORE INFORMATION

If you experience the same problem with a non-TrueType font,

verify

that you are using a printer font. If Microsoft Windows is

remapping

your font to a TrueType font, you will continue to see the

same

vertical shift when you try to print.

Steps to Reproduce Problem

--------------------------

The following example assumes that you have an HP LasetJet 4

printer

connection and that you are using a HP LaserJet 4 printer

driver

version 31.1.03 or 31.V1.08:

1. Create a new, unbound form.

2. Add two text box controls to the form, as follows:

      Object: Text Box

      ------------------------------------------

      ControlName: Field0

         ControlSource: ="Testing TrueType font"

         FontName: Arial

      Object: Text Box

      ----------------------------------------------

      ControlName: Field2

         ControlSource: ="Testing non-TrueType font"

         FontName: Microsoft Sans Serif

3. Switch to Form view.

4. Verify that you are configured to print to an HP LaserJet

4

   printer, then choose Print Preview from the File menu.

The data

   looks normal and is not shifted in either control.

5. From the File menu, choose Print. Note that the data in

Field0 is

   shifted vertically in the control; the data in Field2

maintains the

   correct position.

The HP LaserJet 4 printer driver (HPPCL5E.DRV) is

manufactured by

Hewlett-Packard Company, a vendor independent of Microsoft;

we make no

warranty, implied or otherwise, regarding this product's

performance

or reliability.

Additional reference words: 1.00 PtrIss HP4 HPLJ4


PRA: Cannot Use ReportWizard Without Default Windows Printer

 Article Number: Q100152

 CREATED: 16-JUN-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You cannot preview or print a report that you created using a Microsoft

Access ReportWizard if you do not first define a default Windows printer on

your system.

If a default Windows printer is not defined, the following error message

appears when you choose Print Preview or Print from the File menu:

   There is no default printer. Select or install one using Windows

   Control Panel.

You will also encounter this error message if no default printer is defined

when you edit the report in Microsoft Access version 1.x. In version 2.0,

you can edit the report, but not print or preview it, with no default

printer defined.

RESOLUTION

Follow the steps below to define a default printer:

1. In Windows Control Panel, double-click the Printers icon.

2. If your printer does not appear in the Installed Printers box, choose

   the Add button, select your printer in the List Of Printers box, and

   then choose Install to install the driver for your printer.

3. Once the driver for your printer is installed, choose the Connect

   button. In the Ports box, select the correct port for your printer, and

   then choose OK.

4. Choose the Set As Default Printer button.

5. Choose the Close button.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1, and 2.0. We are researching this problem, and will post new

information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. In Windows Control Panel, double-click the Printers icon. In the

   Installed Printers box, select the default printer, then choose Remove.

2. Start Microsoft Access, and then open the sample database NWIND.MDB.

3. Using a ReportWizard, create a new report based on one of the

   tables (for example, Categories). Do not create a blank report.

   When the ReportWizard tries to preview the report, the following error

   message will be displayed:

      There is no default printer. Select or install one using Windows

      Control Panel.

   In Microsoft Access version 1.x, the error message will appear twice. In

   version 2.0, the error message will appear once, and then the report

   will open in Design view.

4. Re-install your default printer in Windows Control Panel.

Additional reference words: 1.00 1.10 2.00 reports reportwizard


INF: How to Use DataPerfect Data in Microsoft Access

 Article Number: Q100153

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to import data into Microsoft Access from

WordPerfect DataPerfect.

MORE INFORMATION

To use DataPerfect data in Microsoft Access, the information must first be

saved from DataPerfect in DOS Delimited Text format. Once this is done,

Microsoft Access can import the data using the Import command's "Text

(Delimited)" option.

Problems with Multiple-Line Field Entries

-----------------------------------------

DataPerfect allows you to create multiple-line entries by pressing ENTER

inside fields (creating a carriage return character). For example, in the

Customer Information panel of the CLIENT1 database supplied with

DataPerfect, the Address and Comment fields in some records contain two-

line entries.

NOTE: In DataPerfect, a "panel" is equivalent to a Microsoft Access

table.

DataPerfect's DOS Delimited Text files use a carriage return to mark the

end of each record, so carriage returns cannot be included in field data.

However, DataPerfect does not account for this condition when it saves the

data in DOS Delimited Text format. When carriage returns are included in

field data, DataPerfect generates a file that cannot be successfully

imported into Microsoft Access. You must remove the carriage returns before

importing the data into Microsoft Access.

The following instructions explain how to:

 - Export the Customer Information panel supplied with DataPerfect.

 - Use Microsoft Write, the word processor supplied with Microsoft

   Windows, to delete the extra carriage returns.

 - Import the resulting data into Microsoft Access.

How to Export the Panel from DataPerfect

----------------------------------------

1. Start DataPerfect.

2. From the list of databases, select CLIENT1 and press ENTER.

3. From the list of panels, select Customer Information and press

   ENTER.

4. Press SHIFT+F7 to display the report list. Select Built-In Short

   Reports from the list and then press ENTER to access the Built-In

   Report/Export menu.

5. Press 2 to select Disk File On/Off, and then press 1 to select

   Create File. Type "CUST.TXT" (without the quotation marks), and

   press ENTER.

6. Press 8 to select Report/Export Format options. Press 6 to select

   Export DOS Delimited Text.

7. Press ENTER to accept the pipe symbol (|) as the Field Delimiter.

   Press SPACEBAR to overwrite the tilde (~) character as the Record

   Delimiter, leaving the <CR><LF> in place.

8. Press SHIFT+F7 to begin the export, then press any key to return to

   the list of reports.

9. Press F1, then F7 twice, then 0 to exit DataPerfect.

How to Remove the Extra Carriage Returns

----------------------------------------

1. Start Microsoft Write.

2. From the File menu, choose Open.

3. From the list of files, select CUST.TXT (you may first have to select

   your DataPerfect directory, which is usually called DATA). Type "*.TXT"

   (without the quotation marks) and press ENTER to display a list of .TXT

   files.

4. Choose No Conversion when you are asked to convert the text file. The

   document will open on the screen with each field separated by a pipe

   symbol and each record ended with a carriage return. Lengthy records

   will wrap to the next line.

5. Lines that begin with the following text have an extra carriage

   return that incorrectly continues the record to the next line:

      1|Burnett

      26|Corrales, Jr.

      7|Frame

      19|Rhoton

      22|Tolman

   Move to the end of each of these lines, and press DEL to make the line

   flush with the line above it.

6. The second line of the records that begin with the following text

   have extra carriage returns that incorrectly mark the end of the

   record:

    10|Grayson

    21|Sergeant

   Move to the end of the second line of these records and remove

   the extra carriage return by pressing DEL.

7. From the File menu, choose Save.

8. From the File menu, choose Exit.

How to Import the DataPerfect Data into Microsoft Access

--------------------------------------------------------

1. Open the Microsoft Access database into which you want to import

   the data.

2. From the File menu, choose Import.

3. In the Data Source list, select "Text (Delimited)".

4. From the file list choose CUST.TXT (you may first have to select

   your DataPerfect directory, which is usually called DATA), and then

   choose Import.

5. In the Import Text Options box, choose Options.

6. Delete the double quotation mark from the Text Delimiter box.

7. Type the pipe symbol (|) in the Field Separator box.

8. Choose OK to begin the import.

Microsoft Access will report any errors discovered during the import. You

can examine the data in the resulting table and check to see that the

proper data was imported into the proper columns. If you find data from one

record spilling into another record, check for an extra carriage return in

that record in the export text file and then import the data into Microsoft

Access again.

REFERENCES

==========

DataPerfect "User's Guide," pages 339-343

Additional reference words: 1.00 1.10 2.00 WP


PRA: GP Fault with Button Caption Text Longer Than 2048

 Article Number: Q100154

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.1

---------------------------------------------------------------------

SYMPTOMS

You receive the following error message:

   Application Error - MSACCESS caused a General Protection Fault

   in module MSACCESS.EXE at 0058:40DC.

CAUSE

You may have set the caption of a command button to a text string that

is longer than 2048 characters.

RESOLUTION

Caption length is limited to 2048 characters. Using Access Basic to

set the caption to a value larger than 2048 characters can result in

unexpected behaviors, such as the error message described above.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

version 1.1. This problem no longer occurs in Microsoft Access version

2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

The following steps generate the error message described above:

1. Add the following code to an Access Basic module:

      Function mod_CreateForm ()

         Dim F As Form

         Dim C As Control

         Set F = CreateForm("", "")

         Set C = CreateControl(F.FormName, 104, 0, "", "", 100, 100)

         C.Caption = String$(3000, "M")

      End Function

2. Run the code by typing the following in the Immediate window:

      ?mod_CreateForm()

   Note that an icon for the form is created.

3. Restore the form and set the focus to the command button. Click on

   the button as if you planned to change the text in the caption.

4. Try to switch from Design view to Form view. The error message

   described above is displayed.

Additional reference words: 1.00 1.10 caption text string GPF GP fault


INF: Microsoft Access 1.0 (1/14/93) Disks 1-3 Contents (1.44M)

 Article Number: Q100155

 CREATED: 16-JUN-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SUMMARY

The following lists the directory contents of Disks 1-3 shipped with

Microsoft Access version 1.0 with a release date of 1/14/93 (3.5 inch,

1.44 MB).

Note that the WBTRCALL.DLL file was removed from this release of

Microsoft Access. Due to this removal, the SETUP.EXE program was

changed. The functionality of Microsoft Access was not changed in any

way for this release.

MORE INFORMATION

Contents of Disk 1

---------------------------------------

1        WMF      4470 01-04-93  12:00a

1E       WMF      4022 01-04-93  12:00a

BTRVISAM DL$     57918 01-04-93  12:00a

COMMDLG  DL$     46406 10-09-92  10:02a

COMMDLG  DL_     89248 01-04-93  12:00a

CTL3D    DL$      7524 08-16-92   7:35p

DBSISAM  DL$    135919 01-04-93  12:00a

DDEML    DL$     20305 03-10-92   3:10a

DETCMD   DL_     24128 01-04-93  12:00a

MSACCESS IN$       519 01-04-93  12:00a

MSACCESS RE$       552 01-04-93  12:00a

MSAIN100 DL$     71625 01-04-93  12:00a

MSAJU100 DL$     38945 01-04-93  12:00a

OLECLI   DL$     41083 10-09-92  10:02a

OLESVR   DL$     13129 10-09-92  10:02a

ORDENTRY TX$      2281 01-04-93  12:00a

ORDENTRY HL$     14224 01-04-93  12:00a

ORDENTRY MD$    200396 01-04-93  12:00a

PIM      HL$      8119 01-04-93  12:00a

SETUP    EXE     21472 01-04-93  12:00a

SETUP    INI       149 01-04-93  12:00a

SHARE    EX$      8112 10-09-92  10:02a

SHELL    DL$     23296 10-09-92  10:02a

SMALLB   FO$      9687 03-06-92   7:16p

SMALLE   FO$     11236 03-06-92   7:16p

SMALLF   FO$      9376 03-06-92   7:16p

STFSETUP EX_    477392 01-04-93  12:00a

STFSETUP IN_     58041 01-04-93  12:00a

VER      DL$      5653 10-09-92  10:02a

VER      DL_      9008 01-04-93  12:00a

WORKGRP  IN_      1393 01-04-93  12:00a

       31 file(s)    1415628 bytes

Contents of Disk 2

---------------------------------------

2        WMF      8022 01-04-93  12:00a

2E       WMF      6870 01-04-93  12:00a

MSACCESS HL$   1189376 01-04-93  12:00a

PDXISAM  DL$    106830 01-04-93  12:00a

REGEDIT  EX$     18176 10-09-92  10:02a

        5 file(s)    1329274 bytes

Contents of Disk 3

---------------------------------------

3        WMF      8950 01-04-93  12:00a

3E       WMF      8470 01-04-93  12:00a

MSABC100 DL$    187802 01-04-93  12:00a

MSAES100 DL$     16899 01-04-93  12:00a

MSAFIN   DL$     18553 01-04-93  12:00a

WIZARD   MD$    174297 01-04-93  12:00a

MSACCESS EX$    790199 01-04-93  12:00a

        7 file(s)    1205170 bytes


INF: How to Specify a Custom Starting Page Number for a Report

 Article Number: Q100156

 CREATED: 16-JUN-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

In Microsoft Access reports, page numbering always starts with the

number 1. However, you may want your report to have page numbering

that starts with some number other than 1. This article describes two

methods of defining custom starting page numbers. Both methods provide

custom page numbers; however, the second method uses Access Basic and

can therefore include error checking. This method is more complex, but

avoids the possibility that a nonnumeric value will be entered when

you are prompted for a starting number.

MORE INFORMATION

Method 1

--------

In Design view of any report with page numbering, change the

ControlSource property of the text box for page numbering from "=Page"

to "=Page + [Enter a Starting Page Number] -1". This will cause

Microsoft Access to prompt you to enter a starting page number each

time the report is previewed or printed.

For example, in the sample database NWIND.MDB, open the "Alphabetical

List of Products" report in Design view. On the right side of the page

footer, there is a text box with a ControlSource property of "=Page".

Change this property of the text box to "=Page + [Enter a Starting Page

Number] -1".

Method 2

--------

This method assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

1. Open a new module or a previously created module and enter the

   following code:

      '******************************************************

      'Declarations Section of Module

      '******************************************************

      Option Explicit

      Global PageChoice As Integer

      '===========================================================

      'Create the following GetPageChoice() function in the Module

      '===========================================================

      'This function is called in the OnOpen property of the Report.

      Function GetPageChoice ()

         Dim choice As String

         Do

            choice = InputBox("Enter a Starting Page Number:","_

                          Number Report", "1")

            If Not (IsNumeric(choice)) Then

               MsgBox "Value Entered is not a Number."

            End If

         Loop While Not (IsNumeric(choice))

         PageChoice = CInt(choice)

      End Function

      '==============================================================

      'Create the following ReturnPageChoice() function in the Module

      '==============================================================

      'This function is called by the text box that will contain the

      ' pagenumber.

      Function ReturnPageChoice (pgnumber As Integer)

         ReturnPageChoice = PageChoice + pgnumber - 1

      End Function

2. Open your report in Design view.

3. From the Edit menu choose Select Report, then from the View menu

   choose Properties to display the property sheet. Change the OnOpen

   property to:

      OnOpen: =GetPageChoice()

4. In the page footer of the report create a text box with the

   following properties:

      Text Box:      Text1

      ----------------------------------------------------------

      Name: PageNumber (in version 1.x, ControlName: PageNumber)

      ControlSource: =ReturnPageChoice(Page)

When you preview or print the report, you will be prompted for a

starting page number. Each page will be numbered consecutively

starting with this number.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 18, "Designing

Reports," pages 422-424 and 440-444, and Chapter 23, "Using Macros to Print

Reports or Transfer Data," pages 571-572

Microsoft Access "Language Reference," version 1.0, page 364

Microsoft Access "User's Guide," version 2.0, Chapter 26, "Using Macros to

Print Reports or Transfer Data"

Additional reference words: 1.00 1.10 2.00


PRA: Help Context ID Property Does Not Work in Subform

 Article Number: Q100157

 CREATED: 16-JUN-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

If you press the F1 key to invoke the Help system when the

insertion

point is in a subform control, Microsoft Access invokes the

main form's

Help file Contents window, rather than invoking the

appropriate Help

topic for the subform control.

CAUSE

Microsoft Access ignores the Help ContextID property of the

subform

control.

RESOLUTION

As a workaround for this problem, you can follow the steps

below to

create a custom Help function that will test to determine

which control

is active on a form, and then call the Microsoft Windows

Help() API

function to invoke the appropriate Help topic for that

control:

1. Create the following macro and save it as AutoKeys:

      MacroName     Action

      ---------------------

      {F1}          RunCode

      AutoKeys Actions

      --------------------------------------------------

      RunCode

         Function Name: =Help("<c:\access\yourhlp.hlp>")

      NOTE: Substitute the correct drive, path, and filename

for the

      Help file you want to use in the example above.

2. Create a module with the following sample code:

   NOTE: In the following sample code, an underscore (_) is

used as a

   line-continuation character. Remove the underscore when

re-creating

   this code in Access Basic.

'***********************************************************

**

   'Declarations section of the module

'***********************************************************

**

   Option Explicit

   Declare Function WinHelp% Lib "User" (ByVal hwnd%, ByVal

lpHelpFile$,_

                                         ByVal wCmd%, ByVal

dwData As

   Any)

   Global Const HELP_CONTEXT = &H1

   Global Const HELP_CONTENTS = &H3

'***********************************************************

**

   ' FUNCTION NAME: Help()

   '

   ' PURPOSE:

   '   Based on the currently active control, the Windows

Help() API

   '   function is called to invoke Help on a predefined

ContextID for

   '   the control. If the ControlName is not represented, a

   '   message appears, indicating no Help topic is

available.

   '   If there is no active form available, the contents of

the

   '   Help file are invoked.

   '

   ' INPUT PARAMETERS:

   '   HelpFile: Path and filename of Help file to use

   '

   ' RETURN

   '   None

'***********************************************************

**

   Function Help (HelpFile As String)

      Dim ContextID As Long

      Dim Ret As Integer

      On Error GoTo HelpError

      ' Determine which control needs Help and set the

      ' .. appropriate ContextID for the control.

      Select Case Screen.ActiveControl.ControlName

   'NOTE: You must customize the Case statements that follow

   '      for your specific control names and the ContextID

to call

   '      for the control name.

         Case "Category ID"

           ContextID = 1

         Case "Category Name"

           ContextID = 1

         Case "Description"

           ContextID = 1

         Case "Product ID"

           ContextID = 2

         Case "Product Name"

           ContextID = 2

         Case "Unit Price"

           ContextID = 2

         Case "Picture"

           ContextID = 2

         Case Else

            MsgBox "No help for " &

Screen.ActiveControl.ControlName

            ContextID = -1

      End Select

      ' Call the Help file with the appropriate ContextID.

      If ContextID > -1 Then

         Ret = WinHelp(Screen.ActiveForm.hwnd, HelpFile, _

                       HELP_CONTEXT, ContextID)

      End If

      GoTo ByeHelp

   HelpError:

      ' Display the Contents window of the Help file.

      Ret = WinHelp(0, HelpFile, HELP_CONTENTS, 0&)

      Resume ByeHelp

   ByeHelp:

   End Function

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access version

1.0. This problem no longer occurs in Microsoft Access

version 1.1.


INF: ODBC Disk Contents (1/14/93, 3.5-Inch, MS Access 1.0)

 Article Number: Q100158

 CREATED: 16-JUN-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SUMMARY

The following lists the contents of the ODBC disk shipped with

Microsoft Access version 1.0 (release date 1/14/93, 3.5-inch, 1.44

MB).

The WBTRCALL.DLL file was removed from the original release of

Microsoft Access version 1.0. Because of this, the SETUP.EXE program

was changed. No Microsoft Access functionality was changed for this

release.

MORE INFORMATION

Disk Contents

-------------

DBNMP3   DLL      8241 10-22-92   3:06p

INSTCAT  SQL     93796 01-04-93  12:00a

MSCOMSTF DLL     74528 01-04-93  12:00a

MSDETSTF DLL     24544 01-04-93  12:00a

MSINSSTF DLL     65440 01-04-93  12:00a

MSSHLSTF DLL     14928 01-04-93  12:00a

MSUILSTF DLL      6144 01-04-93  12:00a

ODBC     DLL     44736 01-04-93  12:00a

ODBC     INF      1226 01-04-93  12:00a

ODBCADM  EXE      9136 01-04-93  12:00a

ODBCADM  HLP      4942 01-04-93  12:00a

ODBCINST DLL      6016 01-04-93  12:00a

SETUP    EXE     54464 01-04-93  12:00a

SETUPI   DLL     44032 01-04-93  12:00a

SQLSETUP DLL     11024 01-04-93  12:00a

SQLSRVR  DLL    135792 01-04-93  12:00a

VER      DLL      9008 10-22-92   3:06p

7        WMF      5846 01-04-93  12:00a

7E       WMF      5366 01-04-93  12:00a

WFWDRV   TXT      2134 01-04-93  12:00a

WFWDRV   EXE     23581 01-04-93  12:00a

WFWNET   DR_    165600 01-04-93  12:00a

LANMAN21     <DIR>     01-04-93  12:00a

       23 file(s)     810524 bytes


PRB: SCSI Drives Can Generate Corrupt Error Loading Database

 Article Number: Q100159

 CREATED: 16-JUN-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you are loading a Microsoft Access database file from a SCSI

drive, you receive the following error message:

   <filename> is corrupted or is not a database file. Attempt to

   repair?

Attempts to repair the database do not solve the problem.

CAUSE

There is probably nothing wrong with the database file. The actual

problem is that Microsoft Windows version 3.1 is having trouble

accessing the SCSI drive.

RESOLUTION

Add the following line to the CONFIG.SYS file on your drive. If you

already have a line in your CONFIG.SYS file that references

SMARTDRV.EXE, modify it to match the following line. After adding or

modifying this line, restart your computer.

   DEVICE=C:\WINDOWS\SMARTDRV.EXE /double_buffer

NOTE: If the computer is running MS-DOS 6.0 or a later version, use

C:\DOS instead of C:\WINDOWS to load the newest version of SMARTDRV.EXE.

MORE INFORMATION

Microsoft Windows 3.1 requires the double_buffer switch in the

SMARTDRV.EXE line to start in 386 enhanced mode on most SCSI drives.

On a computer where Windows is not located on the SCSI drive, it is

possible that Windows has started in 386 enhanced mode but that the

double buffer is not in use.

REFERENCES

==========

Microsoft Windows "User's Guide," version 3.1, Chapter 14

Additional reference words: 1.00 1.10 2.00 WinIss


PRB: System Error When Sharing Database on LAN Man/Workgroups

 Article Number: Q100160

 CREATED: 16-JUN-1993

 MODIFIED: 12-NOV-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If you try to save a Microsoft Access database larger than 2000 bytes

(approximately 2 MB) on a Microsoft LAN Manager server with a boot

drive that uses the file allocation table (FAT) format, the following

error message appears:

   System error... Network error on drive <x>

This error occurs only on Microsoft Windows for Workgroups

workstations if you attempt to open a database already in use by a

Microsoft LAN Manager workstation or another Windows for Workgroups

workstation.

CAUSE

The Microsoft LAN Manager server responds incorrectly to a request by

Windows for Workgroups to share the file. The server responds with a

message that is too long for Windows for Workgroups to process

correctly, resulting in an error from the NetBIOS.

RESOLUTION

The following are two ways to work around this problem:

 - Change the format of the Microsoft LAN Manager server boot drive

   from FAT to high-performance file system (HPFS), then place the

   Microsoft Access database you want to share on the boot drive.

   -or-

 - Move the database to a Windows for Workgroups server.

Additional reference words: 1.00 1.10 W4W FAT HPFS NetBIOS boot drive


INF: Contents: MS Access 1.0 Disks 4-6 (1/14/93, 3.5-Inch)

 Article Number: Q100161

 CREATED: 16-JUN-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SUMMARY

The following lists the contents of disks 4-6 shipped with Microsoft

Access version 1.0 (release date 1/14/93, 3.5-inch, 1.4 MB).

The WBTRCALL.DLL file was removed from the original release of version

1.0. Because of this, the SETUP.EXE program was changed. No Microsoft

Access functionality was changed for this release.

MORE INFORMATION

DISK4 Contents

--------------

4        WMF      8246 01-04-93  12:00a

4E       WMF      7766 01-04-93  12:00a

ANALYZER MD$     49740 01-04-93  12:00a

MSAJT100 DL$    338672 01-04-93  12:00a

NEWCUST  DB$      1212 01-04-93  12:00a

NWIND    MD$    555226 01-04-93  12:00a

PIM      MD$    109267 01-04-93  12:00a

SYSTEM   MD$     98863 01-04-93  12:00a

UTILITY  MD$     47055 01-04-93  12:00a

WINHELP  EX$    147911 10-09-92  10:02a

WINHELP  HL$     28161 10-09-92  10:02a

       11 file(s)    1392119 bytes

DISK5 Contents

--------------

5        WMF      4662 01-04-93  12:00a

5E       WMF      4150 01-04-93  12:00a

CBTLIB4  DL$     11179 01-04-93  12:00a

CUECARD  EX$     60269 01-04-93  12:00a

CUECARDS DL$      2047 01-04-93  12:00a

CUECARDS LE$    887544 01-04-93  12:00a

GRAPH    EX$    364877 10-09-92  10:02a

MSGRAPH  HL$    110291 10-09-92  10:02a

        8 file(s)    1445019 bytes

DISK6 Contents

--------------

6        WMF      5846 01-04-93  12:00a

6E       WMF      5366 01-04-93  12:00a

MSACCES2 HL$   1134560 01-04-93  12:00a

PSSKB    TX$      7951 01-04-93  12:00a

README_  TX$     10186 01-04-93  12:00a

ERRATA   TX$      9805 01-04-93  12:00a

WFWNET   DR$    151762 01-04-93  12:00a

        7 file(s)    1325476 bytes


PRB: Companion Disk Install Runs Out of Space & Requests Disk

 Article Number: Q100162

 CREATED: 16-JUN-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If you run out of hard disk space during the installation of the

Microsoft Access Companion Disk files, you receive the following error

message:

   Out of space. Insert new disk and press RETURN:

Of course you cannot insert a new hard disk. And, even if you are

installing under Windows and you back up or delete some files to

make additional disk space available, the error message continues; the

installation procedure does not recheck available space on the hard disk.

CAUSE

This error is caused by a limitation in the installation process

(COMPRESS.EXE) provided with the Companion Disk.

RESOLUTION

1. Press CTRL+C to quit the batch job.

2. Delete any files that may have already been copied to your hard

   disk (MSCMS.MDB, MSDIRECT.MDB, MSFORMS.MDB, and MSSWEETS.MDB).

3. Make sure that more than 3.8 megabytes (MB) of disk space is

   available.

4. Run the installation again.


INF: Expanded Size of the Companion Disk Database Files

 Article Number: Q100163

 CREATED: 16-JUN-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

This article lists the file sizes of the Microsoft Access Companion

Disk database files after installation.

The installation process will place these files in the C:\ACCESS

directory unless you specify otherwise. The files will have the

following sizes (before they are used):

   MSCMS    MDB   2490368 05-10-93   6:34p

   MSDIRECT MDB    557056 05-10-93   1:47p

   MSFORMS  MDB    294912 05-11-93   7:22a

   MSSWEETS MDB    458752 05-10-93   1:51p


INF: How to Call Functions Using a String Variable

 Article Number: Q100164

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how Access Basic or user-defined functions can

be called when the function name is stored in a string variable. This

method provides a functionality similar to that of pointers to

functions in other programming languages.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

Calling a function in Access Basic when the function name is stored in

a variable allows significant programming flexibility. This method is

described in the following procedure:

1. Store the function name and parameters in a string variable.

2. Use the Eval() function in Access Basic to evaluate the string. The

   process of evaluating the variable calls the function.

3. Open a new module or a previously created module and enter the

   following code:

   NOTE: In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

   '------------------------------------------------------------------

   'GLOBAL DECLARATIONS SECTION

   '------------------------------------------------------------------

   Option Explicit

   '------------------------------------------------------------------

   ' The CallMyArray() function creates an array of strings, then

   ' loops, using the Eval() function, to call each element of the array.

   '------------------------------------------------------------------

      Function CallMyArray ()

         Dim MyArray$()

          For i = 0 To 2

             ReDim Preserve MyArray$(i)

             MyArray$(i) = "MyFunc" & i & "(" & i & ")"

          Next i

          For i = 0 To 2

              x = Eval(MyArray(i))

          Next i

      End Function

   '------------------------------------------------------------------

   '    The first function called by CallMyArray().

   '------------------------------------------------------------------

      Function MyFunc0 (nParam)

         MsgBox "This is function: " & nParam

      End Function

   '------------------------------------------------------------------

   '    The second function called by CallMyArray().

   '------------------------------------------------------------------

      Function MyFunc1 (nParam)

         MsgBox "This is function: " & nParam

      End Function

   '------------------------------------------------------------------

   '    The third function called by CallMyArray().

   '------------------------------------------------------------------

      Function MyFunc2 (nParam)

         MsgBox "This is function: " & nParam

      End Function

REFERENCES

==========

Microsoft Access "Introduction to Programming," version 1.0, pages 7-14

Additional reference words: 1.00 1.10 2.00 string Eval


INF: How to Use the CTL3D.DLL in Your MS Access Database

 Article Number: Q100165

 CREATED: 16-JUN-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article describes how to achieve a three-dimensional look in your

Microsoft Access database by using the CTL3D.DLL dynamic link library

(DLL). Calling CTL3D.DLL APIs gives your dialog boxes a three-

dimensional appearance.

MORE INFORMATION

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications with the programming tools

provided with Microsoft Access. For more information on Access Basic,

please refer to the "Introduction to Programming" manual.

You can use CTL3D.DLL to add effects to the common dialog boxes and

message boxes in an Access Basic application. CTL3D.DLL does not

currently work for the controls on an Access Basic form. To use

CTL3D.DLL to enhance the common dialog boxes and message boxes in

Access Basic, follow the steps below.

NOTE: You may have some Windows API functions defined in an existing

Microsoft Access library; therefore, your declarations may be duplicates.

If you receive the duplicate procedure name error, remove or comment the

declare statement from your code.

   ' Note: Each command should be entered on one line.

   '---------------------------------------

   'GLOBAL DECLARATIONS SECTION

   '---------------------------------------

   Option Explicit

   Declare Function GetModuleHandle% Lib "Kernel" (ByVal lpModuleName$)

   Declare Function Ctl3dAutoSubClass% Lib "Ctl3D.DLL" (ByVal hInst%)

   Declare Function Ctl3dRegister% Lib "Ctl3D.DLL" (ByVal hInst%)

   Declare Function Ctl3dUnRegister% Lib "Ctl3D.DLL" (ByVal hInst%)

   '------------------------------------------------------------------

   ' The following function needs to be called when your application

   '    starts.

   ' This will register Access and subclass dialogs and message boxes

   '    with the 3D look.

   '------------------------------------------------------------------

   Function Init ()

      Dim Inst%

      Dim ret

      Inst% = GetModuleHandle("MSACCESS.EXE")

      ret = Ctl3dRegister(Inst%)

      ret = Ctl3dAutoSubClass(Inst%)

   End Function

   '------------------------------------------------------------------

   ' The following function needs to be called when your application

   '    quits.

   '------------------------------------------------------------------

   Function ShutDown ()

      Dim Inst%

      Dim ret

      Inst% = GetModuleHandle("MSACCESS.EXE")

      ret = Ctl3dUnRegister(Inst%)

   End Function

After running the Init() function from the Immediate window, an

AutoExec macro, or a RunCode macro action, you can see the three-

dimensional effects by running a macro or function that displays a

message box.

NOTE: Remember to run the ShutDown() function before quitting Microsoft

Access.

Additional reference words: 1.00 1.10 3-D


INF: Implementing Counter Values on Attached SQL Server Tables

 Article Number: Q100166

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you create a table in Microsoft Access and port it to SQL Server,

some tasks are difficult to implement because SQL Server does not

include a Counter data type. This article discusses how to maintain

the counter functionality of an attached SQL Server table.

MORE INFORMATION

With a multiuser system, you must take special precautions. Assume

that the Counter column in SQL Server is called ID and that ID is the

unique index for this table. In most cases, users try to simulate

counters with a SQL Server OnInsert trigger that computes the maximum

value and adds 1. However, Microsoft Access uses that index (bookmark)

to point to the record and is not aware that the trigger is changing

the index value. Thus, Microsoft Access loses track of that record

until the next time the table is queried.

Since SQL Server triggers do not work and SQL Server does not have a

unique Counter data type as does Microsoft Access, you must use an

Access Basic function to control the counter value, as in the

procedure below:

1. In a single-column, single-row Microsoft Access table, store a

   value that represents the next highest counter value.

   NOTE: You must store the table in Microsoft Access, since the

   OpenTable action does not work on an attached SQL Server table and,

   therefore, cannot open the table exclusively. For more information

   on the OpenTable action, refer to the Microsoft Access "Language

   Reference" manual.

2. In the data entry form, apply a function to the BeforeUpdate event

   so that the function completes the following tasks:

    - Open the table that contains the counter value

    - Grab the value for the current record

    - Add 1 to the value in the table

    - Close the table

   Each user must have exclusive access to the table to ensure that no

   duplicate values are recorded. You must do error checking when

   trying to open the table exclusively because another user may have

   the table open at the same time. If this occurs, the program loops

   and retries several times before alerting the first user.

3. Once the value has been retrieved, set the ID of the current record

   equal to that value and commit the record to the SQL Server

   database.

REFERENCES

==========

For more information about, and an example of, creating a unique custom

counter, query on the following words here in the Microsoft Knowledge Base:

   table and counter and custom and unique

Additional reference words: 1.00 1.10 2.00


INF: How to Pass Information to Microsoft Access Using DDE

 Article Number: Q100167

 CREATED: 16-JUN-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

You cannot poke data into a table through a dynamic data exchange (DDE)

channel in Microsoft Access. However, you can use a function with

parameters in a DDE channel to the SQL topic to pass information to an

Access Basic function. The data can then be processed by the function and

added to a table.

MORE INFORMATION

The following example explains how to add a new customer to the Customers

table in the sample database NWIND.MDB, using data from Microsoft Excel:

1. Create a table called None, with one field of any data type.

2. Open a module and create a function with the parameters that

   you want to pass:

      Function AddNewCust$ (CustomerID$, CompanyName$)

         Dim MyDB As Database, MyTable As Table

         Set MyDB = CurrentDB()

         Set MyTable = MyDB.OpenTable("Customers")  ' Open table.

         MyTable.AddNew                             ' Prepare new record.

         MyTable("Customer ID") = CustomerID$       ' Set record key.

         MyTable("Company Name") = CompanyName$     ' Set company name.

         MyTable.Update                             ' Save changes.

         MyTable.Close                              ' Close table.

      End Function

3. In the DDE client application, initiate a DDE link using MSACCESS as the

   application and use a SQL Select query as the topic. The topic will be

   of the form:

      DatabaseName;SQL Select FunctionName(args) From None;

   where None is the empty table and FunctionName(args) is the call to the

   Access Basic function that processes the arguments, args, passed to it.

   For example, the following Microsoft Excel macro insert a new

   record into the Customer table:

   NOTE: In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

      AddNewCustomer

      chan=INITIATE("MSACCESS","NWIND.MDB;SQL SELECT_

           AddNewCust$(""JOHNJ"",""John's Place"") FROM None; ")

      =TERMINATE(chan)

      =RETURN()

   The following is the equivalent Microsoft Word for Windows Word Basic

   macro:

      Sub MAIN

      qt$ = Chr$(34)

      Funct$ = "AddNewCust$(" + qt$ + "JOHNJ" + qt$ + "," + qt$ + _

      "John's Place" + qt$ + ")"

      Chan = DDEInitiate("MSACCESS", "NWIND;SQL SELECT " + Funct$ + _

         " FROM None;")

      DDETerminate Chan

      End Sub

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 118-124

README.TXT in Microsoft Access version 1.0

Additional reference words: 1.00 1.10 1.1 dde excel macro ddepoke


PRA: GP Fault When Using Erase Statement on String Array

 Article Number: Q100168

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you use an Erase statement on a string array, you receive a

general protection (GP) fault. The following error message appears:

   An error has occurred in your application. If you choose Ignore,

   you should save your work in a new file. If you choose Close, your

   application will terminate.

CAUSE

You are trying to use the Erase statement on a string array contained

in a user-defined data type.

RESOLUTION

Use a loop structure to initialize the string array in the data type.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

The following code generates the error message described above:

   Type Foosball

      X(1) As String

   End Type

   Sub Main ()

      Dim Arrays As Foosball

      Erase Arrays.X

   End Sub

To work around this problem, use the following loop structure instead

of the Erase statement:

   Sub Main ()

      Dim Arrays As Foosball

      For i = 1 To UBound(Arrays.X)

         Arrays.X(i) = ""

      Next i

   End Sub

Additional reference words: 1.00 1.10 loop construct Erase structure


INF: How NWIND.MDB Employee Field Photographs Were Created

 Article Number: Q100169

 CREATED: 16-JUN-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

Below is a synopsis of how the photos for the Photo field of

the

Employees table in the Northwind Traders sample database

NWIND.MDB

were prepared and processed.

1. Photographs of the subjects were taken with a camera and

developed

   as prints.

2. The prints were scanned on a color scanner connected to

an

   Apple Macintosh.

3. The resulting files from the Macintosh (in .TIFF file

format) were

   transferred to an IBM PC/AT compatible computer (to .BMP

file format).

4. The images were converted from 256-color to 16-color

(dithered) so

   that pictures would display correctly in 16-color mode,

and also

   because 16-color images display faster than 256-color

images.

5. The images were then added as embedded objects in the

Employees

   table of the Northwind Traders database, following the

instructions

   given in the Microsoft Access "User's Guide," Chapter 13,

"Using

   Pictures, Graphs, and Other Objects," pages 314-339.

MORE INFORMATION

If you plan to use this process yourself, steps can be

eliminated if

you use a scanner directly connected to an IBM PC/AT

compatible

computer since the image transfer from the Macintosh (step

3) would not

be necessary and step 4 can often be handled by the scanner

software.

Software helpful for processing graphic images:

Apple Macintosh

---------------

Adobe Photoshop

IBM PC/AT Compatibles

---------------------

PaintShop (Shareware--can be used for image file

conversions.)

WinGif (Shareware--can be used for image file conversions.)

Microsoft Paintbrush (Great for touching up stray pixels.)

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 13,

"Using Pictures,

Graphs, and Other Objects," pages 314-339 (in version 1.1,

see pages 318-

343)

Additional reference words: 1.00 1.10 ole object


INF: Microsoft Access Companion Disk Contents (3.5 in. 1.44MB)

 Article Number: Q100170

 CREATED: 16-JUN-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

The following lists the directory contents of the Microsoft Access

Companion Disk that was sent to registered users of Microsoft

Access version 1.0 when version 1.1 was released:

COMPRESS   EXE   25563    03-02-90   1:13p

INSTALL    BAT   4677     05-11-93   7:48a

MSCMS      MD$   622969   05-10-93   6:34p

MSDIRECT   MD$   141957   05-10-93   1:47p

MSFORMS    MD$   108739   05-11-93   7:22a

MSSWEETS   MD$   186343   05-10-93   1:51p

YNC        EXE   13023    03-15-91   2:42p

        7 file(s)    1103271 bytes

Note that the contents of this disk can be obtained from CompuServe in

the MSACCESS forum, Library 14, file COMPAN.ZIP. Although this disk

was released only on 3.5-inch, 1.44 MB disks, it can be downloaded and

fit onto a 5.25-inch, 1.2 MB disk.


INF: Installation Process for the Companion Disk

 Article Number: Q100171

 CREATED: 16-JUN-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article describes the installation process for the Microsoft Access

Companion Disk.

MORE INFORMATION

The following lists a sample installation process from drive B, using the

default response:

B:\>install

**********************************************************************

*                                                                    *

*                   Microsoft Access Companion Disk                  *

*               Copyright (c) Microsoft Corporation 1993             *

*                      May 10, 1993 - Edition 1.0                    *

*                                                                    *

**********************************************************************

*                                                                    *

*  This batch program installs the companion disk to your C:\ACCESS  *

*  directory by default. If you wish to override this default        *

*  installation path, enter a new installation path on the command   *

*  line as shown below.                                              *

*                                                                    *

*  REQUIREMENTS:  3.8 MB of free hard disk space                     *

*                                                                    *

*  USAGE:  INSTALL [drive]:\[path]                                   *

*                                                                    *

*     Where [drive] is the drive letter and [path] is the directory  *

*     into which the files will be installed.                        *

*                                                                    *

*  Example:  INSTALL C:\ACCESS                                       *

*                                                                    *

**********************************************************************

.

Install into default directory (Yes/No/Cancel)? [ync]y

.

creating c:\access

.

Decompressing Sample Applications...

.

msforms.mdb (file 1 of 4)

mssweets.mdb (file 2 of 4)

mscms.mdb (file 3 of 4)

msdirect.mdb (file 4 of 4)

.

**********************************************************************

*                                                                    *

*                       INSTALLATION COMPLETE                        *

*                                                                    *

* Please load Microsoft Access to view your sample database files.   *

*                                                                    *

*         MSFORMS.MDB .... sample data entry forms                   *

*         MSSWEETS.MDB ... sample database for small businesses      *

*         MSCMS.MDB ...... sample Contact Management application     *

*         MSDIRECT.MDB ... directory of Access products & services   *

*                                                                    *

* The sample databases contained on this 'companion disk' have been  *

* provided purely as an aid to help users learn more about Microsoft *

* Access and are therefore provided 'as is'. Microsoft is unable to  *

* provide support for these samples due to the nature of their design.

*                                                                    *

**********************************************************************

B:\>

NOTE: Due to line-length restrictions in the Knowledge Base, some

spaces were removed from the ends of lines in the samples above. An

asterisk was also removed from the third from the last line for the

same reason.


PRB: GPF with Diamond Viper VESA Local Bus Video Driver V1.01

 Article Number: Q100172

 CREATED: 16-JUN-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you are using version 1.01 of the Diamond Viper VESA local bus

video driver for Microsoft Windows version 3.1, you receive a general

protection (GP) fault when you attempt to run Microsoft Access. The GP

fault occurs immediately after you try to open a database.

CAUSE

This problem is caused by a fault in version 1.01 of the Diamond Viper

VESA local bus video driver for Windows 3.1.

RESOLUTION

According to Diamond Computer Systems, version 1.02 of the driver

corrects this problem. To obtain this driver, call Diamond Computer

Systems Technical Support or download the VPR102.EXE file by modem

from the Diamond Computer Systems bulletin board service (BBS) at

(408) 730-1100.

The Diamond Viper VESA local bus video driver is manufactured by

Diamond Computer Systems, Inc., a vendor independent of Microsoft; we

make no warranty, implied or otherwise, regarding this product's

performance or reliability.

Additional reference words: 1.00 1.10 2.00 WinIss video driver GP fault


PRB: "Unexpected Error from External Database Driver [20]"

 Article Number: Q100173

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.1 and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you are using the network loadable module (NLM) version of

Btrieve and try to import, export, or attach a Btrieve table you

receive the error message "Unexpected error from external database

driver [20]."

CAUSE

Btrieve returns this error message if you try to access Btrieve data

with Microsoft Access before loading the BREQUEST.EXE program. The

Xtrieve manual lists this error with the following description:

   20  Record Manager inactive.

       You made a request before starting the Record Manager.

       Restart the Record Manager.

RESOLUTION

You must start the BREQUEST.EXE program before starting Microsoft

Windows. You may want to create a batch file to execute the

BREQUEST.EXE program before starting Windows.

MORE INFORMATION

Btrieve is manufactured by Novell, a vendor independent of Microsoft;

we make no warranty, implied or otherwise, regarding this product's

performance or reliability.

REFERENCES

==========

For a complete list of Xtrieve error messages, refer to the Novell

Xtrieve manual, Appendix A.

Additional reference words: 1.10 2.00 Brequest


PRB: Cannot Change the RecordSource of a Form at Run Time

 Article Number: Q100174

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You cannot change a form's RecordSource property at run time.

RESOLUTION

Although you cannot change the actual RecordSource property of a form,

you can use the Apply Filter macro action to simulate the effect.

The following steps demonstrate the method to simulate changing the

RecordSource:

1. Open the sample database NWIND.MDB. Make a copy of the Employees

   table and save it as Employees2. Delete five records from the

   Employees2 table.

2. Create a macro with the following action and save it as

   Employees2 Macro:

      Employees2 Macro Action

      ------------------------

         ApplyFilter

            Filter Name: Select * from Employees2;

            Where Condition:

3. Open the Employees form in Design view. Add a command button to the

   Employees form and set the OnPush property to Employees2 Macro.

4. Open the form in Form view and go to the last record of the form.

   Note how many records are in the Employees field. Next, choose the

   command button and go to the last record of the form. Note that

   there are now five fewer records in the form.

NOTE: If you apply this method to your own tables and the tables do

not have the same fields, you must set the Visible property of the

invalid controls to No to prevent #Name? errors.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 375-382

Additional reference words: 1.00 1.10 filter query requery change


PRA: GP Fault When Allocating Huge Arrays

 Article Number: Q100175

 CREATED: 16-JUN-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you try to allocate a huge array, you may receive a general

protection (GP) fault. The following error message appears:

   An error has occurred in your application. If you choose

   Ignore, you should save your work in a new file. If you choose

   Close, your application will terminate.

CAUSE

If you have allocated an array element that includes a string or

variant data type and the size of the array exceeds 64K, you may

receive the error message described above, if the following criteria

are met:

 - The array must be huge and span two or more data segments.

 - Each array element must contain at least one dynamic string or

   variant.

 - The number and size of the array elements must cause the last

   segment of data to be exactly the same size as the first segment of

   data.

RESOLUTION

Declare the array so that the last data segment contains a different

number of elements from the first data segment.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Access Basic has the ability to define huge arrays, larger than the

normal 64K data segment. Any element or index of a huge array may not

extend across the 64K-segment boundary. If all elements of the array

cannot be allocated within the 64K segment, only the elements of the

array that fit evenly in the segment are allocated. Microsoft Access

then allocates another 64K segment to the array and continues to fill

the new segment with the remaining elements.

If the size of the data type defined in the array is a power of 2, the

64K segment is completely full. If the size is not a power of 2, the

segment contains wasted space, since Microsoft Access cannot place a

portion of one element in one segment and the rest of that element in

the next segment.

Example

-------

   Type Foosball

      A(3000) As double

      d As String

   End Type

The size of this structure is 24,012 bytes (3000 * 8 bytes/double +

12 bytes/string). If you declare this array with three elements, you

have two data segments, as follows:

   Data Segment  #1      Data Segment  #2

   -----------------     -----------------

   Free space 17512      Free space 41524

   Array(1)   24012      Array(3)   24012

   Array(2)   24012

In Microsoft Access, you may receive a GP fault if the number of

elements in the first segment is equal to the number of elements in

the last segment and the data structure used to define the array is

made up of either a string or variant data type. If you define the

data structure above with six elements, your memory map looks like the

following:

   Data Segment  #1      Data Segment  #2        Data Segment  #3

   -----------------     -----------------       -----------------

   Free space 17512      Free space 17512        Free space 17512

   Array(1)   24012      Array(3)   24012        Array(5)   24012

   Array(2)   24012      Array(4)   24012        Array(6)   24012

The actual dimension statement looks like the following:

   Function Sample()

      Redim Array(6) As Foosball

   End Function

To work around this problem, declare the array so that the last data

segment does not contain the same number of elements as the first data

segment. In addition to the example above, you may choose to define

the array with seven elements instead of six. This causes Microsoft

Access to allocate four data segments, in which the first data segment

contains two elements of the array and the last data segment contains

only one element.

This example is very easy to duplicate with large data structures, but

is more difficult to duplicate with smaller data structures. With an

element size of 24,012 bytes, 4, 6, or 8 elements may cause a problem.

With a data size of 1K, numbers of elements that duplicate this

problem are 128, 192, 256, and so forth.

Additional reference words: 1.00 1.10 GP fault GPF array


INF: Upper Limit for QueryTimeout and LoginTimeout Parameters

 Article Number: Q100176

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes the maximum limit allowed for the QueryTimeout

and LoginTimeout parameters.

MORE INFORMATION

As the README.TXT file for Microsoft Access 1.1 states, the two

settings in the [odbc] section of the MSACCESS.INI file are as

follows:

Entry               Value   Effect

-------------------------------------------------------------------

QueryTimeout         S      Wait S seconds for queries sent to

                            ODBC, then stop trying to process

                            the query results (for asynchronous

                            queries only). Default: 60 seconds.

LoginTimeout         S      Wait S seconds for ODBC login response,

                            and then stop trying to connect to a

                            server. Default: 20 seconds.

The README.TXT file does not state the limits for these parameters.

Since the values for QueryTimeout and LoginTimeout are unsigned 4-byte

values (long integers), the maximum value is +/- 2,147,483,648. If the

value is set to zero, the timeout is disabled and the query or login

never times out.

Additional reference words: 1.00 1.10 2.00


INF: Importing, Exporting, and Attaching FoxPro 2.0, 2.5 Data

 Article Number: Q100177

 CREATED: 16-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.1 and 2.0

---------------------------------------------------------------------

SUMMARY

In Microsoft Access versions 1.1 and 2.0, you can import from, export to,

and attach data in FoxPro versions 2.0 and 2.5.

MORE INFORMATION

If you select either Import or Attach Table from the File menu, you

can choose FoxPro 2.0 or FoxPro 2.5 from the Data Source list box.

When you attach a FoxPro file, you can also associate the appropriate

FoxPro index (.IDX or .CDX file). The procedure to import, export, and

attach files is the same for FoxPro files as it is for dBASE and Paradox

files.

dBASE and Paradox are manufactured by Borland International, Inc., a

vendor independent of Microsoft; we make no warranty, implied or otherwise,

regarding these products' performance or reliability.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, chapter 4, "Importing,

Exporting, and Attaching," pages 60-65

Additional reference words: 1.10 2.00 Import/Export fox idx cdx


PRB: Cannot Use CTRL+SHIFT+HOME to Move to Main Form

 Article Number: Q100462

 CREATED: 22-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You will not be able to use the CTRL+SHIFT+HOME key combination to

move from a subform to the first record on the main form if you have

moved to any control on the subform with a mouse click.

CAUSE

This behavior is by design. When you select a control on a subform

with a mouse click, you change into edit mode. Edit mode has a

different keyboard definition than when you are navigating records.

Note that using TAB to move to a control on a subform does not change

you into edit mode.

RESOLUTION

Choose the record selector button in the subform to move to the next

record. This will change you out of edit mode, and you will be able to

use CTRL+SHIFT+HOME to move to the first field on the main form.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Open the Categories form. The Category ID field is selected.

3. Press TAB four times, thereby selecting the Product ID field in

   the subform.

4. Press CTRL+SHIFT+HOME to return to the first field on the main

   form, the Category ID field.

5. Using the mouse, click the Product ID field on the subform.

6. Press the CTRL+SHIFT+HOME keys. Note that the Category ID field on

   the main form was not selected.

7. Use the record selector to select one of the records in the

   subform.

8. Press CTRL+SHIFT+HOME. You will return to the first field on the

   main form.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 14

Additional reference words: 1.00 1.10 2.00 mainform


INF: How to Disable the Close Command on the Control Menu

 Article Number: Q100463

 CREATED: 22-JUN-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

To prevent a user from manually closing a form, you have two options:

1. Use the CancelEvent macro action with the OnClose event on a form.

2. Disable the Close command on the Control menu, using a function on the

   OnOpen event of the form and trapping the CTRL+F4 keystroke with an

   AutoKeys macro.

The second approach, which is described in this article, requires the

use of Windows application programming interface (API) calls, but is

more effective. It prevents the user from choosing the Close command

and does not require special handling of the OnClose event when the

Close command is invoked.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

MORE INFORMATION

To disable the Close command on the Control menu, create a module in

your database containing the DisableCloseMenu() function, then call

the function from the OnOpen event in your form:

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. Create a new form called Form1.

3. Place a command button on the form.

4. Set the properties for the form and button as follows:

   Version 1.x:

      Form:

         OnOpen: =DisableCloseMenu(Form)

      Command Button:

         ControlName: Button0

         Caption: Close

         OnPush: TestClose

   Version 2.0:

      Form:

         OnOpen: =DisableCloseMenu([Form])

      Command Button:

         Name: Button0

         Caption: Close

         OnClick: TestClose

5. Save and close the form.

6. Create the following macro and call it TestClose. This macro, along

   with the command button on the form, enables the user to close the

   form.

      Action: Close

   Leave the action arguments blank. This will close whatever form

   the macro is run from.

7. Create the following macro and call it AutoKeys. This macro will trap

   the CTRL+F4 keystroke and prevent the form from closing. Since the

   AutoKeys macro is global to all forms in the database, you can use the

   macro's Conditional column to prevent only Form1 from closing.

   The AutoKeys macro will load when the database is first opened. You may

   need to close and reopen the database after completing all the steps in

   this article for the AutoKeys macro to take affect.

   Version 1.x:

      Macro Name: ^{F4}

      Condition: Not Screen.ActiveForm.FormName = "Form1"

      Action: Close

   Version 2.0:

      Macro Name: ^{F4}

      Condition: Not [Screen].[ActiveForm].[Name] = "Form1"

      Action: Close

   Leave the action arguments blank. This will close whatever form

   the macro is run from.

   NOTE: You can prevent all the forms in the database from being closed by

   the CTRL+F4 key combination by leaving the Condition and Action in the

   macro above blank.

8. Create a new module called Module1. Enter the following code:

'*****************************************************************

' Declarations section of the module

'*****************************************************************

' NOTE: In the following sample code, an underscore (_) is used as a

' line-continuation character. Remove the underscore when re-creating

' this code in Access Basic.

' NOTE: You may have some Windows API functions defined in an existing

' Microsoft Access library; therefore, your declarations may be duplicates.

' If you receive the duplicate procedure name error message, remove or

' comment the declarations statement from your code.

Option Explicit

Const SC_CLOSE = &HF060

Const MF_GRAYED = 1

Declare Function GetSystemMenu% Lib "user" (ByVal hWnd%, ByVal flag%)

Declare Function EnableMenuItem% Lib "user" (ByVal hMenu%,ByVal nItem%,_

                                            ByVal nAction%)

'===========================================================

'The following function retrieves the handle to the System

'menu and dims the Close option.

'===========================================================

Function DisableCloseMenu (frm As Form)

   Dim hSysMenu As Integer

   Dim D As Integer

   hSysMenu = GetSystemMenu(frm.hWnd, 0)

   d = EnableMenuItem(hSysMenu, SC_CLOSE, MF_GRAYED)

End Function

   NOTE: When you are determining the position of a menu command,

   separator bars count as commands. For example, to get to the Import

   command on the File menu in the Database window, use the

   arguments 0 (for the File menu) and 7 (for the Import command).

   Positions 3 and 6 correspond to the separator bars on the File

   menu.

9. Give Form1 the focus. Note that double-clicking the Control-menu box

   does not close the form and that the Close command on the form's Control

   menu is unavailable (dimmed). Choose the Close button to close the form.

Version 2.0 forms have a ControlBox property that can be set to either

Yes/True (to show the Control menu) or No/False (to hide the Control menu).

If you hide the menu you will not need to use the DisableCloseMenu()

function in the OnOpen event of the form.  However, the user could still

use the CTRL+F4 keystroke, so the AutoKeys macro would still be required.

REFERENCES

==========

For more information about disabling menu items, query on the following

words here in the Microsoft Knowledge Base:

   menu and gray and getmenu

Additional reference words: 1.00 1.10 2.00 UI forms SDK menu close gray


PRA: Ordered Query on Attached Paradox Table

 Article Number: Q100464

 CREATED: 22-JUN-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

An ordered query (a query in which one or more fields is

sorted using

the SQL ORDER BY clause) on an attached Paradox table with

secondary

indexes does not consistently select all the records that

meet the

designated criteria.

RESOLUTION

In Microsoft Access version 1.0, run the query as a make-

table query,

without specifying a sort on secondary indexed fields. Then,

create and

run an ordered select query on the new table.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access version

1.0. This problem no longer occurs in Microsoft Access

version 1.1.

MORE INFORMATION

This problem occurs only when the query is ordered by a

secondary

index field.

A Paradox secondary index is a field, other than the primary

key,

that is indexed. This is analogous to Microsoft Access

tables that are

indexed on fields other than the primary key.

How to check for secondary indexes

----------------------------------

1. Attach a Paradox table in Microsoft Access.

2. Select the attached table in the Database window and

choose

   Design. An error message will appear, stating that some

properties

   cannot be modified.

3. Choose Yes to open the table.

4. Select each row in the table and note its indexed

property. The

   indexed property for secondary indexes is Yes.

How to verify that your query results are consistent

----------------------------------------------------

1. Check for secondary indexes. If you find any secondary

indexes,

   complete the following steps.

2. Open the query in Design view.

3. Remove all sort specifications based on secondary

indexes.

4. Run the query and note the number of rows returned.

5. Enter the sort specifications for the secondary index

fields.

6. Rerun the query.

If the number of rows returned from steps 4 and 6 are not

the same,

the query is not returning correct results.

Paradox is manufactured by Borland International, Inc., a

vendor

independent of Microsoft; we make no warranty, implied or

otherwise,

regarding this product's performance or reliability.


INF: How to Prevent Users from Adding New Records to a Form

 Article Number: Q100465

 CREATED: 22-JUN-1993

 MODIFIED: 14-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

The DefaultEditing form property, when set to AllowEdits, allows users to

both modify existing records and add new records. Microsoft Access has no

built-in mechanism to prevent users from adding new records.

MORE INFORMATION

The following information describes how to use an Access Basic

function to prevent users from entering new employees in the Employees

form in the sample database NWIND.MDB:

1. Add the following Access Basic function to a new or existing

   module:

      Function PreventNew ()

         Dim X

         On Error Resume Next

         X = Screen.ActiveForm.Bookmark

         If Err <> 3102 Then DoCmd GoToRecord , , A_LAST

      End Function

   NOTE: There are two commas between GoToRecord and A_LAST above.

2. Change the OnCurrent property of the Employees form to read as

   follows:

      Form: Employees

      ---------------

         OnCurrent:  =PreventNew()

   RESULT: The user is placed in the last record of the Employees form

   when attempting to access or navigate to the new record.

How PreventNew() Works

----------------------

Whenever the user navigates to a different record, the OnCurrent

property executes the PreventNew() function. This function attempts to

reference the bookmark property associated with the current record.

All records are assigned a string, called a bookmark, that uniquely

identifies each record.

However, a new record that has not yet been saved has no bookmark

associated with it. Any attempt to reference the bookmark of a new


INF: Microsoft Access 1.0 (1/14/93) Disks 5-7 Contents (1.2MB)

 Article Number: Q100466

 CREATED: 22-JUN-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SUMMARY

The following lists the directory contents of disks 5-7 shipped with

Microsoft Access version 1.0 with a release date of 1/14/93 (5.25

inch, 1.2 MB)

Note that the WBTRCALL.DLL file was removed from this release of

Microsoft Access. Due to this removal, the SETUP.EXE program was

changed. The functionality of Microsoft Access was not changed in any

way.

MORE INFORMATION

Contents of Disk 5

---------------------------------------

5        WMF      4662 01-04-93  12:00a

5E       WMF      4150 01-04-93  12:00a

CBTLIB4  DL$     11179 01-04-93  12:00a

CUECARD  EX$     60269 01-04-93  12:00a

CUECARDS DL$      2047 01-04-93  12:00a

CUECARDS LE$    887544 01-04-93  12:00a

WFWNET   DR$    151762 01-04-93  12:00a

       7 file(s)    1121613 bytes

Contents of Disk 6

---------------------------------------

6        WMF      5846 01-04-93  12:00a

6E       WMF      5366 01-04-93  12:00a

BTRVISAM DL$     57918 01-04-93  12:00a

DBSISAM  DL$    135919 01-04-93  12:00a

GRAPH    EX$    364877 10-09-92  10:02a

MASJT100 DL$    338672-01-04-93..12:00a

MSAJU100 DL$     38945 01-04-93  12:00a

MSGRAPH  HL$    110291 10-09-92  10:02a

PDXISAM  DL$    106830 01-04-93  12:00a

REGEDIT  EX$     18176 10-09-92  10:02a

        10 file(s)    1178552 bytes

Contents of Disk 7

---------------------------------------

7        WMF      5846 01-04-93  12:00a

7E       WMF      5366 01-04-93  12:00a

MSACCES2 HL$   1134560 01-04-93  12:00a

PSSKB    TX$      7951 01-04-93  12:00a

README_  TX$     10186 01-04-93  12:00a

ERRATA   TX$      9805 01-04-93  12:00a

        6 file(s)    1173714 bytes


INF: How to Determine Version of INSTCAT.SQL File on Server

 Article Number: Q100467

 CREATED: 22-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Using the SQL Server ODBC driver with Microsoft Access requires that

you run the INSTCAT.SQL file on the ODBC installation disks. This

article describes the SQL stored procedure that you can use to query

for the version number of the INSTCAT.SQL file that was run against

the SQL Server computer.

MORE INFORMATION

The following syntax can be executed in a pass-through query in Microsoft

Access version 2.0, as well as in the Query window of SQL Server

Administration Facility (SAF) for MS-DOS, OS/2, Microsoft Windows or any

other operating system in which you can execute a stored procedure:

   sp_server_info 500

The attribute_value field of the returned row contains the version

number. If an empty recordset is returned, it is likely that the

INSTCAT.SQL file was not run on the server. The result will resemble

the following:

   attribute_id   attribute_name      attribute_value

   --------------------------------------------------

   500            SYS_SPROC_VERSION   01.00.2101

OS/2 is manufactured by International Business Machines Corporation, a

vendor independent of Microsoft; we make no warranty, implied or

otherwise, regarding this product's performance or reliability.

Additional reference words: 1.00 1.10 2.00


PRB: Errors Installing Companion Disk to Nested Subdirectories

 Article Number: Q100468

 CREATED: 22-JUN-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you try to install the Microsoft Access Companion Disk files into

a nested subdirectory that does not exist you receive the error message

   Unable to create directory

followed by the error messages:

   Can't open output file: c:\<xxx>\<yyy>\<zzz>\msforms.mdb

   Can't open output file: c:\<xxx>\<yyy>\<zzz>\mssweets.mdb

   Can't open output file: c:\<xxx>\<yyy>\<zzz>\mscms.mdb

   Can't open output file: c:\<xxx>\<yyy>\<zzz>\msdirect.mdb

In this example, either the <xxx> directory or the <yyy> subdirectory

did not exist prior to starting the installation process.

CAUSE

This is a limitation of the part of the installation process that

decompresses the files from the floppy disk to your hard disk.

RESOLUTION

Create the directories before starting the installation process, or

make sure to specify a directory that is only one level below any

existing directory.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

With the Microsoft Access Companion Disk in drive A, type the following

at the MS-DOS prompt. Make sure that directory <xxx> does not exist

before beginning this process:

   A:\install c:\<xxx>\<yyy>\<zzz>

You will get the following responses:

   .

   creating c:\<xxx>\<yyy>\<zzz>

   .

   Unable to create directory

   Decompressing Sample Applications...

   .

   msforms.mdb (file 1 of 4)

   Can't open output file: c:\<xxx>\<yyy>\<zzz>\msforms.mdb

   mssweets.mdb (file 2 of 4)

   Can't open output file: c:\<xxx>\<yyy>\<zzz>\mssweets.mdb

   mscms.mdb (file 3 of 4)

   Can't open output file: c:\<xxx>\<yyy>\<zzz>\mscms.mdb

   msdirect.mdb (file 4 of 4)

   Can't open output file: c:\<xxx>\<yyy>\<zzz>\msdirect.mdb


INF: Validation Rule to Require Uppercase in a Field

 Article Number: Q100469

 CREATED: 22-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

Microsoft Access does not have a setting to force entries in a field

or control to be in uppercase letters. However, a validation rule can

be used to ensure that only uppercase letters are used.

The following sample validation rule requires that entries in a field

or control called Last Name be entered in uppercase letters:

   StrComp(UCase([Last Name]),[Last Name],0) = 0

REFERENCES

==========

Microsoft Access "User's Guide," Appendix C

Microsoft Access "Language Reference," page 456


INF: ODBC Disk Contents (1/14/93, 5.25-Inch, MS Access 1.0)

 Article Number: Q100470

 CREATED: 22-JUN-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SUMMARY

The following lists the contents of the ODBC disk shipped with

Microsoft Access version 1.0 (release date 1/14/93, 5.25-inch, 1.2

MB).

The WBTRCALL.DLL file was removed from the original release of

Microsoft Access version 1.0. Because of this, the SETUP.EXE program

was changed. No Microsoft Access functionality was changed for this

release.

MORE INFORMATION

DISK1 Contents

--------------

DBNMP3   DLL      8241 10-22-92   3:06p

INSTCAT  SQL     93796 01-04-93  12:00a

MSCOMSTF DLL     74528 01-04-93  12:00a

MSDETSTF DLL     24544 01-04-93  12:00a

MSINSSTF DLL     65440 01-04-93  12:00a

MSSHLSTF DLL     14928 01-04-93  12:00a

MSUILSTF DLL      6144 01-04-93  12:00a

ODBC     DLL     44736 01-04-93  12:00a

ODBC     INF      1226 01-04-93  12:00a

ODBCADM  EXE      9136 01-04-93  12:00a

ODBCADM  HLP      4942 01-04-93  12:00a

ODBCINST DLL      6016 01-04-93  12:00a

SETUP    EXE     54464 01-04-93  12:00a

SETUPI   DLL     44032 01-04-93  12:00a

SQLSETUP DLL     11024 01-04-93  12:00a

SQLSRVR  DLL    135792 01-04-93  12:00a

VER      DLL      9008 10-22-92   3:06p

8        WMF      5846 01-04-93  12:00a

8E       WMF      5366 01-04-93  12:00a

WFWDRV   TXT      2134 01-04-93  12:00a

WFWDRV   EXE     23581 01-04-93  12:00a

WFWNET   DR_    165600 01-04-93  12:00a

LANMAN21     <DIR>     01-04-93  12:00a

       23 file(s)     810524 bytes

                      68096 bytes free

DISK2 Contents

--------------

NETWKSTA 500           01-04-93  12:00a

NETWKSTA 400           01-04-93  12:00a

NETWKSTA 330           01-04-93  12:00a


PRB: Order Entry Ship To Address Contains City Information

 Article Number: Q100471

 CREATED: 22-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

In the sample database ORDENTRY.MDB you can print a sample invoice

form. When you print the form, the Ship To information will contain

the city name twice, and will not print the address line.

CAUSE

There is an error in the ShipToInfo procedure in the Order Routines

module. The error will occur only if you enter a Ship To address.

RESOLUTION

Correct the error in the ShipToInfo procedure as follows:

1. From the File menu, choose Open Database to open the ORDENTRY.MDB

   database. Bypass the autoexec macro by pressing SHIFT when you

   double-click the database name, or when you choose OK. (If you do

   not press SHIFT when opening the database, the autoexec macro will

   run and you will not be able to modify the procedure.)

2. In the Database window, choose the Module button. Select the Order

   Routines module and choose Design.

3. Press F2 and the View Procedures dialog box will appear. In the

   bottom half of this box is the Procedures box. In the Procedures

   box, select the ShipToInfo procedure, and choose OK.

4. Find the line that starts with:

      stAddress$ = ConvertNulls(DLookup("ShipCity"

   Change this line so that the beginning reads:

      stAddress$ = ConvertNulls(DLookup("ShipAddress"

   Leave the remainder of the line intact.

5. Save the changes and close the database.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the ORDENTRY.MDB database.

2. From the View menu, choose Orders.

2. Select Add Orders and choose Select.

3. Select any employee from the Employee ID box and choose OK.

4. Select any customer from the Bill To box.

5. In the Ship To box enter your name, address, city, state and

   ZIP code.

6. Select the printer icon in the bottom-left corner of the form or

   choose Print from the File menu.

Additional reference words: 1.00 1.10


INF: Contents: MS Access 1.0 Disks 1-4 (1/14/93, 3.5-Inch)

 Article Number: Q100472

 CREATED: 22-JUN-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SUMMARY

This article lists the contents of disks 1-4 shipped with Microsoft

Access version 1.0 (release date 1/14/93, 5.25-inch, 1.2 MB).

The WBTRCALL.DLL file was removed from the original release of version

1.0. Because of this, the SETUP.EXE program was changed. No Microsoft

Access functionality was changed for this release.

MORE INFORMATION

DISK1 Contents

--------------

1        WMF      4470 01-04-93  12:00a

1E       WMF      4022 01-04-93  12:00a

COMMDLG  DL$     46406 10-09-92  10:02a

COMMDLG  DL_     89248 01-04-93  12:00a

CTL3D    DL$      7524 08-16-92   7:35p

DDEML    DL$     20305 03-10-92   3:10a

DETCMD   DL_     24128 01-04-93  12:00a

MSACCESS IN$       519 01-04-93  12:00a

MSACCESS RE$       552 01-04-93  12:00a

MSAIN100 DL$     71625 01-04-93  12:00a

OLECLI   DL$     41083 10-09-92  10:02a

OLESVR   DL$     13129 10-09-92  10:02a

ORDENTRY TX$      2281 01-04-93  12:00a

ORDENTRY HL$     14224 01-04-93  12:00a

ORDENTRY MD$    200396 01-04-93  12:00a

PIM      HL$      8119 01-04-93  12:00a

SETUP    EXE     21472 01-04-93  12:00a

SETUP    INI       149 01-04-93  12:00a

SHARE    EX$      8112 10-09-92  10:02a

SHELL    DL$     23296 10-09-92  10:02a

SMALLB   FO$      9687 03-06-92   7:16p

SMALLE   FO$     11236 03-06-92   7:16p

SMALLF   FO$      9376 03-06-92   7:16p

STFSETUP EX_    477392 01-04-93  12:00a

STFSETUP IN_     58041 01-04-93  12:00a

VER      DL$      5653 10-09-92  10:02a

VER      DL_      9008 01-04-93  12:00a

WORKGRP  IN_      1393 01-04-93  12:00a

       28 file(s)    1183014 bytes

DISK2 Contents

--------------

2        WMF         8022  01-04-93  12:00a

2E       WMF         6870  01-04-93  12:00a

MSACCESS HL$      1189376  01-04-93  12:00a

        3 file(s)    1204268 bytes

DISK3 Contents

--------------

3        WMF      8950 01-04-93  12:00a

3E       WMF      8470 01-04-93  12:00a

MSABC100 DL$    187802 01-04-93  12:00a

MSAES100 DL$     16899 01-04-93  12:00a

MSAFIN   DL$     18553 01-04-93  12:00a

WIZARD   MD$    174297 01-04-93  12:00a

MSACCESS EX$    790199 01-04-93  12:00a

        7 file(s)    1205170 bytes

DISK4 Contents

--------------

4        WMF      8246 01-04-93  12:00a

4E       WMF      7766 01-04-93  12:00a

ANALYZER MD$     49740 01-04-93  12:00a

NEWCUST  DB$      1212 01-04-93  12:00a

NWIND    MD$    555226 01-04-93  12:00a

PIM      MD$    109267 01-04-93  12:00a

SYSTEM   MD$     98863 01-04-93  12:00a

UTILITY  MD$     47055 01-04-93  12:00a

WINHELP  EX$    147911 10-09-92  10:02a

WINHELP  HL$     28161 10-09-92  10:02a

        10 file(s)    1053447 bytes


INF: Consecutively Numbering Pages for Two or More Reports

 Article Number: Q100919

 CREATED: 30-JUN-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

This article describes how to consecutively number the pages

of

multiple reports. For example, if the first report has 10

pages, the

second report will begin numbering at page 11.

MORE INFORMATION

This article assumes that you are familiar with Access Basic

and with

creating Microsoft Access applications using the programming

tools

provided with Microsoft Access. For more information on

Access Basic,

please refer to the "Introduction to Programming" manual.

The following steps demonstrate how to consecutively number

the pages of

multiple reports:

 1. Open a new or existing module and enter the following

code:

'******************************************************

       'Declarations Section of Module

'******************************************************

       Option Explicit

       Global CurrPage As Integer

'======================================================

       'This function returns the page number to be used in

the

        consecutive report footer(s). It also increments the

Global

        Variable CurrPage.

'======================================================

       Function GetPage ()

          CurrPage = CurrPage + 1

          GetPage = CurrPage

       End Function

'======================================================

       'This function is called by the first report to

initialize the

        Global variable to 0.

'======================================================

       Function InitPage ()

          CurrPage = 0

       End Function

'======================================================

       'This function is called from the first report's page

footer.

'======================================================

       Function SetPage (PgNumber As Integer)

          CurrPage = PgNumber

       End Function

 2. Open the first report in Design view by selecting the

report in the

    Database window and choosing the Design button.

 3. From the View menu, choose Properties to display the

property

    sheet.

 4. If the report does not already have a report header,

choose Report

    Hdr/Ftr from the Layout menu.

    NOTE: If you do not want a report header or footer,

simply resize

    the section to a height of 0.

 5. Click any portion of the report header section not

covered by a

    control to display the report header properties.

 6. Set one of the following properties for the report

header section:

       OnFormat: =InitPage()

       -or-

       OnPrint: =InitPage()

 7. Click any portion of the page footer section not covered

by the

    control to display the Page Footer properties.

 8. Set one of the following properties for the page footer

section:

       OnFormat: =SetPage(Page)

       -or-

       OnPrint: =SetPage(Page)

 9. Open the second report in Design view by selecting the

report in

    the Database window and choosing the Design button.

10. Create a text box control in the page footer.

11. Set the following property for the text box control you

just

    created:

       ControlSource: =GetPage()

12. Repeat steps 9-11 for any additional reports you want to

number

    consecutively.

13. Print the reports in order. The pages will be numbered

consecutively.

NOTE: To ensure that the reports are numbered correctly, you

should print

the reports consecutively without previewing each report. If

you want to

preview a report, do not choose Print; be sure to choose

Cancel to return

to the Database window and print the reports consecutively.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 422-424

and 440-444

Microsoft Access "Language Reference," version 1.0, page 364

Additional reference words: 1.00 1.10 AB reports


INF: How to Avoid Abandoned Group Headers in Reports

 Article Number: Q100920

 CREATED: 30-JUN-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article describes a routine to keep a given number of records

together on a page with their group header. The article also explains how

to avoid an abandoned group header at the bottom of a page and how not to

print the group header beyond a certain position on the page in a single-

column or multi-column report.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools

provided with Microsoft Access. For more information on Access Basic,

please refer to the "Introduction to Programming" manual.

MORE INFORMATION

The KeepTogether property is used to keep all of the controls for one

record together in a particular section of a report. This property

does not keep multiple records together, nor does it keep a group

header and its detail records together.

Method 1 below helps you to find the location on the page beyond which

you should not print a group header if you want to keep a given number of

records together with that header.

Method 2 below helps you to determine the twip location by trial and

error and describes two sample functions, one for a single-column report

and the other for a multi-column report.

Method 1

--------

To keep a set number of records together on a single page with the group

header, you need to know approximately how many records will be printed

per group, or, more importantly, how many records you want to print with

a particular group header. You can preview your report to find the group

that prints the most records to determine how many records to keep with

the group header.

For example, say you have determined that the largest group prints 24

records. The detail section of your report is 1/4 inch in height; thus,

24 detail records take up 6 inches on a page. You must also consider the

top and bottom margins, which default to 1 inch each, and the height of

your group header section.

Using the Report.Top property, you can determine where on the page the

next section will print. If enough space remains to print your group

header, all of its detail records, and the page footer (if any), plus

the bottom margin, your group header will be printed on the same page

as its detail records. If there is not enough blank space, delay

printing the report (use a combination of the MoveLayout, NextRecord,

and PrintSection properties to leave the rest of the page blank) and

continue the group header information on the next page.

Below are sample measurements on which this article's calculations are

based:

    Page Length:    11 inches

    Detail.Height:  0.25 inch

Add the following values together:

    Top Margin:          1 inch

    Page Header.Height:  1 inch

    Group Header.Height: 0.5 inch

    Group Footer.Height: 0.5 inch

    Page Footer.Height:  1 inch

    Bottom Margin:       1 inch

    -----------------------------

    Total = 5 inches

To determine the blank space left on the page for detail records,

subtract the total above from your Page Length property value (11

inches - 5 inches = 6 inches).

Divide the maximum space for detail records by the Detail.Height

property value (6 inches / 0.25 inch). A total of 24 detail records

will fit on a page. Force a new page if fewer than 8 records will

print with the header (for example, if the formula returns either less

than the sum of 8 * 0.25 inches or less than 2 inches of blank space).

To determine where the top of the 2-inch limit is, or the point beyond

which you should not print the group header, add the following values

together:

     Top margin 1 inch

     + Page Header.Height 1 inch

     + Remainder of detail section (6 inches - 2 inches)

     = 1 inch + 1 inch + (6 inches - 2 inches)

Final calculation for the function: = 6 inches or (6 * 1440 twips)

To implement this calculation in a module, use the following steps:

1. Enter the =PrintOK() function in the OnFormat property of your

   group header. (This function assumes a report name of MyReport.)

2. Type the following lines in the Declarations section of a module:

      Option Explicit

      Function PrintOK()

         Dim R As Report

         Set R = Reports!MyReport

         If R.Top > (6 * 1440) Then

            R.MoveLayout = TRUE

            R.PrintSection = FALSE

            R.NextRecord = FALSE

         End If

      End Function

Method 2

--------

Another way to avoid an abandoned group header at the bottom of a

page, or not to print the group header beyond a certain position on

the page, is to replace (6*1440) in the function above with the twip

location beyond which you do not want to print.

The report tests the Top property; if the condition is True, the

report does not print the section. Instead, it moves down the report

layout and attempts to print the section until the condition is False,

which occurs at the top of the next page.

For a multi-column report, the function must be modified as follows:

Option Compare Database

Option Explicit

'=====================================================================

'

' Function to force to new column if at bottom of column.

'  R is the name of the Report being formatted, as in

'  Reports![ReportName], and

'  Bottom is the value (in inches) at which a new column is forced.

'====================================================================

Function IfBottom (R As Report, Bottom As Integer)

   Dim YPos

   Static LastPos

   YPos = R.Top

   If YPos > Bottom * 1440 Then  'Beyond this position, go to a new column.

      R.MoveLayout = True

      R.NextRecord = False

      R.PrintSection = (YPos = LastPos) 'Set to True when at Max position.

      LastPos = YPos

   End If

End Function

NOTE: This function will not work properly if Item Layout is set to

Vertical (in Print Setup) for the columns.


INF: Case Sensitivity in Queries Differs with Attached Tables

 Article Number: Q100921

 CREATED: 30-JUN-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you query on an attached table, the criteria are case sensitive.

However, when you query on a native Microsoft Access table, the criteria

are not case sensitive.

MORE INFORMATION

There are several ways to prevent case sensitivity in criteria when you

query on attached tables:

 - Import the attached table, and then base your query on the imported

   table. Criteria values will not be case sensitive.

 - Include a native Microsoft Access table joined to the attached table in

   the query. Criteria values will not be case sensitive.

 - Use the UCase() function in your query to ensure that the field in the

   query dynaset is returned in uppercase, and specify the criteria in

   uppercase. The following sample query demonstrates how to use the

   UCase() function in a query:

     Query: Query1

     --------------------------------

     FieldName: UCase(CITY)

        Show: True

        First Criteria Line: Like "S*"  (Note that the "S" is uppercase)

 - Another option is to be aware that you are using an attached table and

   make sure that the values you use for your criteria match the case of

   the values in the attached table.

Steps to Reproduce Behavior

---------------------------

1. Create a new Microsoft Access database and then attach the sample

   dBASE file NEWCUST.DBF. (This sample dBASE file is supplied with

   Microsoft Access.)

2. Create a new query based on the attached NEWCUST table. This query

   will be called QueryTest.

3. Drag all the NEWCUST table fields to the query grid.

4. Make the following change to the CITY column:

      Query: QueryTest

      ---------------------------------

      FieldName: CITY

         Show: True

         First Criteria Line: Like "s*"

   Note that the "s" is lowercase.

5. Run the query. The result will be an empty set.

6. Import the same dBASE table. Select the Database window, and

   then choose Import from the File menu. In the Data Source box,

   select dBASE III. Choose OK.

7. Recreate the query using steps 1-4. Make sure to base the query on

   the imported table.

8. Run the query. The results return all the records with Seattle as

   the city.

REFERENCES

==========

For more information about criteria in queries, search for "Criteria:

queries" using the Microsoft Access Help menu.

For more information about the UCase() function, search for "UCase, UCase$

Function" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 isam paradox btrieve fox pro


PRA: Import/Append Actions Return Errors for Each Record

 Article Number: Q100922

 CREATED: 30-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.1

---------------------------------------------------------------------

SYMPTOMS

Executing import and append actions that cause every record to return

an import error generates the following error message:

   Couldn't Import. No records found or all records contained errors.

After this error message is displayed, an empty Import Errors table is

created. Also, the Help jump for this error message does not display a

Help topic, but instead takes you to the Microsoft Access Help Table

of Contents.

RESOLUTION

To avoid returning an import error for all records, either modify the

existing table's structure or modify the file itself. If at least one

record imports correctly, you will not receive the above error message

and the Import Errors table will include the correct error

descriptions for each error.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version

1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB.

2. From the File menu, choose Export. Select Text [Delimited].

3. Select the Customers table. Name the file CUSTOMER.TXT.

4. In the Export Text Options box, choose OK.

5. From the File menu, choose Import. Select Text [Delimited] again.

6. Select the CUSTOMER.TXT file.

7. Choose Append to Existing Table, select the Customers table, and

   choose OK.

     NOTE: Due to an indexing violation, trying to use a import

     and append actions to move the CUSTOMER.TXT file back to the

     Customers table causes an error for each record.

   After a few seconds, the above error message is displayed. Note

   that the Help jump has taken you only to the Help Table of

   Contents. At the same time, an empty Import Errors table has been

   created.

table of contents

Additional reference words: 1.10 Help table jump import append TOC


INF: Sample Macro for Repair/Compact Operations

 Article Number: Q100923

 CREATED: 30-JUN-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article demonstrates a sample macro that repairs and compacts a

database.

MORE INFORMATION

To manually repair and compact a database from the File menu, you must

close the database and perform the compact and repair steps individually.

The sample macro in this article automates this process. It repairs a

database called MYDB and compacts it to a new database called NewDB. The

macro will only prompt for information if the name of the database it is

compacting to already exists.

NOTE: The macro must be run from a different database than the one you

want to repair and compact.

Sample Macro

------------

   MacroName   Action        Defined Below

   ---------------------------------------

   Test        SetWarnings       1

               SendKeys          2

               DoMenuItem        3

               SendKeys          4

               DoMenuItem        5

               SetWarnings       6

   Test Actions

   ------------------------------------------------------------------

   1. SetWarnings

          WarningsOn: No

   2. SendKeys

           Keystrokes: MYDB.mdb{enter}

           Wait: No

   3. DoMenuItem

           Menu Bar: Startup (in Microsoft Access version 1.x = Init)

           Menu Name: File

           Command: Repair Database

   4. SendKeys

           Keystrokes: MYDB.mdb{enter}NewDB{enter}

           Wait: No

   5. DoMenuItem

           Menu Bar: Startup (in Microsoft Access version 1.x = Init)

           Menu Name: File

           Command: Compact Database

   6. SetWarnings

           Warnings On: Yes

Notes

-----

 - In most cases this macro works fine. However, remember that keystrokes

   sent by the SendKeys action are buffered temporarily and that results

   may vary. A large database may take extra time to compact or repair; in

   this case, the macro may not exhibit expected behavior.

 - In Microsoft Access version 2.0, you can use new command-line options to

   create an icon in Program Manager to compact or repair your database.

   You can also use the new data access objects (DAO) methods

   CompactDatabase and RepairDatabase from Access Basic. For more

   information about these methods, search for "command line,"

   "CompactDatabase," and "RepairDatabase" using the Microsoft Access Help

   menu.

Additional reference words: 1.00 1.10 2.00


INF: How to Default a Combo Box to the First Row Value

 Article Number: Q100924

 CREATED: 30-JUN-1993

 MODIFIED: 11-NOV-1993

 VERSION(S): 1.00 1.10

------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

------------------------------------------------------------

SUMMARY

Combo boxes based on tables or query values can change frequently. If

you want the combo box to reflect the first row of the table or query

value by default, you can use a domain function.

MORE INFORMATION

The following example demonstrates how to set up a combo box to

default to the first row of a table or query value:

1. Open the sample database NWIND.MDB.

2. Open the Employees form in Design view.

3. From the toolbox, select combo box. Add a combo box to the form.

4. From the View menu, choose Properties.

5. Add the following properties to the form:

      RowSource: Employees

      ColumnCount: 2

      ColumnWidth: 0 in; 1 in;

      BoundColumn: 2

      Default Value: =Dfirst("[Last Name]","Employees")

6. From the View menu, choose Form.

The default value is now set to the first row.

Additional reference words: 1.00 1.10


PRB: ReportWizard Defaults to 8.5-by-11-Inch Page

 Article Number: Q100963

 CREATED: 01-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you use the ReportWizard to create a Groups/Totals report, if the

Fit All Fields On One Page check box in the last ReportWizard dialog

box is selected, the report controls are positioned in the leftmost

8.5 inches of the page.  This happens even if you have changed the

printer driver setup in the Microsoft Windows Control Panel to 8.5 by

14 inches with landscape orientation.

CAUSE

The default page settings are set by the ReportWizard and do not

reflect the printer settings you make in the Control Panel.

RESOLUTION

In the report's Design view, modify the layout to reflect the page

size you want. For example, you can extend the right edge of the

report and place the controls in the newly extended area.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. In the Microsoft Windows Control Panel, set your printer setup to

   8.5 by 14, with landscape orientation.

2. Start Microsoft Access and open the sample database NWIND.MDB.

3. Create a new report based on the Employees table.

4. Choose ReportWizard and select Groups/Totals.

5. Add all of the fields to the report except the Photo field.

6. After building the report, select the Fit All Fields On One Page

   check box.

7. Preview the report.

The report will be formatted for 8.5-by-14-inch paper, but the right

side of the report will be blank. Choose Cancel to switch to Design

view, and note that the right edge of the report is aligned to the 8-

inch mark on the horizontal ruler bar.

Additional reference words: 1.00 1.10 reports wizard


PRA: Exporting Nulls to Paradox Actually Exports a Space

 Article Number: Q100964

 CREATED: 01-JUL-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

No records are returned when a Paradox user tries to search

a Paradox

database created using the Microsoft Access Export command.

This

problem occurs only when the criteria specifies fields that

are BLANK.

(The Paradox BLANK criteria is equivalent to the Microsoft

Access NULL

criteria.)

CAUSE

When Microsoft Access exports a table to a Paradox database,

all

fields that are NULL in Microsoft Access are replaced with a

space

during export to Paradox. This prevents Paradox users from

correctly

retrieving records based on the Paradox BLANK criteria

command.

This problem may also occur if a Microsoft Access .MDB file

attaches

a Paradox database and the Microsoft Access user deletes the

entire

contents of a field from the attached Paradox database.

Microsoft

Access treats the empty field as NULL, while a Paradox user

treats the

same field as NOT BLANK.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access version

1.0. This problem no longer occurs in Microsoft Access 1.1.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB.

2. From the File menu, choose Export.

3. In the Export dialog box, select the Paradox 3.X file

format and

   the Customers table. Name the file CUSTOMER.DB.

4. Open Paradox 3.5 and create a new query, using graphical

query by

   example (QBE) on the exported CUSTOMER.DB file.

5. Using the F6 key, check the Customer ID and Region fields

in QBE.

6. Add the criteria BLANK to the Region field.

7. Press F2 to execute the query. Zero records are returned

to the

   Paradox Answer table.

8. Change the criteria of the Region field to NOT BLANK,

then press

   F2. Note that all the records are returned.

Paradox is manufactured by Borland International, Inc., a

vendor

independent of Microsoft; we make no warranty, implied or

otherwise,

regarding this product's performance or reliability.


INF: Setup Files Utility Appears to Hang

 Article Number: Q100965

 CREATED: 01-JUL-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SUMMARY

After you install the Microsoft Access Distribution Kit (ADK), you should

run the Setup Files utility (SUFiles). This utility compresses files from

various directories, including the Windows and Access directories, into

the SUFILES directory so that when you build your distribution disks, the

SetupWizard only needs to copy the compressed files to the disk

directories and does not have to recompress each time a distribution disk

is built.

MORE INFORMATION

When you run this utility, it appears to stop responding (hang). The

cursor remains a pointer; it does not become an hourglass to indicate

that progress is occurring. The progress meter remains at zero percent

(0%), and you do not see any hard disk activity. Eventually, the screen

is updated.

This process requires varying amounts of time depending on your

computer type and the amount of memory available. The average time is

approximately 20 minutes. Here are two examples:

   Processor/Speed  Memory   Time Required

   ---------------------------------------

   486/50           16 MB    10 minutes

   386/16            4 MB    45 minutes

This utility is designed so that you can choose Cancel. If the pointer

were to change to an hourglass, you would lose that ability.


PRB: Error Message "The File WFWNET.DR_ Could Not Be Found"

 Article Number: Q100967

 CREATED: 01-JUL-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SYMPTOMS

When you attempt to install the updated Microsoft Windows for

Workgroups network driver, the error message "The file WFWNET.DR_

could not be found" appears.

CAUSE

The WFWDRV Setup program was not run from the drive containing the

disk with the updated driver.

RESOLUTION

Run the Setup program from the drive containing the disk with the

updated driver.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version

1.0. This problem no longer occurs in Microsoft Access version 1.1.


PRB: Error Message If Path Info for Attached Databases Changes

 Article Number: Q100969

 CREATED: 01-JUL-1993

 MODIFIED: 12-OCT-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The following error message is displayed:

   Couldn't find table <table name>

CAUSE

The Access Distribution Kit (ADK) recommends splitting up databases.

You can place your forms, reports, and macros in an objects file, such

as PROGRAM.MDB, and place your tables in a data file called DATA.MDB.

When you create a database that has attached tables, the specific path to

these attached tables is stored in the database. If the path to these

attached tables has changed, you receive the above error message.

Splitting the database simplifies updating, since you can redistribute

the objects file and copy over the PROGRAM.MDB file without destroying

your data.

RESOLUTION

The ADK requires that your database have an AUTOEXEC macro. From

within the AUTOEXEC macro, call an Access Basic function to verify

that the attached tables are actually attached. If they are not

attached, you must attach them.

When you start your application, make sure that the program's working

directory property is the same directory as the .MDB file. The

Microsoft Access Setup Wizard automatically sets this property

automatically in Program Manager. Use the CurDir() function to

determine from what directory the program is being executed, then

attach the files to that directory.

MORE INFORMATION

1. Create a new directory (for example, C:\ATTACH).

2. Copy the sample database NWIND.MDB from your ACCESS directory to

   the C:\ATTACH directory.

3. Start MSACCESS.EXE. From the File menu, choose New. Create a new

   database called PROGRAM.MDB in the C:\ATTACH directory.

4. From the Database window, choose Module and then choose New. Enter

   the following function:

      Function Reattach ()

         On Error GoTo attach_files

         DoCmd SelectObject a_table, "Employees", True

         Exit Function

      attach_files:

      'NOTE: In the following sample code, an underscore (_) is

      'used as a line continuation character. Remove the underscore

      'when re-creating this code in Access Basic.

         DoCmd TransferDatabase A_ATTACH, "Microsoft Access", _

                 CurDir &"\nwind.mdb", A_TABLE, "Employees", _

                  "Employees"

         Exit Function

      End Function

5. Save the module as Module1.

6. Create the following new macro and save it as AUTOEXEC:

      Macro Name     Action     Argument

      ----------------------------------

      Autoexec       RunCode    Reattach()

7. Close PROGRAM.MDB, then reopen it. Note that PROGRAM.MDB attaches

   the Employees table from NWIND.MDB.

Additional reference words: 1.0 1.10 attach ADK datafile


INF: How to Give Users the Ability to Change Passwords

 Article Number: Q100970

 CREATED: 01-JUL-1993

 MODIFIED: 06-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - Microsoft Access Distribution Kit version 1.1

 - Microsoft Access Developer's Toolkit version 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to distribute a secure application with the

Microsoft Access Distribution Kit or Developer's Toolkit and still give

your users the ability to change their passwords.

MORE INFORMATION

To achieve this functionality, do the following:

1. Make the Database window active so that you can access the Security

   menu. (The best method for this is to select an object in the Database

   window through a macro).

2. From the Security menu, choose Password. The user then changes the

   password.

3. Once the user has closed the Password dialog box, set the focus

   back to the form you called the macro or function from.

   Here is a sample macro:

      Macro:Change Password

      ---------------------

      Actions

      -------

      SelectObject

      DoMenuItem

      SelectObject

      Action arguments

      ----------------

      SelectObject

          Object Type: Macro

          Object Name: Autoexec

          In Database window: Yes

      DoMenuItem

          Menu Bar: Database

          Menu Name: Security

          Command: Change Password

          Subcommand:

      SelectObject

          Object Type: Form

          Object Name: Form1

          In Database window: No

The Database window appears, as well as the dialog box to change the

password. You cannot select anything in the Database window because

the Change Password dialog box is modal.

In the Microsoft Access Distribution Kit or Developer's Toolkit, the

functionality is identical except that the Database window is not

displayed.

Additional reference words: 1.00 1.10 2.00 container adk adt


PRB: ADK Custom Setup Hangs During Installation
PRB: ADK Custom Setup Hangs During Installation [B_WAccADK]

 Article Number: Q100971

 CREATED: 01-JUL-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

If you create Setup disks using the Microsoft Access Distribution Kit

(ADK) Custom Setup Wizard, the installation process hangs immediately

after SETUP.EXE creates the program group.

CAUSE

This problem is caused by not specifying an icon file for the application

in the .ICO File (Optional) field and selecting the Change Workgroups

Program Manager Item check box when the message "Would you like to install

any of these optional features?" appears in the Setup Wizard.

RESOLUTION

Run the Setup Wizard again and specify an icon file for the .ICO File

(Optional) field, or follow the steps outlined below to modify the

STFSETUP.IN_ file.

STATUS

This problem no longer occurs in the Microsoft Access Developer's Toolkit

version 2.0.

MORE INFORMATION

When the Setup Wizard creates the STFSETUP.IN_ file, it requires that

that you have an icon file if you choose to install Change Workgroups.

The [Custom] section of the file contains the following line:

   InstallChangeWorkGroup="YES"

If you have set this option to Yes, you must also add a line in the

[Program Manager] section of the STSETUP.IN_ file that reads:

   $(AppPath)"NWIND.ICO"

You also need to substitute NWIND.ICO with an icon name that you

specify.

Updating Your STFSETUP.IN_ File

-------------------------------

1. Open the STFSETUP.IN_ file in Notepad. This file is usually found

   in the DISK1 directory of the custom application.

2. Change the following entry

      [Program Manager]

      CreateProgManGroup $(ProgGroupDesc), "NWIND"

      CreateProgManItem $(ProgGroupDesc), "NWIND",

      $(AppPath)"MSARN110.EXE_ NWIND.MDB /Ini NWIND.INI"

      EXIT

   to read

      [Program Manager]

      CreateProgManGroup $(ProgGroupDesc), "NWIND"

      CreateProgManItem $(ProgGroupDesc), "NWIND",

      $(AppPath)"MSARN110.EXE_ NWIND.MDB /Ini NWIND.INI",

      $(AppPath)"NWIND.ICO"

      EXIT

Steps to Reproduce Behavior

---------------------------

1. Run the Microsoft Access Custom Setup Wizard. Do not specify an

   icon.

2. When you are prompted for ISAMs, select ChangeWorkGroup.

3. After the Setup Wizard creates your disks, run SETUP.EXE. The

   process will hang on the last disk, after the icons are added to

   Windows Program Manager.

Additional reference words: 1.10 ADK


INF: Force MS Access to Use "Snapshot" Mode for Attached Data

 Article Number: Q100972

 CREATED: 01-JUL-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access addresses attached data differently than it does

its own native data. This article discusses how Microsoft Access

retrieves attached ODBC data.

MORE INFORMATION

If SQLStatistics(), an ODBC API function, reports a unique index on

the table, Microsoft Access goes to the dynaset to select the values

from the unique key fields that adhere to the user's WHERE clause

restrictions. It then selects only the data needed for display, using

the unique key values (10 at a time).

If the table does not have a unique key, Microsoft Access pulls down

all the data at once in read-only ("snapshot") mode. In most cases,

this process will be faster once the data is pulled down, though the

data cannot be updated.

If you want to enforce read-only mode all the time, add the following

line to the [ODBC] section of your MSACCESS.INI file:

   SnapshotOnly=1

This restriction will apply only to tables attached after you make the

change and will simply short-circuit the call to the SQLStatistics()

function during the attachment phase.

In general, a table in dynaset mode typically takes 4-5 seconds to

open, as opposed to 1-2 seconds for a table in read-only mode.

Additional reference words: 1.00 1.10 2.00 snapshot


INF: How to Create a Function to Capture Screens of Your Forms

 Article Number: Q100973

 CREATED: 01-JUL-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

You can use Microsoft Windows API functions to capture screens of any

object on the Microsoft Windows desktop. You can perform screen

captures of Microsoft Access, Microsoft Access objects, other

Microsoft Windows applications, or the entire desktop.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

MORE INFORMATION

The following sample Access Basic code will capture an object on the

screen to the Clipboard. Note that you can change the handle

AccessHwnd in the sample code below to create screen captures of other

applications, including specific objects within Microsoft Access.

After capturing a screen, you can open Paintbrush (PBRUSH.EXE) and

choose the Paste command from the Edit menu. The screen capture from

Microsoft Access will be loaded into the Paintbrush window.

To run this code, call the ScreenDump() function from an event, a

macro, or the module's Immediate window. To run ScreenDump() from the

Immediate window, type the following, and then press ENTER:

   ?ScreenDump()

To set up the ScreenDump() function, open a new or existing module and

insert the code listed below.

Notes:

 - In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

 - You may have some Microsoft Windows API functions defined in an existing

   Microsoft Access library; therefore, your declarations may be

   duplicates. If you receive a duplicate procedure name error message,

   remove or comment out the declarations statement in your code.

Code for the ScreenDump() Function:

   Option Compare Database

   Option Explicit

   Type RECT_Type

       left As Integer

       top As Integer

       right As Integer

       bottom As Integer

   End Type

   Declare Function GetActiveWindow% Lib "User" ()

   Declare Function GetDesktopWindow% Lib "User" ()

   Declare Sub GetWindowRect Lib "User" (ByVal Hwnd%, _

                                       lpRect As RECT_Type)

   Declare Function GetDC% Lib "User" (ByVal Hwnd%)

   Declare Function CreateCompatibleDC% Lib "GDI" (ByVal hdc%)

   Declare Function CreateCompatibleBitmap% Lib "GDI" (ByVal hdc%, _

                                       ByVal nWidth%, ByVal nHeight%)

   Declare Function SelectObject% Lib "GDI" (ByVal hdc%, ByVal hObject%)

   Declare Function BitBlt% Lib "GDI" (ByVal hDestDC%, ByVal X%, _

                                       ByVal Y%, ByVal nWidth%, _

                                       ByVal nHeight%, ByVal hSrcDC%, _

                                       ByVal XSrc%, ByVal YSrc%, _

                                       ByVal dwRop&)

   Declare Function OpenClipboard% Lib "User" (ByVal Hwnd%)

   Declare Function EmptyClipboard% Lib "User" ()

   Declare Function SetClipboardData% Lib "User" (ByVal wFormat%, _

                                       ByVal hMem%)

   Declare Function CloseClipboard% Lib "User" ()

   Declare Function ReleaseDC% Lib "User" (ByVal Hwnd%, ByVal hdc%)

   Declare Function DeleteDC% Lib "GDI" (ByVal hdc%)

   Global Const SRCCOPY = &HCC0020

   Global Const CF_BITMAP = 2

   Function ScreenDump ()

      Dim AccessHwnd%, DeskHwnd%

      Dim hdc%

      Dim hdcMem%

      Dim rect As RECT_Type

      Dim junk%

      Dim fwidth%, fheight%

      Dim hBitmap%

       DoCmd Hourglass True

       '---------------------------------------------------

       ' Get window handle to Windows and Microsoft Access

       '---------------------------------------------------

       DeskHwnd = GetDesktopWindow()

       AccessHwnd = GetActiveWindow()

       '---------------------------------------------------

       ' Get screen coordinates of Microsoft Access

       '---------------------------------------------------

       Call GetWindowRect(AccessHwnd, rect)

       fwidth = rect.right - rect.left

       fheight = rect.bottom - rect.top

       '---------------------------------------------------

       ' Get the device context of Desktop and allocate memory

       '---------------------------------------------------

       hdc = GetDC(DeskHwnd)

       hdcMem = CreateCompatibleDC(hdc)

       hBitmap = CreateCompatibleBitmap(hdc, fwidth, fheight)

       If hBitmap <> 0 Then

          junk = SelectObject(hdcMem, hBitmap)

          '---------------------------------------------

          ' Copy the Desktop bitmap to memory location

          ' based on Access coordinates.

          '---------------------------------------------

          junk = BitBlt(hdcMem, 0, 0, fwidth, fheight, hdc, rect.left, _

                        rect.top, SRCCOPY)

          '---------------------------------------------

          ' Set up the Clipboard and copy bitmap

          '---------------------------------------------

          junk = OpenClipboard(DeskHwnd)

          junk = EmptyClipboard()

          junk = SetClipboardData(CF_BITMAP, hBitmap)

          junk = CloseClipboard()

       End If

       '---------------------------------------------

       ' Clean up handles

       '---------------------------------------------

       junk = DeleteDC(hdcMem)

       junk = ReleaseDC(DeskHwnd, hdc)

       DoCmd Hourglass False

   End Function

Additional reference words: 1.00 1.10 2.00 dump


INF: Filenames/Version Numbers, ODBC Files for MS Access V1.1

 Article Number: Q100975

 CREATED: 01-JUL-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.1

---------------------------------------------------------------------

SUMMARY

This article lists information about the ODBC files that ship with

Microsoft Access version 1.1.

MORE INFORMATION

The following ODBC files ship with Microsoft Access 1.1:

   Filename      Version     Size     Date

   ------------------------------------------

   SQLSRVR.DLL   1.01.2920   151856   5-20-93

   SQORA.DLL     1.00.2816   143600   4-16-93

   ODBC.DLL      1.00.2709    44736   4-08-93

   INSTCAT.SQL      **        93834   5-20-93

** The version number that displays when you execute sp_server_info

500 is 01.01.2807, though technically there is no such version of this

file.

Another file that is important to Microsoft SQL Server is DBNMP3.DLL,

which should be 9941 bytes.

Additional reference words: 1.10 ODBC


PRB: "Out of Stack Memory" Error Message with SendKeys Macro

 Article Number: Q101067

 CREATED: 04-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You receive the following error message when choosing a command

button:

   Not enough stack memory left

This problem occurs when you activate a macro from the OnPush property in

version 1.x, or the OnClick property in version 2.0, of a command button on

a form. The macro includes a SendKeys action, in which the keystrokes sent

include the ESC key and the Wait argument is set to Yes.

CAUSE

The Cancel property of the command button is set to Yes.

RESOLUTION

Change the Cancel property of the command button to No.

MORE INFORMATION

You receive the above error message if you choose a command button and

all the following conditions are met:

 - The macro attached to the command button includes a SendKeys action.

 - The command button's Cancel property is set to Yes.

 - You choose the command button by pressing ESC.

If the command button activates a macro that performs a SendKeys action,

which in turn sends an ESC keystroke, the button that repeatedly activates

the macro is chosen and an endless loop results. Note that if the Wait

argument on the SendKeys action is set to No, Microsoft Access will appear

to hang.

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. Create a new macro called Test Macro:

      Test Macro Actions

      ------------------

      SendKeys

         Keystrokes: {esc}

         Wait: Yes

3. Open the Customers form in Design view.

4. Add a command button to the form:

      Object: Command Button

      ----------------------

      ControlName: Test Button

        Caption: Test Button

        OnPush: Test Macro (version 1.x)

        OnClick: Test Macro (version 2.0)

        Cancel: Yes

5. Switch to Form view.

6. Choose the Test button. The following error message appears:

      Not enough stack memory left

REFERENCES

==========

Microsoft Access "Language Reference," versions 1.0 and 1.1, page 59

Additional reference words: 1.00 1.10 2.00 macro


PRB: Directory Name in ADK SUFiles Setup Utility Not
PRB: Directory Name in ADK SUFiles Setup Utility Not Uppercase[B_WAccADK]

 Article Number: Q101068

 CREATED: 04-JUL-1993

 VERSION(S):  MODIFIED: 28-MAR-1994

ENDUSER |

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

When you are running the SUFiles utility and you type the name of the

Microsoft Access program directory in the Create ADK Setup Files

Directory dialog box, the text you type appears in lowercase instead

of uppercase.

RESOLUTION

This behavior does not affect the functionality of the SUFiles utility

or your custom Setup program.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft Access

Distribution Kit version 1.1. This problem no longer occurs in the

Microsoft Access Developer's Toolkit version 2.0.

Additional reference words: 1.10 upper lower case capitalize letters


PRB: Custom Setup Creates Too Many Program Groups
PRB: Custom Setup Creates Too Many Program Groups [B_WAccADK]

 Article Number: Q101069

 CREATED: 04-JUL-1993

 MODIFIED: 11-NOV-1993

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

Custom Setup creates a program group for each icon you install and an

additional empty program group. For example, if Custom Setup is

supposed to create one program group containing two icons (for your

application and Change Workgroup), Setup actually creates three

program groups, only two of which contain an icon.

CAUSE

This problem occurs if your application is being installed to a

machine running Windows 3.0 and the application name you specified in

the last screen of the Custom Wizard is longer than 24 characters.

RESOLUTION

To correct this problem, reduce the length of the program group name.

Steps to Reproduce Problem

--------------------------

1. Run the Setup Wizard.

2. When the last screen prompts you for the name of the application,

   specify a name longer than 24 characters.

3. Create the program disks and install the application on a machine

   running Windows 3.0.

Additional reference words: 1.10


INF: How to Make Custom Application Name Appear in Task List
INF: How to Make Custom Application Name Appear in Task List [B_WAccADK]

 Article Number: Q101070

 CREATED: 04-JUL-1993

 VERSION(S):  MODIFIED: 31-MAR-1994

ENDUSER |

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

In order for the title of your custom Microsoft Access application to

appear in the Microsoft Windows Task List, you need to provide a Title

Bar setting in the application's .INI file. The setting should be

included in the [Run-Time Options] section of the .INI file and should

have the following format:

   [Run-Time Options]

   TitleBar=<MyApplicationName>

Substitute the name of your custom application for <MyApplicationName>

in the example above.

Restart your custom application after making this change to the .INI

file. The application's name will appear in the Task List.

Additional reference words: 1.10


INF: Using SQL Server ODBC Driver with Sybase Servers

 Article Number: Q101071

 CREATED: 04-JUL-1993

 MODIFIED: 12-OCT-1993

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.1

---------------------------------------------------------------------

SUMMARY

The SQL Server ODBC driver was designed to work with both Microsoft

SQL Server and Sybase SQL Server machines. The ODBC organization at

Microsoft has completed some limited interoperability testing with

Sybase version 4.2 on the SPARC platform, using the Microsoft TCP/IP

network protocol and the Sybase Net-Library for this stack, and have

not uncovered any significant problems. Below two issues to consider

if you use the SQL Server ODBC driver with Sybase servers.

MORE INFORMATION

Issue 1

-------

The ODBC driver requires the catalog procedures that shipped with

Sybase SQL Server 4.2a. Until the Sybase 4.9.1 release, these catalog

procedures did not ship with Sybase servers. For the ODBC driver to

work with Sybase servers, the INSTCAT.SQL script must be run against

the Sybase server to install the catalog procedures.

Sybase changed the system catalogs in its version 4.8 release,

requiring a modified script. This script is called INSTCAT.48 and is

available through Microsoft Product Support Services and on

CompuServe. This script is required with Microsoft Access version 1.0

and Microsoft Visual Basic version 2.0 applications.

With Microsoft Access 1.1 and Visual Basic 3.0, the INSTCAT.SQL file

applies to all versions of Microsoft SQL Server, as well as to all

versions of Sybase SQL Server.

Issue 2

-------

The SQL Server ODBC driver that shipped with Microsoft Access 1.0 and

Visual Basic 2.0 came with the Sybase Net-Library. To connect to

Sybase, you needed to use Microsoft SQL Bridge or install Net-Library

on each client machine.

Both Microsoft Access and Visual Basic 2.0 use the network in a way

that is not typical of Windows-based applications (for instance, these

applications use multiple, simultaneous connections and asynchronous

calls). It is probable that there are network configurations in which

Net-Library will fail with these products.

Microsoft and Sybase are now discussing how best to perform

interoperability testing with the various network configurations

supported by Sybase (FTP Software, Wollongong, Novell, TCP/IP, DECnet,

and so forth).

The following products are manufactured by vendors independent of

Microsoft: DECnet is manufactured by Digital Equipment Corporation;

FTP Software is manufactured by FTP Software, Inc.; Novell networking

products are manufactured by Novell, Inc.; SPARC is manufactured by

Sun Microsystems, Incorporated; Net-Library and Sybase SQL Server are

manufactured by Sybase, Inc. We make no warranty, implied or

otherwise, regarding these products' performance or reliability.

The CompuServe file name containing the INSTCAT.SQL and the INSTCAT.48

is either SQL100.EXE or SQL110.EXE and is located in the ODBC

Connectivity library in the MSACCESS forum.

Additional reference words: 1.10 Sybase SQL Server Oracle Net-Library


PRB: Buttons Pasted into Option Groups Have Option Value

 Article Number: Q101072

 CREATED: 04-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A stand-alone option button that has been pasted into an option group

has an OptionValue property of -1.

CAUSE

Stand-alone option buttons do not have an OptionValue property. When a

stand-alone option button is pasted into an option group, the button's

default ControlSource property of -1 is assigned to the button's

OptionValue property.

RESOLUTION

Manually change the option button's OptionValue property.

MORE INFORMATION

Steps to Reproduce Behavior

--------------------------

1. Create an option group. Create an option button outside the group.

2. Copy the button onto the clipboard.

3. Select the option group.

4. Paste the button into the option group.

The button's OptionValue property will be set to -1.

REFERENCES

==========

For more information on the OptionValue property, search for "Option

Group" then "OptionValue" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


INF: Connecting to Sybase SQL Server from an ODBC Application

 Article Number: Q101073

 CREATED: 04-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.1 and 2.0

 - Microsoft Visual Basic version 3.0 for Windows

 - Microsoft FoxPro version 2.5 for Windows

---------------------------------------------------------------------

SUMMARY

You can connect to a Sybase SQL Server computer from an ODBC application

(such as Microsoft Access, Microsoft Visual Basic, or Microsoft FoxPro for

Windows) using the ODBC SQL Server driver. This article describes how to

set up the ODBC data sources.

If you are already connected to Sybase SQL Server from Microsoft

Windows DB-Library applications, no other components are necessary.

MORE INFORMATION

The key to both Microsoft SQL Server and Sybase SQL Server

connectivity is a module called the Net-Library. This module consists

of two interfaces: one with the network and one with the application.

The network interface is customized to support a particular network;

however, the application interface remains the same.

Since ODBC, DB-Library, APT-SQL, APT-Library, and so forth communicate

with the Net-Library, these utilities can be written independent of

the network. The ODBC SQL Server driver, in particular, can be used to

connect either to a Microsoft SQL Server computer or to a Sybase SQL

Server computer (on a UNIX or VMS system), as long as there is a

Net-Library for whatever network you are using.

The following paragraphs discuss how to connect to a Sybase SQL Server

from an ODBC application. The remainder of the article assumes that

you are connected to a SQL Server called "Mysqlsvr." This server

should be set up as an ODBC data source, using the ODBC Control Panel

utility, as follows:

1. Open ODBC Control Panel and choose Add.

2. Select SQL Server from the list of installed drivers and choose OK.

3. In the ODBC SQL Server Setup dialog box, type a data source name

   and a description (optional).

   Note that a single server can function as multiple ODBC data

   sources, since each database in the server can be a data source.

   The data source name need not be the same as the server name.

4. Enter the true name of the server, then enter the network address.

   Since a Sybase SQL Server on UNIX uses sockets and not

   named pipes, the network address must contains the IP address and

   the port identification number. This string is in the form

   "ip_address,port" (for example, "11.1.14.40,3180").

   For a Sybase SQL Server on a VAX system, this string should be in

   the form "<node address>,<process_id>", where <node address> is the

   DECnet node address of the server and <process_id> is the process

   identification number to use for the connection (for example,

   "1.997,141").

   The Network Library field should contain the name of the

   Net-Library you need to use. This is dependent on what network you

   are using. For example, if you are using the FTP Software product

   PCTCP, the Net-Library name is "wdbftptc".

5. Choose Options to specify a database name or a language name.

6. Choose OK to go back to the first screen.

7. Run the INSTCAT.SQL script file.

   NOTE: This is a file containing SQL statements that will create

   certain stored procedures needed to process ODBC calls. Without

   these procedures, Microsoft Access cannot attach a SQL Server

   table and Visual Basic is not able to function correctly.

   At the UNIX command line or the MS-DOS prompt, type the following:

      isql -S<servername> -Usa -P<sa-password> -i<path>\instcat.sql

Finally, note that if the above procedure is followed correctly, the

following changes appear in the ODBC.INI and WIN.INI files. The [Data

Sources] section of ODBC.INI will contain the following entry:

   <data-source-name>=SQL Server

where <data-source-name> is the name of the data source that you

added. There will be a new section called [data-source-name]

containing the location of the SQL Server driver and a description of

the data source. The [SQLSERVER] section of the WIN.INI will contain

the following entry:

   data-source-name=<netlib-name>,<network address>

The following products are manufactured by vendors independent of

Microsoft: DECnet, VMS, and MicroVAX by Digital Equipment Corporation;

FTP Software by FTP Software, Inc.; DB-Library, Net-Library, and

Sybase SQL Server by Sybase, Inc.; and UNIX by UNIX System

Laboratories. We make no warranty, implied or otherwise, regarding

these products' performance or reliability.

Additional reference words: 1.10 2.00 third-party


INF: Using SendKeys to Change Option Menus

 Article Number: Q101074

 CREATED: 04-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

In a Microsoft Access macro, a SendKeys action will not run properly

if it follows a DoMenuItem or other macro action that opens a Print

dialog box. For example, when a DoMenuItem action is called to the

Print dialog box in order to change a printing parameter before

printing, the keystrokes in the subsequent SendKeys action remain in

the buffer and do not run.

MORE INFORMATION

Because opening a dialog box suspends a macro, the SendKeys action

must be sent before the dialog box opens. The following example

demonstrates opening the Print dialog box, selecting the page range

1-5, and printing the current object.

   Action              Comment

   ---------------------------------------------------------

   SendKeys            Store keystrokes for Print dialog box

   DoMenuItem          open Print dialog box

   SendKeys Action

   ---------------

   Keystrokes: %p1%t5{ENTER}

   Wait: No

   DoMenuItem Action

   -----------------

   Menu Bar: Form

   Menu Name: File

   Menu Command: Print

REFERENCES

==========

Microsoft Access "Language Reference," pages 432-433

For more information on SendKeys actions, search for "SendKeys" then

"Sendkeys Actions" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


INF: How to Print Odd or Even Pages of a Report

 Article Number: Q101075

 CREATED: 04-JUL-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to print separately the odd and even pages

of a report for duplex printing or to print reports with different

margins for binder storage.

MORE INFORMATION

The best way to print separately odd and even pages of report is to

set up a form that prompts you for the pages to print (odd or even)

and then calls a macro to print the report. (Page 559 of the 1.0

"User's Guide" shows a sample form that prompts the user to fill in

values on the form before a macro prints the report.) The form in the

example below contains a text box control to hold the value "odd" or

"even" and a command button to print the report.

NOTE: When you use the following steps to print even pages, all the

odd pages generate blank pages (and vice versa). Whenever you

implement this routine, your report generates blank pages between each

printed page.

1. Create a new form called Print Odd Even Pages:

   a. Locate an unbound text box with ControlName = PrintPages.

   b. Locate a command button with Caption = Print Report. From the

      OnPush property, call the following OddEven.Print macro group.

2. Create a new macro called OddEven with the following macro groups:

   NOTE: In the following example, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this

   example.

      Macro Group Name      Condition                        Action

      -----------------------------------------------------------------

      Print                                                  OpenReport

      TestOddEven           Forms![Print Odd Even Pages] _

                            ![PrintPages]="Even" And _

                            Page Mod 2=1                     CancelEvent

                            Forms![Print Odd Even Pages] _

                            ![PrintPages]="Odd" And _

                            Page Mod 2=0                     CancelEvent

      OpenReport Actions

      ------------------------------------

      Report Name: Customer Mailing Labels

      View: Print Preview

3. From each report section that is printing data, call the macro

   group OddEven.TestOddEven from the OnPrint event.

   For example, in the NWIND.MDB sample database report Customer Mailing

   Labels, the only section that is printing is the detail section. The

   page header and page footer in this report do not print any values.

   For the detail section, set the OnPrint event to:

      OddEven.TestOddEven

4. With the form open, enter Odd or Even in the text box. When you

   choose the Print Report command button, the Customer Mailing Labels

   report opens. Press OK for all countries. The report then runs its

   OnPrint events, which call the macro group OddEven.TestOddEven to

   print only the odd or even pages.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 23, "Using Macros to

Print Reports or Transfer Data," pages 556-560

Microsoft Access "User's Guide," version 2.0, Chapter 26, "Using Macros to

Print Reports or Transfer Data"

Additional reference words: 1.00 1.10 2.00 every other page left right


INF: Expressions to Count Yes, No, and Other Responses

 Article Number: Q101076

 CREATED: 04-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article lists sample expressions that you can use to count the

occurrences of Yes, No, or Null in a field with a Yes/No data type.

MORE INFORMATION

The following expressions can be used in a report's group footers or

report footer to count the occurrences of Yes, No, or Null in a field

named YesNoField the with data type Yes/No:

   Expression                         Sums What

   --------------------------------------------

   =Sum(IIF([YesNoField],1,0))        Yes

   =Sum(IIF([YesNoField],0,1))        No

   =Sum(IIF(Not[YesNoField],1,0))     No

   =Sum(IIF(IsNull[YesNoField],1,0))  Null

You can also create a related expression to count a specific value in

a field. For example, the following sample expression counts all

occurrences of the value 3 in a field called MyField.

   =Sum(IIF([MyField]=3,1,0))

Example Using Sample Database NWIND.MDB

---------------------------------------

1. Open the sample database NWIND.MDB.

2. Use the Report Wizard to create a Groups/Totals report based on

   the Products table.

3. Select Category ID as the only field on your report.

4. Group on Category ID.

5. In the report's Design view, add an unbound text box in the Category ID

   Footer section with the ControlSource property for the box set to the

   following expression:

      =Sum(IIF([Discontinued],1,0))

6. Add a second unbound text box with the ControlSource property for

   the box set to the following expression:

      =Sum(IIF([Discontinued],0,1))

7. From the File menu, choose Print Preview. The first expression will

   count the number of products within each category that have the

   Discontinued field set to Yes. The second expression will count the

   number of products within each category that have the Discontinued

   field set to No.

Additional reference words: 1.00 1.10 2.00


PRB: Background Bitmap in Custom Setup Cannot Be Altered

 Article Number: Q101078

 CREATED: 04-JUL-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

The Setup bitmap that appears in the background of a custom Setup

program created with the Microsoft Access Distribution Kit (ADK)

SetupWizard cannot be altered.

STATUS

This behavior is by design.

MORE INFORMATION

The SetupWizard in the ADK does not allow you to alter the Setup

bitmap for custom Setup programs. However, the MSSetup kit that ships

with the Microsoft Windows Software Development Kit (SDK) does allow

you to build custom Setup programs with complete, programmatic control

over every element of the Setup environment, including background

bitmaps, buttons, and dialog boxes. If you want this level of control

in creating your custom Setup program, you may want to consider using

the SDK. Note, though, that the SDK tools cannot be used to modify an

existing custom Setup program that was developed with the ADK.


INF: How to Create an Undo Record Button on a Form

 Article Number: Q101079

 CREATED: 04-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to create a button on a form to undo

changes made to the current record.

MORE INFORMATION

To undo the changes to the current record, you can use the DoMenuItem

macro action to choose Undo Current Record from the Edit menu.

However, this menu item is available only when there are changes to

undo. Attempting to use the DoMenuItem action when no changes have

been made to the current record causes the following error message to

appear:

   Command not available: UndoCurrentRecord

The following is a module using the Access Basic function

UndoRecord(), which allows you to undo the current record, whether or

not the record has been changed, or "dirtied":

   Option Explicit

   Function UndoRecord ()

      On Error GoTo ErrUndoRecord

      DoCmd DoMenuItem A_FORMBAR, A_EDITMENU, A_UNDOFIELD

      DoCmd DoMenuItem A_FORMBAR, A_EDITMENU, A_UNDO

   ByeUndoRecord:

      Exit Function

   ErrUndoRecord:

      Resume ByeUndoRecord

   End Function

To use this function on a form, create a command button and set its

OnPush or OnClick property to =UndoRecord().

Additional reference words: 1.00 1.10 2.00


PRB: "Out of Memory" Error Message When Exporting Table

 Article Number: Q101080

 CREATED: 04-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you are exporting a Microsoft Access table, an "Out of Memory"

error message occurs.

CAUSE

This error message can occur if you have included a nonalphanumeric

character in your table name. Examples of nonalphanumeric characters

include the colon (:) and the comma (,).

RESOLUTION

Rename the table, making sure not to include any nonalphanumeric

characters in the table name.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

If the export table name you create in the File Name box of the Export

to File dialog box contains any nonalphanumeric characters, Microsoft

Access tries to create a filename with these characters and causes an

MS-DOS error. This error occurs when you are exporting to any data

destination that creates an MS-DOS filename for the table.

Steps to Reproduce Behavior

---------------------------

NOTE: Changing the data destination in step 3 below to something other

than Text (Delimited) may cause the error message to not occur.

1. Copy the Employees table in the sample database NWIND.MDB to a

   table named Empl,Nwind (note the comma in the table name). The

   steps to copy a table are as follows:

   a. Select the Employees table in the Database window.

   b. From the Edit menu, choose Copy.

   c. From the Edit menu, choose Paste. Type the new table name

      in the Paste Table As dialog box, and then choose OK.

2. From the File menu, choose Export.

3. Select Text (Delimited) as the Data Destination.

4. In the Select Microsoft Access Object dialog box, select the

   Empl,Nwind table and then choose OK.

The following error message appears:

      Microsoft Access

      Out of Memory

Additional reference words: 1.00 1.10 import paradox excel fixed


INF: Two Methods to Refer to a Field in a Previous Record

 Article Number: Q101081

 CREATED: 04-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Sometimes a field in a previous record must be referred to in a later

record, such as in a checkbook program or a mileage log. This article

explains how to refer to such a record.

NOTE: The procedures provided require a unique, sequential, numeric

field, such as a Counter field or a transaction number.

MORE INFORMATION

This section provides two sets of examples for database objects

(forms, reports, and queries): one using the DLookup() function, the

other using the sample database NWIND.MDB.

DLookup() Function Examples

---------------------------

Use the DLookup() function for the following database objects, as in

the following examples:

In a Form

---------

Type the following in the ControlSource of the text box:

   =DLookUp("[Field]","Table","[ID]=Forms![Form1]![ID]-1")

In a Report

-----------

Type the following in the ControlSource of the text box:

   =DLookUp("[Field]","Table","[ID]=Reports![Report1]![ID]-1")

In a Query

----------

Type the following in the Field row of the query grid:

   Expr1: DLookUp("[Field1]","Table","[ID]=|[ID]|"&-1)

The "-1" indicates the previous record. This number can be changed to

reference a different record.

Northwind Traders Examples

--------------------------

The following examples use the sample database NWIND.MDB:

In a Form

---------

1. Create a blank form based on the Suppliers table.

2. Add the Supplier ID and Company Name fields.

3. Create an unbound text box.

NOTE: In the following sample code, an underscore (_) is used as a

line-continuation character. Remove the underscore when re-creating

this code in Access Basic.

   Form:  Form1

   ------------

   RecordSource: Suppliers

   Form1 Controls

   --------------

   Text Box:

      ControlName: Supplier ID

      ControlSource: Supplier ID

   Text Box:

      ControlName: Company Name

      ControlSource: Company Name

   Text Box:

      ControlName: Field2

      ControlSource:

         =DLookUp("[Company Name]","Suppliers","[Supplier ID] = _

          Forms![Form1]![Supplier ID]-1")

In a Report

-----------

1. Create a blank report based on the Suppliers table.

2. Add the Supplier ID and Company Name fields.

3. Create an unbound text box.

   Report:  Report1

   ----------------

   RecordSource: Suppliers

   Report1 Controls

   ----------------

   Text Box:

      ControlName: Supplier ID

      ControlSource: Supplier ID

   Text Box:

      ControlName: Company Name

      ControlSource: Company Name

   Text Box:

      ControlName: Field2

      ControlSource:

         =DLookUp("[Company Name]","Suppliers","[Supplier ID] = _

          Reports![Report1]![Supplier ID]-1")

In a Query

----------

1. Create a new query.

2. Add the Suppliers table.

   Query: Query1

   -------------

   Type: Select Query

   Field: Supplier ID

   Field: Company Name

   Field: Expr1: DLookUp("[Company Name]","Suppliers","[Supplier ID] = _

                  |[Supplier ID]|"&-1)

Additional reference words: 1.00 1.10 2.00 next


INF: How to Requery a Combo Box on Subform

 Article Number: Q101082

 CREATED: 04-JUL-1993

 MODIFIED: 15-NOV-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SUMMARY

This article describes a macro that will requery a combo box control

on a subform. This macro is useful for a combo box that is based on a

query that references the main form and thus should be requeried

whenever you change records on the main form.

MORE INFORMATION

The following sample macro will requery the combo box:

   Macro Name     Action          Defined Below

   --------------------------------------------

   RequeryCombo   GoToControl     1

                  GotoControl     2

                  Requery         3

   RequeryCombo Actions

   -----------------------------------------

   1. GotoControl

         ControlName: <Subform ControlName>

   2. GotoControl

         ControlName: <ComboBox ControlName>

   3. Requery

         ControlName: <ComboBox ControlName>

When this macro is run, it will requery the combo box. If you want the

combo box to be requeried each time you change records in the main

form, add this macro to the OnCurrent property of the main form.

REFERENCES

==========

For more information on form events, search for "events" then "events

for forms" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 macros forms


INF: Storing SQL Database Login IDs and Passwords Locally

 Article Number: Q101084

 CREATED: 04-JUL-1993

 MODIFIED: 26-OCT-1993

 VERSION(S): 1.00 1.10

--------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SUMMARY

Storing SQL database login IDs and passwords locally requires that the

database administrator create a unique table on the server.

MORE INFORMATION

In Microsoft Access version 1.0, if you attach a SQL database table,

you can choose whether you want Microsoft Access to store your login

ID and password locally. If you do not, Microsoft Access prompts you

for your login ID and password each time you connect to the SQL

database containing the table.

If you want Microsoft Access to store the connection information in

your Microsoft Access database so you do not have to type it each time,

you can select the Save Login ID and Password Locally check box in the

Attach Tables dialog box when you attach the SQL database table.

This feature is also present in Microsoft Access version 1.1. For

Microsoft SQL Server, Sybase SQL Server, and ORACLE Server databases,

however, your SQL database administrator can now choose to disable

this feature, requiring all users to enter their login IDs and

passwords each time they connect to a SQL database.

To disable the ability to store login IDs and passwords locally, your

SQL database administrator must create a table called MSysConf in the

SQL database. When a user connects to the SQL database, Microsoft

Access looks for this table in the database and, if it finds it,

queries the table. If the values in the table correctly specify that

local storing of login IDs and passwords should be disabled, Microsoft

Access does so regardless of whether the Save Login ID and Password

Locally check box is selected. If the table is not present or does not

specify disabling of the feature, users can store login IDs and

passwords locally.

The SQL database table MSysConf should have the following structure.

Column name   Data type                                 Allows Null?

====================================================================

Config        A data type that corresponds to a         No

              2-byte integer

chValue       VARCHAR(255)                              Yes

nValue        A data type that corresponds to a

              4-byte integer                            Yes

Comment       VARCHAR(255)                              Yes

If the data source you are working with is case-sensitive, use the

table and column names exactly as shown. All users must have

permission to use the SELECT statement on this table and only the

system administrator can have permission to use the DELETE statement

on this table.

In Oracle, there are a few things that are different. For instance,

the word 'Comment' is reserved in Oracle so you will need to change

it to 'Comments'. The other change relates to a difference in

data types. Here is how the table would appear in an Oracle database:

CONFIG          NUM(4,0)         NOT NULL

CHVALUE         VARCHAR(255)

NVALUE          NUM(5,0)*

COMMENTS        VARCHAR(255)

* Nvalue can have a precision of up to Num(9,0).

For the purpose of disabling password and login ID storage, the table

must contain only one row, defined as follows.

Column name     Value    Explanation

===================================================================

Config          101      This is the only valid value for Microsoft

                         Access version 1.1.

chValue         NULL     This is reserved for future use.

nValue          0 or 1   Use 0 to prevent the password and login ID

                         from being stored; use 1 to permit

                         password and login ID storage as in

                         version 1.0. The default is 1.

Comment                  Allow storage of passwords and login IDs in

                         Microsoft Access.

Additional reference words: 1.00 1.10


PRA: Cannot Include Comma in App Name Using SetupWizard
PRA: Cannot Include Comma in App Name Using SetupWizard [B_WAccADK]

 Article Number: Q101085

 CREATED: 04-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

When you run a Setup program developed using the Microsoft Access

SetupWizard, the Program Manager group and icon text is truncated and

the custom icon does not display.

CAUSE

When prompted for the name of your application, you typed a name that

included a comma. The Program Manager group and icon text displays

everything up to, but not including, the comma.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft Access

Distribution Kit version 1.1. This problem no longer occurs in the

Microsoft Access Developer's Toolkit version 2.0.

Steps to Reproduce Problem

--------------------------

1. Run the Microsoft Access SetupWizard.

2. When the "What is the name of your application?" message appears,

   type the following:

      Thomas, Rolm, Buchannan

3. Finish running the SetupWizard.

4. Run your custom Setup program.

   Only "Thomas" appears in the new Program Manager group name and

   icon text.

Additional reference words: 1.10 ADK setup wizard


PRB: Cannot DDEPoke More Than 255 Characters of Text

 Article Number: Q101087

 CREATED: 04-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

When an Access Basic function uses the DDEPoke statement to send data

to another application, Microsoft Access will not send more than 255

characters. Any data beyond the 255th character will not be sent. No

error message will be generated.

RESOLUTION

Although the DDEPoke statement will not send more than 255 characters,

you may be able to use the DDESend() function instead.  The DDESend()

function, which can only be used from the ControlSource property of a

text box on a form, is capable of sending more than 255 characters.

The following example demonstrates how to use the DDESend() function

to send characters to Microsoft Word for Windows.

1. Start Microsoft Word for Windows. Word for Windows will open with

   an empty document named Document1.

2. From the File menu, choose Save As, and then enter DOC1 as the file

   name.

3. From the Insert menu, choose Bookmark, and type "test" (without the

   quotation marks) in the Bookmark Name box.

4. Start Microsoft Access, leaving Word for Windows running, and

   create a blank, unbound form with a text box.

5. Type the following expression in the text box ControlSource

   property:

   NOTE: In the following sample code, an underscore (_) is used as a

   line-continuation character. Remove the underscore when re-creating

   this code in Access Basic.

      =DDESend("winword","doc1","test",String$(255,"*") &_

      String$(100,"@"))

6. View the form. If you switch back to Word for Windows you will see

   255 asterisk (*) characters, followed by 100 at sign (@)

   characters.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version

2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Word for Windows 2.0. Word for Windows will open with

   an empty document named Document1.

2. From the File menu, choose Save As, and then enter DOC1 as the file

   name.

3. From the Insert menu, choose Bookmark, and type "test" (without the

   quotation marks) in the Bookmark Name box.

4. Start Microsoft Access, leaving Word for Windows running.

5. Create a new database, and create a new Access module.

6. Add the following function to the module:

      Option Explicit

      Function DDEPokeTest ()

         Dim chan

         chan = DDEInitiate("winword", "doc1")

         DDEPoke chan, "test", String$(255, "*") & String$(100, "@")

         DDETerminate chan

      End Function

7. From the View menu, choose Immediate Window.

8. Type the following, and then press ENTER:

      ? DDEPokeTest()

9. Switch back to Word for Windows and note that only 255 asterisk (*)

   characters display. The at sign (@) characters do not display.

Additional reference words: 1.00 1.10


PRB: Domain Param. of Domain Function Cannot Be SQL Exp.

 Article Number: Q101088

 CREATED: 04-JUL-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SYMPTOMS

If you try to use an SQL SELECT statement as the domain

parameter of a

domain function, error 3078 is displayed:

   Couldn't find input table or query <SQL string>

where <SQL string> is the SQL string you have entered, such

as the

following:

   Couldn't find input table or query "Select * From Table1

Where ID =

   1"

RESOLUTION

Microsoft Access "Language Reference," versions 1.0 and 1.1,

and

Microsoft Access Help version 1.0 incorrectly suggest that

the domain

parameter of a domain function (for example, the DLookup(),

DFirst(),

DLast(), DSum(), DMax(), DMin(), and DCount() functions) can

be an SQL

expression.

The following is the incorrect description of the domain

parameter:

   String expression identifying the records that constitute

the

   domain. It can be a table name, a query name, or an SQL

   expression that returns data.

The correct wording is provided in Microsoft Access Help

version 1.1.

The following is the correct description of the domain

parameter:

   String expression identifying the records that constitute

the

   domain. It can be a table name or a query name.

Additional reference words: 1.00 1.10 domain parameter


PRB: Do Not Have Permissions to Modify Secured Report

 Article Number: Q101089

 CREATED: 04-JUL-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

SYMPTOMS

When you are trying to print a secured report, you receive the error

message "You don't have permissions to modify <report name>."

CAUSE

This problem will occur if a person other than the application's

creator attempts to preview the secured report using a different

default printer than the default printer that was in use when the

application was created.

RESOLUTION

Create the following macro and add it to OnClose property of the

report:

   Macro Name      Action    Argument

   ----------------------------------

   Secured Report  SendKeys  {ESC}

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

NOTE: To reproduce this error you need to have a database with

security already implemented.

 1. Log into Microsoft Access as any user other than Admin.

 2. Create a new database.

 3. Import the Employees table from the sample database NWIND.MDB.

 4. Use the ReportWizard to create a new report based on this table.

    Save the report as Report1.

 5. Create an AUTOEXEC macro with the following actions/arguments:

       Action      Argument   View

       ------------------------------------

       OpenReport  Report1    Print Preview

 6. Assign execute permissions to the report for all groups and

    users.

 7. Quit Microsoft Access.

 8. In the Microsoft Windows Control Panel, select a different printer

    for your default printer than what is currently selected.

 9. Start Microsoft Access, and then log in as a different user than the

    one who created the report.

10. Open the database created in step 2. The report will open in

    preview mode.

11. Close the report. The error will occur.

Additional reference words: 1.00 1.10


PRB: NWIND Order Form Updates Order Amount Field with Zero

 Article Number: Q101090

 CREATED: 04-JUL-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The Order Amount field in the Orders table is incorrectly set to zero.

CAUSE

The Orders.Write Order Amount macro writes the order subtotal,

calculated in the subform footer, to the Order Amount field in the

Orders table before the order subtotal has finished calculating.

The order subtotal is calculated using the Sum() aggregate function,

which runs asynchronously (or, independently) of other actions

on the form. When a field is altered in the subform that affects this

calculation (for example, the Quantity field), the AfterUpdate event

for the subform executes the Orders.Write Order Amount macro. This

macro executes before the new order subtotal can be calculated. As a

result, the macro incorrectly updates the Subtotal field in the table.

RESOLUTION

The Order Subtotal field in the subform footer cannot be relied on to

calculate the correct order subtotal, since it is being calculated

independently of other events occurring on the form. Instead, the

value should be calculated using the DSum() aggregate function in the

Orders.Write Order Amount macro. This result can be written to the

Order Amount field in the Orders table.

MORE INFORMATION

This change has already been made to the sample database NWIND.MDB

that ships with Microsoft Access version 1.1. Following the "Steps

to Reproduce Behavior" section is a description of changes that must

be made to version 1.0 of the sample database NWIND.MDB to correct

this problem. There are additional suggestions to optimize the Orders

form for both versions 1.0 and 1.1.

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB supplied with Microsoft Access

   version 1.0.

2. Open the Orders form in Form view.

3. Change the Quantity field for one of the products listed in the

   Orders Subform. (Note the Order ID of the order that you are

   changing.)

4. Open the Orders table and find the record with the same Order ID.

   Result: The Order Amount field is set to zero.

Using DSum() Function to Correctly Calculate Order Subtotal

-----------------------------------------------------------

The following steps describe how to change the Orders form in

Microsoft Access version 1.0 to implement the DSum() function:

NOTE: The sample database ORDENTRY.MDB supplied with Microsoft Access

uses the same technique to calculate the order subtotal. Please see

the FrmOrders.Recalc macro in ORDENTRY.MDB for more information.

1. Open the Orders macro in Design view.

2. Find the SetValue action for the Write Order Amount macro group.

3. Change the expression argument from

      Forms![Orders]![Orders Subform].Form![Order Subtotal]

   to

      DSum("[Extended Price]","[Order Details2]","[Order ID] =

      Forms![Orders]![Order ID]")

4. Save the macro.

----------------------------------------

Since the Orders Subtotal field in the Order Subform footer is no

longer necessary, use the following steps remove it and increase your

database performance:

1. Open the Orders Subform in Design view.

2. Remove the Orders Subtotal field from the footer.

3. Open the Orders form and select the Subtotal field. Change the

   the ControlSource property from

      =[Orders Subform].Form![Order Subtotal]

   to

      Order Amount

In Microsoft Access version 1.0, you can remove Orders.Write Order

Amount from the BeforeUpdate property of the Orders form.


PRB: SendKeys Macro Action Does Not Work on Toggle Keys

 Article Number: Q101125

 CREATED: 06-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A SendKeys macro action will not work correctly on the toggle keys

CAPS LOCK or SCROLL LOCK. You may see the CAPS LOCK or SCROLL LOCK

lights flash on the keyboard, but the lights will not remain on and

the keys will not be correctly activated after the SendKeys action is

completed. Note that SendKeys also will not work correctly with the

ALT+PRINT SCREEN key combination.

CAUSE

SendKeys keystrokes are sent to applications at a high level.

Microsoft Windows traps toggle keys and the PRINT SCREEN key at a

lower level, keeping them from your application.

RESOLUTION

There is a workaround for the CAPS LOCK problem. To force input in a

field into uppercase, set the control's Format property to ">". The

UCase() function can also be used to force entries in a field to

uppercase.

Although a SendKeys macro action cannot toggle keys, a Windows API

SetKeyboardState() function call can toggle keys. The following

example demonstrates how to use the Windows API SetKeyboardState()

function:

   Declare Sub SetKeyboardState Lib "User" (lpKeyState As Any)

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

The following SendKeys action will not toggle the CAPS LOCK key to on:

   MacroName       Action

   ----------------------

   Macro1          SendKeys

   Macro1 Actions

   --------------------------

   SendKeys

      Keystrokes:  {CAPSLOCK}

      Wait:        NO

REFERENCES

==========

Microsoft Access "Language Reference," pages 432 and 485

Additional reference words: 1.00 1.10 2.00 send key num


PRB: Echo Action Without Any Argument Causes Error

 Article Number: Q101126

 CREATED: 06-JUL-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you leave the EchoOn argument out of the Echo action in a module,

you will receive the error message "Expected: Expression."

RESOLUTION

Although the Microsoft Access Help system states that the default

argument for the Echo action is Yes, you must include the argument in

the line of code in order for the action to execute properly.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create a new module.

3. Enter the following code in the new window:

      '-----------------------------------------------------------

      'The following function will produce the syntax error stated

      'above.

      '-----------------------------------------------------------

      Function Test()

         Docmd Echo         'Note that the arguments are missing.

      End Function

REFERENCES

==========

For more information about the Echo action, search for "echo" then "echo

action" using the Microsoft Access Help menu.

Microsoft Access "Language Reference," version 1.1, pages 163-164

Additional reference words: 1.00 1.10 2.00


INF: Controlling Design Mode at Run Time to Change Properties

 Article Number: Q101308

 CREATED: 11-JUL-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

There are a number of form properties in Microsoft Access that cannot

be changed while the form is active. To work around this limitation,

you can use a macro to change the form into Design view, use SetValue

actions to change any property, and then change the form back to Datasheet

view.

MORE INFORMATION

You can change the form into Design view by using a DoMenuItem macro

action as shown below:

   MacroName   Action

   ----------------------

   Test1       DoMenuItem

   Test1 Actions

   -----------------------

   DoMenuItem

      Menu Bar: Form

      Menu Name: View

      Command: Form Design

When you use this method to change properties on a Microsoft

Access form, the following potential problems should be noted.

Problem 1

---------

When changing from Datasheet view to Design view, or from Design view

to Datasheet view, the form is in Design view yet repainting takes

place on the screen. To minimize this problem, set Echo Off before

going into Design view. Turn Echo On after forcing the form back into

Datasheet view. The following sample illustrates this method:

   MacroName   Action

   ----------------------

   Test1       DoMenuItem

               Echo

   Test2       DoMenuItem

               Echo

   Test1 Actions

   -----------------------

   DoMenuItem

      Menu Bar: Form

      Menu Name: View

      Command: Form Design

   Echo

      Echo On: No

   Test2 Actions

   ------------------

   DoMenuItem

      Menu Bar: Form

      Menu Name: View

      Command: Browse

   Echo

      Echo On: Yes

Problem 2

---------

After a property is changed, the Save Form dialog box appears. To

avoid this dialog box, set SetWarnings to Off from the form's OnClose

event. If this is done in a macro, SetWarnings will automatically be

reenabled after the form has been closed. The following sample

demonstrates this method:

1. Create a new form called "Form1" bound to the Categories table in

   the sample database NWIND.MDB with the following settings:

      Form

      --------------------------------

      Form: Form1

         Caption:  Form1

         ControlSource: Categories

         OnClose: Macro1.Onclose

      Textbox:  text box1

         ControlName:  Category ID

         ControlSource:  Category ID

      Textbox:  text box2

         ControlName:  Category Name

         ControlSource:  Category Name

      command button:  Button1

         Caption:  Filter

         OnPush:  =ChangeFilter()

      command button:  Button2

         Caption:  Close

         OnPush:  =Macro1.Close

2. Create a macro called "Macro1" with the following options:

      MacroName     Action          Defined Below

      -------------------------------------------

      OnClose       SetWarnings        1

      Close         Close              2

      1. OnClose Action

      -------------------

         Warnings On:  No

      2. Close Action

      ----------------------

         Object Type:  Form

         Object Name:  Form1

3. Add the following function to a new module:

      Function ChangeFilter ()

         DoCmd Echo False

         DoCmd DoMenuItem 0, 2, 0, 0

         Forms!Form1.AllowFilters = Not Forms!Form1.AllowFilters

         DoCmd DoMenuItem 0, 2, 1, 0

         DoCmd Echo True

      End Function

   NOTE: For development work, you may want to comment out the DoCmd

   Echo actions.

4. Close and save the form, macro, and module.

   NOTE: Before closing the form, make sure that the Field List

   window, the property sheet, and the toolbox are closed.

5. Open the form and choose Filter. Note that the filter buttons in

   the toolbar are unavailable. If you choose Filter again, the filter

   buttons in the toolbar become available.

6. Close the form by choosing Close, or by double-clicking the form's

   Control-menu box. Note that regardless of which way the form is

   closed, no Save Form dialog box appears.

Additional reference words: 1.00 1.10 flip switch browse mode


INF: Microsoft Access ADK Legal Agreement

 Article Number: Q101311

 CREATED: 11-JUL-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SUMMARY

This article provides additional information about the legal restrictions

on distributing applications developed with the Microsoft Access

Distribution Kit (ADK).

MORE INFORMATION

Pages v and vi of the Microsoft Access "Distribution Kit Guide" include

a list of provisions that define what developers may distribute:

1. You may distribute these files only as integrated within and as a

   part of your software product which operates in conjunction with

   Microsoft Access.

   Explanation: This clause means that you may distribute only the

   runtime files with your Microsoft Access application. You cannot

   purchase the ADK and then distribute individual files. This also

   applies to the ODBC disk as well.

   Example: An employee at a large company purchases the ADK. Her manager

   has accidentally removed Graph. Mary gives her manager a copy of the

   run-time Graph application that comes with the ADK. This action is a

   violation of the license agreement. Mary may ONLY distribute files as

   part of a database application.

2. Your software product does not substantially duplicate the

   capabilities of Microsoft Access or, in the reasonable opinion of

   Microsoft, compete with Microsoft Access.

   Explanation: Developers cannot use the ADK to create a database

   application to compete with Microsoft Access. However, it is alright

   for developers to create custom applications based on Microsoft

   Access. If developers believe they might be in competition with

   Microsoft Access, they should contact the Microsoft Access Product

   Manager.

   Example 1: John uses the ADK to create a form designer, report

   designer, and query grid that look almost identical to and have the

   same functionality as Microsoft Access. He then sells this application

   to users as "an inexpensive alternative to Microsoft Access." This

   would be a direct violation of the license agreement.

   Example 2: Jane works at a company that uses SQL Server extensively

   and has purchased the ADK. She designs several forms that allow the

   user to connect to various SQL servers and "query by example." She

   creates a custom Setup that includes both the ODBC Setup disk and the

   run-time Graph application. She runs an administrative Setup to a

   network drive so that anyone in the company can set up her

   application. Because her company has purchased a copy of the ADK and

   she is only distributing files as part of a database application she

   has developed, this is legal.

3. You do not use Microsoft's name, logo, or trademarks to market your

   software product.

   Explanation: This simply means that you may not use the name and logo

   of Microsoft as though your application were a Microsoft product.

   Developers can use Microsoft Access (R) if it is used properly with a

   registered trademark symbol (subject to normal trademark laws) and if

   it is used only in a description of the product.

   Developers are encouraged to inform their customers that the product

   is based on Microsoft Access. However, Microsoft cannot guarantee,

   recommend, or provide support for products developed with the ADK.

   Example: Dana has developed an application that she intends to sell to

   other developers. The front of the box in which her application is

   packaged reads as follows:

                       AX Utilities

                    Secure Screen Savers

       An Application for Use with Microsoft Access (R)

      Requires: 4 MB hard disk space (1.5 MB if you have already

      installed another application for Microsoft Access)

   Because the proper registered trademark appears and "Microsoft Access

   (R)" is included only in the description of her application, this use

   is legal under the license agreement.

4. You include a valid copyright notice on your software product.

   Explanation: A copyright notice is required before you can distribute

   a database application that you develop with the ADK.

   Example: Roger has developed a game using the ADK. He plans to post it

   on the bulletin board that he operates so that others can download it

   for free. He does tell readers that the game was developed using

   Microsoft Access (R) but does not include a copyright notice. This

   is not legal because he does not have a valid copyright notice.

5. You agree to display, if required in the software documentation,

   the designated patent notices on the packaging and in the READ file of

   your software product.

   Explanation: This is part of the standard Microsoft license agreement.

   Any items requiring a patent notice are so indicated in the product

   documentation or the product READ file.

its

REFERENCES


PRB: Cannot Open Multiple Instances of the Same Form

 Article Number: Q101312

 CREATED: 11-JUL-1993

 MODIFIED: 08-NOV-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

When you try to open a second instance of an already opened form by

using the OpenForm macro action, the currently opened form is

activated.

CAUSE

You can have only one copy of a form open at a time.

This behavior is by design. This feature is under review and will be

considered for inclusion in a future release.

RESOLUTION

The following information describes how to create and use an Access

Basic function called OpenFormInstance(), which allows you to open

more than one copy of the same form in Microsoft Access. To make

OpenFormInstance work, you must first make <x> number of copies of

your original form, giving each copy a numeric prefix greater than

zero. That is, if your form is called "Customers," make copies of the

form renaming them to "Customers1," "Customers2," "Customers3," and so

forth.

When OpenFormInstance() is invoked with "Customers," it checks to see

if a copy of the form is available for display. It returns the

following error message if all instances are currently open:

   Could not open form "Customers"

   Please close another instance and try again.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications with the programming tools

provided with Microsoft Access. For more information on Access Basic,

please refer to "Introduction to Programming" manual.

Create a new module with the following Access Basic functions:

NOTE: In the following sample code, an underscore (_) is used as a

line-continuation character. Remove the underscore when re-creating

this code in Access Basic.

'*****************************************************************

' DECLARATION SECTION

'*****************************************************************

Option Explicit

'*****************************************************************

' FUNCTION: OpenFormInstance

'

' PURPOSE:

'   Allows you to open more than one copy of the same form

'   on screen at a time.

'

' PREREQUISITES:

'   You must make X number of copies of the the interested

'   form, renaming them with a numeric prefix greater than zero.

'   Ex:

'

'        "Customers1", "Customers2", "Customers3" ...

'

' REQUIRES:

'   Function IsLoaded() - Determines if form is loaded.

'   Function GetFormNames() - Supplied in this module.

'

' ARGUMENTS:

'   FormName - The generic name of the form to open, "Customers"

'

' RETURN:

'   True  - if an instance of FormName was opened.

'   False - if no instance of FormName was found or all available

'           instances are active.

'

' NOTES:

'   You can customize the OpenForm action in the code below to add

'   additional (optional) parameters, such as a Where condition or

'   or alternate view.

'

'********************************************************************

Function OpenFormInstance (ByVal FormName As String)

   Dim Count, i, Msg As String, InstanceCount

   ReDim Names(0) As String

   ' Get a list of all the forms in the current database

   Count = GetFormNames(Names())

   ' Loop through the list of forms for a match with

   ' .. the requested form

   For i = 0 To Count - 1

      ' Is the name of the form, minus the prefix, the same?

      If FormName = Left(Names(i), Len(FormName)) Then

         ' .. AND is the prefix a number greater than zero?

         If Val(Mid(Names(i), Len(FormName) + 1)) > 0 Then

            ' Count the number of instances

            InstanceCount = InstanceCount + 1

            ' If the form is NOT loaded,load it

            If Not IsLoaded(Names(i)) Then

               DoCmd OpenForm Names(i)

               OpenFormInstance = True

               Exit Function

            End If

         End If

      End If

   Next i

   ' No form was found or all instances are being used

   OpenFormInstance = False

   ' If no instance found, just return

   If InstanceCount = 0 Then Exit Function

   ' If all instances are being used, display error message

   Msg = "Couldn't open form """ & FormName & """."

   Msg = Msg & Chr$(13) & Chr$(13)

   Msg = Msg & "Please close another instance and try again."

   MsgBox Msg, 48

End Function

'****************************************************************

' FUNCTION: GetFormNames

'

' PURPOSE:

'   Fills the string array with a list of forms names

'

' ARGUMENTS:

'    Names      - A single dimensional array of type string

'

' RETURN:

'   The number(zero based) of names stored in the Names array.

'

' NOTES:

'   This function utilizes information stored in the

'   MySysObject table of the currently opened user database.

'   The system tables are undocumented and are subject to

'   change in future versions of Access.

'

'****************************************************************

Function GetFormNames (Names() As String)

   Dim db As Database, ss As Snapshot

   Dim Count, SQL

   Dim Msg As String

   SQL = "Select Name,Type from MSysObjects Where Type="

   SQL = SQL & "-32768 And Left(Name,1)<>'~' Order By Name;"

   Set db = CurrentDB()

   Set ss = db.CreateSnapshot(SQL)

   ss.MoveLast

   If ss.RecordCount > 0 Then

      ReDim Names(0 To ss.RecordCount - 1)

   Else

      GetFormNames = 0

      Exit Function

   End If

   ss.MoveFirst

   Count = 0

   Do While Not ss.EOF

      Names(Count) = ss![name]

      Count = Count + 1

      ss.MoveNext

   Loop

   GetFormNames = ss.RecordCount

End Function

How to Use the OpenFormInstance() Function

------------------------------------------

The following steps assume there is a need to see more than one

customer form on the screen at a given time in the sample database

NWIND.MDB.

1. Open NWIND.MDB and choose the Form button in the Database window.

2. Click, 1 time, on the Customers form, and choose Copy from the Edit

   menu.

3. Choose Paste from the Edit menu. Type "Customers1" (without the

   quotation marks) in the Form Name box and then press ENTER.

4. Repeat step 3 for however many instances you expect your users to

   need ("Customers2," "Customers3," and so on).

5. Open the module with the OpenFormInstance() function in Design view

   and choose Immediate Window from the View menu.

6. Type the following and press ENTER:

      ? OpenFormInstance("Customers")

   NOTE: The first instance of the Customers form opens.

7. Place your cursor on the previously typed line and press ENTER.

   NOTE: The second instance of the Customers form opens.

8. Repeat step 7 until you receive an error message indicating that no

   more instances are available.

Problems to Consider When Using OpenFormInstance()

--------------------------------------------------

Since you are not actually opening the same form multiple times (you

are opening copies), it is important that any macros and module code

that make direct references to the form using "Forms!FormName"

references be reconsidered.

If you have more than one instance of the form opened, it is best to

use the following techniques when you reference controls on the form.

1. User Screen.ActiveForm form notation wherever possible.

      MsgBox Screen.ActiveForm![ControlName]

2. When Screen.Active form is not appropriate, pass the name of the

   form to the Access Basic function to call.

      Function MyFunction(MyForm)

         MsgBox Forms(MyForm)![ControlName]

      End Function

3. Since you cannot pass arguments to macros, consider reworking the

   macro as an Access Basic function. You could call the function above,

   MyFunction(), using a RunCode macro action as follows:

      RunCode

         Function Name: =MyFunction(Screen.ActiveForm.FormName)

MORE INFORMATION

For more information on referring to form and control objects, see

Chapter 7, "Forms and Report Variables," in the "Introduction to

Programming Guide."

Additional reference words: 1.00 1.10


INF: Using Microsoft Access as a DDE Server

 Article Number: Q101313

 CREATED: 11-JUL-1993

 MODIFIED: 11-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SUMMARY

Microsoft Access supports dynamic data exchange (DDE) as both a

destination (client) application and a source (server) application.

This article documents the DDE topics that Microsoft Access supports

as a DDE server and the valid DDE items for each topic.

NOTE: In this article, an asterisk (*) indicates a new feature in

Microsoft Access version 1.1.

The examples below require that you have the sample database NWIND.MDB

open in Microsoft Access.

MORE INFORMATION

As a DDE server, Microsoft Access supports the following topics:

 - The System topic

 - The name of a database, table, or query

 - A Microsoft Access SQL statement

The System Topic

----------------

The System topic is a standard topic for all Microsoft Windows-based

DDE server applications and returns information about the topics

supported by the application. The System topic supports the following

Microsoft Access data items:

    SysItems  - A list of items supported by the System topic in

                Microsoft Access

    Formats   - A list of formats Microsoft Access can copy to the

                Clipboard

    Status    - "Busy" or "Ready"

    Topics    - A list of all open databases

Information returned from any item used with the System topic is

tab delimited, Chr$(9).

The following Microsoft Word for Windows WordBasic macro demonstrates

how to use the System topic to get information on available topics

from Microsoft Access:

   Chan = DDEInitiate("MSAccess", "System")

   Topics$ = DDERequest$(Chan, "Topics")

   DDETerminate Chan

   MsgBox Topics$, "Topics", 64

The Database Topic

------------------

The database topic is the filename of an existing database. After you

initiate a DDE conversation with the database, you can request a list

of objects in that database. This list of information is tab

delimited, Chr$(9).

NOTE: You cannot query the SYSTEM.MDB file using DDE.

The database topic supports the following items:

   TableList

   QueryList

   FormList

   ReportList

   MacroList

   ModuleList

The following WordBasic macro demonstrates how to retrieve a list of

table names:

   Chan = DDEInitiate("MSAccess", "NWIND")

   TableList$ = DDERequest$(Chan, "TableList")

   DDETerminate Chan

The TABLE TableName, QUERY QueryName, and SQL SqlString Topics

--------------------------------------------------------------

The TABLE, QUERY, and SQL DDE topics are used to retrieve information

from Microsoft Access tables. This list is tab-delimited, Chr$(9).

The syntax for these topics is as follows:

   <DatabaseName>; TABLE <TableName>

   <DatabaseName>; QUERY <QueryName>

   <DatabaseName>; SQL <SqlString>

Description of Syntax:

   <DatabaseName>   The name of the database to which the table or query

                    belongs or the SQL statement applies, followed by

                    a semicolon (;). The database name can be either the

                    base name only (for example, NWIND) or its full path

                    and .MDB extension (for example, C:\ACCESS\NWIND.MDB).

   <TableName>      The name of an existing table.

   <QueryName>      The name of an existing query.

   <SqlString>      A valid SQL statement up to 255 characters,

                    followed by a semicolon.

   *NOTE: You can exchange more than 255 characters by omitting this

   argument and using successive DDEPoke() statements to build an SQL

   statement.

   For example, the following WordBasic code uses the DDEPoke()

   function to build an SQL statement and request the results of the

   query:

      Chan = DDEInitiate("MSAccess", "NWIND;SQL")

      DDEPoke Chan, "SQLText", "SELECT * FROM Orders "

      DDEPoke Chan, "SQLText", "WHERE [Order Amount] > 1000;"

      Results = DDERequest$(Chan, "Data")

      DDETerminate Chan

The following is a list of valid DDE items for the TABLE TableName,

QUERY QueryName, and SQL SqlString DDE topics:

   All              All data in the table, including field names.

   Data             All rows of data, without field names.

   *FieldNames      A single-row list of field names.

   FieldNames;T     Two records of data, the first a list of field

                    names and the second a list of data types.

                    The following are the values returned and the data

                    type each value represents:

                        0    Invalid

                        1    True/False (non-NULL)

                        2    Unsigned byte (Byte)

                        3    2-byte signed integer (Integer)

                        4    4-byte signed integer (Long)

                        5    8-byte signed integer (Currency)

                        6    4-byte single-precision floating-point

(Single)

                        7    8-byte double-precision floating-point

(Double)

                        8    Date/Time (date is integer, time is fraction)

                        9    Binary data, 255-byte maximum

                       10    ANSI text, not case-sensitive, 255-byte

                             maximum (Text)

                       11    Long binary (OLE Object)

                       12    Long text (Memo)

   NextRow          The data in the next row in the table or query.

                    When you first open a channel, NextRow returns the

                    data in the first row. If the current row is the last

                    record and you execute NextRow, the request fails.

   PrevRow          The data in the previous row in the table or query. If

                    PrevRow is the first request on a new channel, the data

                    in the last row of the table or query is returned. If

                    the first record is the current row, the request for

                    PrevRow fails.

   FirstRow         The data in the first row of the table or query.

   LastRow          The data in the last row of the table or query.

   FieldCount       The number of fields in the table or query.

   *SQLText         An SQL statement representing the table or query.

                    For tables, this item returns an SQL statement in the

                    format "SELECT * FROM table;".

   *SQLText;<n>     An SQL statement in <n>-character chunks that

                    represents the table or query, where <n> is an integer

                    lower than 255. For example, suppose a query is

          represented by the following SQL statement:

                       SELECT * FROM Orders;

                    The item "SQLText;7" would return the following

                    tab-delimited chunks:

                       "SELECT "

                       "* FROM "

                       "Orders;"

The following WordBasic macro demonstrates how to get information from

the Employees table in NWIND.MDB:

    Chan1 = DDEInitiate("MSAccess", "NWIND;TABLE Employees")

    ' Get a count of the number of Employee records.

    SQL$ = "SELECT Count([Employee ID]) AS [CountOfEmployees] "

    SQL$ = SQL$ + "FROM Employees;"

    Chan2 = DDEInitiate("MSAccess", "NWIND;SQL " + SQL$)

    EmployeeCount =  Val(DDERequest$(Chan2, "FirstRow"))

    DDETerminate Chan2

    ' Quit if there are no records.

    If EmployeeCount <> 0 Then

       Msg$ = "NWIND Employee Information:"

       Msg$ = Msg$ + "       Record Count:" + Str$(EmployeeCount)

       MsgBox Msg$

       ' Request the first row of data from the Employees table.

       Data$ = DDERequest$(Chan1, "FirstRow")

       ' Display the records.

       For i = 1 To EmployeeCount

           MsgBox Data$

           ' Get the next row of data, if not at the end.

           If i <> EmployeeCount Then

               Data$ = DDERequest$(Chan1, "NextRow")

           End If

       Next i

    End If

Executing Macros and Commands in Microsoft Access Using DDE

-----------------------------------------------------------

When you are using Microsoft Access as a DDE server, you can use the

DDEExecute() function to instruct your application to execute a

command. Microsoft Access recognizes any of the following valid

commands:

 - The name of a macro in the database that is currently open. A macro

   can be executed on a channel with any of the five topics described

   above.

*- Any action that you can execute in Access Basic using the DoCmd()

   statement. You cannot execute the following macro actions: AddMenu,

   MsgBox, RunApp, RunCode, SendKeys, SetValue, StopAllMacros,

   and StopMacro.

*- The OpenDatabase and CloseDatabase actions, executed only for DDE

   operations using the System topic.

NOTE: When you specify an action as a DDEExecute command, the action

and any arguments follow the DoCmd() syntax and must be enclosed in

brackets ([]). However, applications that support DDE do not recognize

intrinsic constants, such as A_NORMAL, in DDE operations. Therefore,

you must use the actual number as an argument. Also, string arguments

must be enclosed in quotation marks only if the string contains a

comma. Otherwise, quotation marks are not required.

The following macro opens the Categories form, first minimized and

then restored:

   Chan = DDEInitiate("MSACCESS", "System")

   AppActivate "Microsoft Access"

   DDEExecute Chan, "[OpenForm Categories,,,,,2]"

   DDEExecute Chan, "[OpenForm Categories]"

   DDETerminate Chan

*Using the OpenDatabase and CloseDatabase Commands

--------------------------------------------------

Microsoft Access 1.1 introduces some new commands that can be executed

on a channel opened to the System topic. These commands facilitate the

remote opening and closing of databases in Microsoft Access from the

client application.

 - OpenDatabase DatabaseName [, Exclusive[, ReadOnly]]

 - CloseDatabase

   DatabaseName     A string expression that is the name of an existing

                    database. This can include the fully qualified

                    MS-DOS path.

   Exclusive        A Boolean value that is True (-1) if the database is to

                    be opened with exclusive (nonshared) access and False

                    (0) if the database is to be opened with shared access.

                    The default is shared access.

   ReadOnly         A Boolean value that is True if the database is to be

                    opened with read-only access and False if it is to be

                    opened with read/write access. The default is

                    read/write access.

The following WordBasic macro demonstrates how to use the OpenDatabase

actions to remotely open NWIND.MDB and then open the Employees form:

   Chan = DDEInitiate("MSACCESS", "System")

   DDEExecute Chan, "[OpenDatabase NWIND.MDB]"

   DDEExecute Chan, "[OpenForm Employees,0,,,1,0]"

   DDETerminate Chan

REFERENCES

==========

Microsoft Access "User's Guide," Chapters 9 and 13

README.TXT for Microsoft Access version 1.0

For more information on using DDE with Microsoft Access, query on the

following words here in the Microsoft Knowledge Base

   dde and <the name of the other application in the conversation>

or search for "DDE" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 container


PRB: "Maximum Size Reached" Error Attempting to Import File

 Article Number: Q101316

 CREATED: 11-JUL-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SYMPTOMS

You receive the error message "Maximum size reached" when

you attempt to

import a file that increases your .MDB file size to larger

than 128

megabytes (MB), or 131,072,000 bytes.

CAUSE

Although Microsoft Access version 1.1 can support databases

up to 1

gigabyte (GB), Microsoft Access version 1.0 supports

databases only up

to 128 MB. If your .MDB file is in Microsoft Access version

1.0 format

and you use it in Microsoft Access version 1.1, and then try

to import

data that increases your database size to larger than 128

MB, the

"Maximum size reached" error message is displayed.

This error occurs because your database is still subject to

the 128-MB

maximum size in Microsoft Access version 1.0.

This situation typically occurs when you upgrade from

Microsoft Access

version 1.0 to version 1.1 and continue to use databases

originally

created in version 1.0, without converting the files to

version 1.1

format.

RESOLUTION

To correct this problem, use the following procedure to

compact your

version 1.0 database file and convert it to version 1.1

format, which

supports .MDB files up to 1 GB:

1. From the File menu, choose Compact Database.

2. Select the database you want to convert, and then choose

OK.

3. In the File Name box, type the name of the database file.

4. In the List Files Of Type box, choose Access V1.1

(*.mdb), and then

   choose OK.

5. When you are prompted Replace Existing File?, choose Yes.

Additional reference words: 1.00 1.10 Import/Export file


INF: How to Use DDE to Communicate with a Run-Time Application

 Article Number: Q101318

 CREATED: 11-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

 - Microsoft Access Developer's Toolkit version 2.0

---------------------------------------------------------------------

SUMMARY

Run-time applications developed with Microsoft Access have the same

dynamic data exchange (DDE) server capabilities as applications in the

retail version of Microsoft Access.

However, in order to communicate with a run-time application using

DDE, you must use the name of the .MDB file, instead of "MSACCESS",

when initiating a DDE conversation.

MORE INFORMATION

The following example demonstrates how to communicate with a run-time

application developed with Microsoft Access:

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. Choose the Macro button and select the Sample Autoexec macro.

3. From the File menu, choose Rename. In the Macro Name box, type

   "Autoexec" (without the quotation marks) and then press ENTER.

4. Quit Microsoft Access.

5. From the File menu in the Microsoft Windows Program Manager, choose

   Run.

6. Type "c:\access\msarn110.exe nwind.mdb" (without the quotation

   marks), and then press ENTER.

7. Start Microsoft Access, and create or open a database other than

   NWIND.MDB.

8. Create or open a module and add the following Access Basic

   function:

      Option Explicit

         Function DDEWithNWIND ()

             Dim chan

             chan = DDEInitiate("NWIND", "NWIND;TABLE Employees")

             MsgBox DDERequest(chan, "FirstRow")

             DDETerminate chan

         End Function

   Note that the first argument specified in the DDEInitiate command, the

   application name, is "NWIND", which is the name of the .MDB file, and

   not "MSACCESS."

9. From the View menu, choose Immediate Window. Type the following,

   and then press ENTER:

      ? DDEWithNWIND()

A message box will display the first record from the Employees table

in the NWIND.MDB database.

REFERENCES

==========

For more information on using Microsoft Access as a DDE server, query

on the following words here in the Microsoft Knowledge Base:

   DDE and server

Additional reference words: 1.10 2.00 ADK


PRB: "Unexpected Error from External Database Driver [22]"

 Article Number: Q101319

 CREATED: 11-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.1 and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you try to open an attached Btrieve table, you receive the

following error message:

  Unexpected error from external database driver [22]

CAUSE

Btrieve returns this error message when there is a mismatch between

the FIELD.DDF file and the Btrieve data table. This problem usually

occurs when the internal structure of the Btrieve table has been

changed without corresponding changes having been made to the

FIELD.DDF file. The Xtrieve manual lists this error with the following

description:

   22  Data buffer length too short

       The data buffer parameter is not long enough to accommodate the

       length of the data record defined when the file was created.

       Verify that the length of the data buffer is at least as long

       as the file's defined record length.

RESOLUTION

Make sure that the internal structural definition of the Btrieve table

is the same as the FIELD.DDF file. This can be done using Novell's

Xtrieve program or a third-party DDF builder to update the FIELD.DDF

file.

MORE INFORMATION

Btrieve is manufactured by Novell, a vendor independent of Microsoft;

we make no warranty, implied or otherwise, regarding this product's

performance or reliability.

REFERENCES

==========

For a complete list of Xtrieve error messages, refer to the Novell

Xtrieve manual, Appendix A.

Additional reference words: 1.10 2.00


PRB: Cannot Auto Update an OLE-Linked Object in a Table

 Article Number: Q101320

 CREATED: 11-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The Auto Update check box is unavailable in the Edit Paste Special

dialog box when you are attempting to paste link an OLE object.

CAUSE

You cannot paste link an object into an OLE-object field in a table in

Microsoft Access and specify that the link be "hot," or automatically

updated.

You can place linked OLE objects on forms and reports when they are

in Design view. If you paste a link to an OLE object into a form or

report in Design view, the Auto Update check box will be available.

RESOLUTION

One workaround is to force Microsoft Access to update the OLE-linked

field by selecting the object to update, choosing Object from the Edit

menu, and then selecting Update.

This process can be automated using the Access Basic UpdateOLE()

function listed below, which can be assigned to a button on the form

or to the OnCurrent property of the form. If it is assigned to the

OnCurrent property, Microsoft Access will automatically perform the

macro whenever you select a different record. This will ensure that

the data in the selected record will always be current, effectively

simulating auto updating.

Create a new module with the following declarations and UpdateOLE()

function:

   '****************************************************************

   ' DECLARATIONS SECTION

   '****************************************************************

   Option Explicit

   '****************************************************************

   ' FUNCTION: UpdateOLE

   '

   ' PURPOSE: Automates updating an OLE-linked field.

   '

   ' ARGUMENTS:

   '    FieldName - A string with the name of the field to update.

   '

   ' EXAMPLE USAGE:

   '    The OnPush property for a button could be set to:

   '       =UpdateOLE("OLEField")

   '

   ' SIDE EFFECTS:

   '    Focus will be left on the OLE-object field.

   '    The record will be put in Edit Mode.

   '

   '****************************************************************

   Function UpdateOLE (ByVal FieldName As String)

      On Error GoTo ErrUpdateOLE

      DoCmd GoToControl FieldName

      DoCmd DoMenuItem A_FORMBAR, A_EDITMENU, A_OBJECT, A_OBJECTUPDATE

   ByeUpdateOLE:

      Exit Function

   ErrUpdateOLE:

      Resume ByeUpdateOLE

   End Function

Using the UpdateOLE() Function

------------------------------

You can use the UpdateOLE() function by assigning it to a button on

the form or to the OnCurrent property of the form. If performance is a

problem when you are using the OnCurrent solution, the button approach

allows you to decide when the data should be refreshed.

For a linked OLE field named "OLEField" on your form, set the OnPush

property of the button or the OnCurrent property for the form to the

following:

   =UpdateOLE("OLEField")

If you have multiple OLE-linked fields you can create a macro to call

UpdateOLE() for each OLE field on the form.

For three linked OLE fields on a form named "OLEField1", "OLEField2", and

"OLEField3", create the following macro and save it with the name

"UpdateAllOLEFields"

   Action           Argument

   -------------------------------------------------------

   RunCode          Function Name: =UpdateOLE("OLEField1")

   RunCode          Function Name: =UpdateOLE("OLEField2")

   RunCode          Function Name: =UpdateOLE("OLEField3")

then set the OnPush property of the button or the OnCurrent property

of the form to the following:

   UpdateALLOLEFields

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Hot linking, or automatically updating an OLE object, requires a

significant number of system resources. Large numbers of hot-linked

OLE linked objects can cause out of memory or other system errors.

However, Auto Update is available to unbound OLE objects inserted in a

form or report in Design view. This is because the number of objects

inserted in a form is generally minimal.

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Excel.

2. In cell A1, type "123" (without the quotation marks), and press

   ENTER.

3. Select the cell and choose Copy from the Edit menu.

4. Switch to or start Microsoft Access and create a table that has a

   field with the datatype set to "OLE Object".

5. Create a new, blank form, based on the table created in step 4.

6. From the View menu, choose Field List.

7. Drag the OLE field from the Field List window to the middle of the

   blank form.

8. From the View menu, choose Form.

9. Select the OLE field, and then choose Paste Special from the Edit

   menu.

"Microsoft Excel Worksheet Object" will appear in the Data Type box,

and the Paste and Paste Link buttons will be available, but the Auto

Update check box will be unavailable.

Additional reference words: 1.00 1.10 greyed grayed dimmed checkbox


PRB: Cannot Set Focus to Any Object Except MS Access Menu

 Article Number: Q101321

 CREATED: 11-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

One of the following two conditions occur:

 - You can select only the Microsoft Access menu. All other objects appear

   normal, but you cannot select them.

   -or-

 - Your application has stopped on a breakpoint that you set in an

   Access Basic function, but you cannot use the indicator to set the

   focus to the Module window.

CAUSE

Your code has executed an Echo action and turned the echo off. You

need to turn the echo back on by setting Echo On to Yes (the default).

RESOLUTION

To correct this problem, you need to complete one of the following

tasks:

 - Correct the logic of your program.

   -or-

 - Add a key assignment in your Key Assignment macro.

   NOTE: By default, the Key Assignment macro is set to the AutoKeys

   macro.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create the following function:

      Function FunctionThatAppearsHung()

         DoCmd Echo False

         Debug.Print i

         DoCmd Echo True

      End Function

2. Using the F8 key, set a breakpoint on the following line:

      Debug.Print i

3. From the Immediate window, run the function. The following error

   occurs:

      ?FunctionThatAppearsHung()

4. To give control back to Microsoft Access, either quit Microsoft

   Access or define the AutoKeys macro as follows and press F12:

      MacroName    Action    Arguments

      --------------------------------

      {F12}        Echo      On

Additional reference words: 1.00 1.10 2.00 macro marco AutoKeys


PRA: GP Fault with MS Packager Object in Bound OLE Field

 Article Number: Q101322

 CREATED: 11-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A general protection (GP) fault may occur when you attempt to insert

or update Microsoft Packager objects in a bound OLE field in Microsoft

Access.

CAUSE

During the cleanup process when you quit Microsoft Packager, the

program inappropriately frees memory blocks that it does not own. This

memory block, which is still being used by OLE, is made available to

other applications.

If another application begins using this memory block, OLE and the

other application may write information to the same memory location,

overwriting each other's information. This conflict may eventually

result in a GP fault.

RESOLUTION

A corrected version of Microsoft Packager has been created to work

around this problem. This patch, PACKPT.EXE, is a self-extracting

zipped file and is available both in the Microsoft Access section of

the Microsoft Download Service (MSDL) and in the OLE/DDE section of

the Microsoft Access forum on CompuServe.

You can reach the MSDL by calling (206) 936-6735. You can reach the

Microsoft Access forum on CompuServe by typing "go msaccess" from any

CompuServe exclamation point (!) prompt.

NOTE: To install PACKPT.EXE, copy this file to a new directory and

run PACKPT.EXE at the DOS command prompt. The files README.TXT and

PACKAGER.EXE are extracted automatically. PACKAGER.EXE should be

copied to your Windows directory.

WARNING: MICROSOFT PROVIDES THIS PATCH "AS IS" WITHOUT WARRANTY OF ANY

KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE

IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR

PURPOSE. The user assumes the entire risk as to the accuracy and use

of this information.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Packager. We

are researching this problem and will post new information here in the

Microsoft Knowledge Base as it becomes available.

Additional reference words: 1.00 1.10 2.00 patch Packager GPF


INF: Five Parameters to Set in ISAM Section of MSACCESS.INI

 Article Number: Q101323

 CREATED: 11-JUL-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article describes the five parameters that you can set in the

ISAM section of the MSACCESS.INI file, found in your WINDOWS directory.

The MSACCESS.INI file can contain the following five parameters:

   MaxBufferSize

   ReadAheadPages

   PageTimeout

   LockRetry

   CommitLockRetry

NOTE: These parameters are not automatically placed in the MSACCESS.INI

file. If necessary, you must add them.

MORE INFORMATION

ISAM parameters are read at only one time: during the launch of the

first instance of Microsoft Access. While the parameters can be

changed while Microsoft Access is running, these changes do not take

effect until all instances of Microsoft Access are closed and

Microsoft Access is restarted.

The examples in the following five sections assume the sample

parameter values below:

   MaxBufferSize = 512

   ReadAheadPages = 5

   PageTimeout=20 (sets PageTimeout to 2 seconds)

   LockRetry = 100

   CommitLockRetry = 100

MaxBufferSize

-------------

Microsoft Access physically stores all database data in 2K-memory

pages, generally in a large storage medium, such as a hard disk, RAM

drive, or CD-ROM. Once placed in the page cache, memory pages are then

used by Microsoft Access to hold data for tables, reports, and so

forth.

The MaxBufferSize ISAM parameter defines, in kilobytes, how large a

memory page cache to set up. A memory page cache is a section of

memory used to temporarily store (or, buffer) the 2K-memory pages that

Microsoft Access creates. Microsoft Access uses physical memory (RAM),

and, if necessary, virtual memory (for example, a hard disk) to create

the page cache that you specify.

Since the page cache stores data in 2K segments, you should set the

MaxBufferSize parameter only to an even number (for example, 18, 512,

1024, and so forth). If the parameter is set to an odd number,

Microsoft Access uses a MaxBufferSize setting of the given number

minus 1.

Since the page cache size is measured in kilobytes, and since each

memory page is 2K in size, you can calculate how many memory pages

will fit in your new page cache by using the following formula:

   maximum number of memory pages = (MaxBufferSize / 2)

For example, if you set the MaxBufferSize to 18, you set up a memory

page cache of 18K. Applying this number to the above formula yields

the following result:

   (18 / 2) = 9 possible memory pages

Microsoft Access responds to data read requests by checking the page

cache to verify whether or not the requested data is already present.

NOTE: The PageTimeout parameter can also be a factor in this process.

Please read the section below titled "PageTimeout."

If the data you need is present in the page cache, Microsoft Access is

able to immediately read the memory pages from it. Since Microsoft

Access does not have to wait for the cache to be filled from the

storage medium, this feature saves you time. However, if the data does

not appear on a memory page already present in the page cache,

Microsoft Access fills the cache from the storage medium and then

retrieves the data from the cache itself.

All memory pages stay in the page cache indefinitely, either until it

becomes full or until the computer is turned off. If the page cache

becomes full, pages are purged as necessary to make room for the new

data.

   Specifications

   ---------------------------------------------------------

   Maximum Setting: 4096 (4096 = 4MB)

   Minimum Setting: 18   (18 = 18K)

   Default Setting: 512

   Granularity: 2 (for example, 512 is valid, but 511 is not)

ReadAheadPages

--------------

The ReadAheadPages ISAM parameter specifies the size of another cache,

known as the "read-ahead" cache. The read-ahead cache is used by

Microsoft Access to cache sequential page reads from a database.

Reading data from a read-ahead cache is more efficient than reading it

from a storage medium, since sequential data reads can occur more

quickly. This is especially true when you are accessing data stored on

a network, where speed is increased by sending small numbers of large

packets, rather than large numbers of small packets.

The read-ahead cache is not used for all reads, but triggered instead

when Microsoft Access detects that a sequential read is taking place.

Microsoft Access attempts to detect a sequential read in the following

manner:

When Microsoft Access receives a read request, it checks to see if the

previous read is adjacent to the current request. If it is, Microsoft

Access reads the requested page, plus the next <n> pages (where <n> is

the value that the ReadAheadPages parameter is set to) in that

direction and places the data in the read-ahead cache. If Microsoft

Access correctly detects a sequential read, it then reads the next <n>

reads directly from the read-ahead cache, thus improving the speed.

When the read-ahead cache is created, Microsoft Access attempts to

place it in the first 640K of memory (also called conventional memory)

to benefit from the ability of Microsoft Windows to directly read from

and write to conventional memory. A separate read-ahead cache is

created for each database open on the host machine. Each library

database has its own read-ahead cache.

   Specifications

   -----------------------------

   Maximum Setting: 31

   Minimum Setting: 0

   Default Setting: 16

   Granularity: 1   (1 = 1 page)

PageTimeout

-----------

NOTE: The PageTimeout parameter is enabled for non-exclusive (shared)

data only.

The PageTimeout ISAM parameter defines the amount of time, in tenths

of a second, that a page is held in the memory page cache before it

must be refreshed to fulfill the next read of the same page. The

following scenario describes how the PageTimeout parameter is used:

If page <x> is read and placed in the memory page cache at time T1,

and later another read request is made for page <x> at time T2, the

memory page can be read directly from the memory page cache, if T2

minus T1 is less than the PageTimeout setting. Otherwise, Microsoft

Access must reread the data from the storage medium to refresh that

particular memory page.

NOTE: PageTimeout applies only to situations in which a database or

database object is opened with shared access. When a database is

opened with exclusive access, only one user has access to the data; as

a result, that user always holds the most current data and has no need

for refreshed data.

The PageTimeout parameter is used only when operating through the

Microsoft Access user interface. It is ignored when running an Access

Basic program, unless you allow background processing to occur by

periodically calling the DoEvents() statement.

   Specifications

   --------------------------------------------------

   Maximum Setting: 2147483647 (maximum long integer)

   Minimum Setting: 0

   Default Setting: 20

   Granularity: 1 (1 = 1/10 second)

LockRetry

---------

The LockRetry ISAM parameter defines the number of times Microsoft

Access tries to lock a page before it reports an error.

For example, if user A tries to lock page <x>, which was previously

locked by another user, user A's lock attempt fails. After this

failure, Microsoft Access tries <n> more times (where <n> is the value

LockRetry is set to) to lock the page. If the lock cannot be secured

by the <n>th retry, an error is reported either in the user interface

or in Access Basic code.

   Specifications

   --------------------------------------------------

   Maximum Setting: 2147483647 (maximum long integer)

   Minimum Setting: 0

   Default Setting: 20

   Granularity: 1

CommitLockRetry

---------------

The CommitLockRetry ISAM parameter is used in conjunction with the

LockRetry parameter to determine the number of retries performed when

locking pages within transactions. The total number of retries

performed is determined by multiplying the two parameters (LockRetry

and CommitLockRetry).

For example, if LockRetry has a value of 5 and CommitLockRetry has a

value of 6, 30 more retries (5 * 6 = 30) are made after the initial

failure to secure a lock.

   Specifications

   --------------------------------------------------

   Maximum Setting: 2147483647 (maximum long integer)

   Minimum Setting: 0

   Default Setting: 20

   Granularity: 1

REFERENCES

==========

For more information on the MSACCESS.INI file, search for

"MSACCESS.INI" using the Help menu. Also, see both "Setting ODBC

Options in the MSACCESS.INI File" in the README.TXT file and the

PERFORM.TXT file in your ACCESS directory.

MSACCESS.INI memory page cache

Additional reference words: 1.00 1.10 setable parameters ISAM


INF: Access Basic Error-Handling Supplemental Information

 Article Number: Q101324

 CREATED: 11-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article supplements the information available in the Microsoft Access

"Language Reference" manual about how to handle errors in an Access Basic

application.

MORE INFORMATION

There are times when your code becomes susceptible to user error

problems, even though the code itself is proven. The larger the

program, the more often situations arise that were not anticipated at

the time the code was written. For this reason, always include

error-handling routines in your code to prevent your application from

crashing when unexpected errors occur. Error-trapping routines offer

significant help in the debugging process.

On Error Statement

------------------

Access Basic includes the On Error statement for error trapping, as

well as several other commands for reporting and processing errors.

The On Error statement is followed by either a GoTo clause, which

causes program control to branch to a predefined label when an error

occurs, or by a Resume Next clause, which tells Access Basic to ignore

the error condition and continue to the next statement.

To create a label for an On Error GoTo statement, type the name of the

label, followed by a colon (:). The commands that follow the label are

executed when control is passed to the label by the On Error GoTo

statement.

Generally, you should place the label and its accompanying

error-handling routine at the bottom of the procedure, preceded by an

End Sub or End Function statement, to ensure that the routine executes

only when branched to and not by mistake.

NOTE: A label does not necessarily indicate a break in program flow.

Shown below is a Sub procedure that performs a SQL action based on a

SQL string value. The On Error Resume Next statement is used to handle

any errors generated by the first DeleteQueryDef method (for example,

if "TempQuery" does not exist). On Error GoTo SQLError means that if

any other errors occur, program control passes to the SQLError

error-handling routine. The On Error GoTo 0 statement is used at the

end of the procedure to disable error trapping.

   Sub PerformSQLAction (InDB As String, SQLStmt As String)

      Dim SQLDb As Database, SQLQuery As QueryDef

      On Error Resume Next

         Set SQLDb = OpenDatabase(InDB)

         SQLDb.DeleteQueryDef ("TempQuery")

      On Error GoTo SQLError:

         Set SQLQuery = SQLDb.CreateQueryDef("TempQuery", SQLStmt)

         SQLQuery.Execute

         SQLQuery.Close

         SQLDb.DeleteQueryDef ("TempQuery")

      On Error GoTo 0

      Exit Sub

   SQLError:

      MsgBox "An error occurred while executing the SQL statement."

      Exit Sub

   End Sub

The Exit Sub statement is required at the end of the error-handling

routine, even though the End Sub statement follows. In place of the

Exit Sub statement, you could use a Resume Next statement to return

control to the line following the line of code that caused the error.

Err(), Erl(), and Error$() Functions

------------------------------------

Access Basic includes the Err(), Erl(), and Error$() functions, all of

which return information about the error that occurred. The Error$()

function returns the error message as a string, the Err() function

returns a number representing the error message, and the Erl()

function returns the number of the line in which the error occurred.

Using these functions, you can code your error-trapping routine to

display meaningful error messages and trap for specific errors.

A generic error-trapping routine that uses both Error$() and Erl()

functions is shown below. This type of routine tells you what error

occurred and where; it also allows you to either ignore the error and

continue or cancel execution and further investigate the problem.

   On Error GoTo ErrorHandler

   ErrorHandler:

      If MsgBox("The following error has occurred at line " &_

         Trim(Str(Erl)) & ":" & Chr(13) & Chr(10) & Chr(13) &_

         Chr(10) & Error$, 17) = 1 Then Resume Next Else Stop

The following Sub procedure illustrates how the Error$() function can

create informative error messages to help you and your users debug

your program:

   Sub MyError ()

      On Error GoTo ErrorHandler

      INTEGERVAL% = 99999 'Generates Numeric Overflow error

      Debug.Print "Error was ignored"

      Exit Sub

   ErrorHandler:

      If MsgBox("The following error has occurred at line " &_

         Trim(Str(Erl)) & ":" & Chr(13) & Chr(10) & Chr(13) &_

         Chr(10) & Error$, 17) = 1 Then Resume Next Else Stop

      Exit Sub

   End Sub

You can use the Err() function to build a SQL SELECT statement that

traps for specific errors and takes a different action depending on

the error number. You can use the Erl() function to pinpoint exactly

which line is causing the problem in your program, to anticipate error

conditions in your program, and to handle errors more smoothly.

If you use the Erl() function, you do not need to number every line of

your code to find the offending line number. Instead, number only

those lines of code most likely to cause problems. (The line numbers

represent labels, rather than classic line numbers, as in other Basic

languages.) Then, if an error occurs in one of the numbered lines, the

Erl() function reports only that line number.

You can also use this method if you have two lines of code that may

generate the same error and you want to handle each case separately,

as in the following example:

   Function ErlTest()

      On Error Goto ErlTest_Err

      10: Open "AUTOEXECBAT" For Input As #1 'causes an error.

      20: Open "CONFIG.SYS" For Input As #2

      Close

   Exit Sub

   ErlTest_Err:

      If Erl = 10 Then

         MsgBox "Could not open AUTOEXEC.BAT file."

      ElseIf Erl = 20 Then

         MsgBox "Could not open CONFIG.SYS file."

      End If

      Exit Sub

   End Sub

Since there is no possibility that a file called "AUTOEXECBAT" exists,

this line of code errors out and program control passes to the error-

handling routine "ErlTest_Err". The Erl() function detects the number

of the line in which the error occurred and displays the "Could not

open AUTOEXEC.BAT file" error message.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 331-333

For more information about error-handling routines, search for "Error

handling" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 debugging


INF: How to Float Windows on Other Windows

 Article Number: Q101325

 CREATED: 11-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

With the Microsoft Access Popup property, you can create forms that "float"

(that is, they stay on top of other forms) within Microsoft Access.

However, if you set focus to a non-Microsoft Access application, these

forms are overlapped. If you want your forms to stay on top of forms in

non-Microsoft Access windows, you must call the Windows application

programming interface (API) subroutine SetWindowPos().

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools

provided with Microsoft Access. For more information on Access Basic,

please refer to the "Microsoft Access 1.x Introduction to Programming" or

"Microsoft Access 2.0 Building Applications" manual.

MORE INFORMATION

To make your form stay on top of non-Microsoft Access forms, call the

following Access Basic function from an event such as your form's

OnOpen event property.

NOTE: In the following sample code, an underscore (_) is used as a

line-continuation character. Remove the underscore when re-creating

this code in Access Basic.

You may have some Windows API functions defined in an existing

Microsoft Access library; therefore, your declarations may be

duplicates. If you receive the duplicate procedure name error message,

remove or comment out the declarations statement in your code.

1. Add the following to your global declarations section:

   Declare Sub SetWindowPos Lib "User" (ByVal hwnd%,_

                                     ByVal hWndInsertAfter%, _

                                     ByVal X%, ByVal Y%, ByVal cx%, _

                                     ByVal cy%, ByVal wFlags%)

   Global Const HWND_TOPMOST = -1

   Global Const SWP_NOSIZE = &H1

   Global Const SWP_NOMOVE = &H2

2. Create the following function:

      Function TopMost (F As Form)

         Call SetWindowPos(f.hwnd, HWND_TOPMOST, 0, 0, 0, 0,_

                           SWP_NOMOVE Or SWP_NOSIZE)

      End Function

3. Create a form and set the following properties:

      OnOpen: =TopMost(Form)

      Popup: True

4. Close the form to save any changes; changing the Popup property in

   Design view has no effect unless you reopen your form.

5. Open the form. When you switch to any other application, this form

   should stay on top of the other application.

To Float any Other Application

------------------------------

To float any other application on top of another application, such as

floating the Windows Calculator, you can use SetWindowsPos() along

with the FindWindow() Windows API function as demonstrated below:

Option Compare Database   'Use database order for string comparisons

Option Explicit

'Windows API Declarations

Declare Function FindWindow% Lib "user" (ByVal lpclassname As Any,_

   ByVal lpCaption As Any)

Declare Sub SetWindowPos Lib "User" (ByVal hwnd%, _

   ByVal hWndInsertAfter%, ByVal X%, ByVal Y%, ByVal cx%, ByVal cy%, _

   ByVal wFlags%)

Global Const HWND_TOPMOST = -1

Global Const SWP_NOSIZE = &H1

Global Const SWP_NOMOVE = &H2

Function Float_Cal()

   Dim X%, hwnd%

   X = Shell("CALC.EXE", 1)

   hwnd% = FindWindow%("SciCalc", 0&)

   Call SetWindowPos(hwnd%, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or_

      SWP_NOSIZE)

End Function

To demonstrate this, open the Immediate window, enter the following

command, and press ENTER:

   ? Float_Calc()

NOTE: CALC.EXE is an application that comes with Windows and should be

in your Windows directory.

REFERENCES

==========

"Microsoft Windows Programmer's Reference, Volume 2: Functions,"

version 3.10

Additional reference words: 1.00 1.10 2.00 float


PRA: "Table Does Not Exist" Error Message When Deleting Table

 Article Number: Q101370

 CREATED: 12-JUL-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

In Microsoft Access version 1.x, if an Access Basic function creates a

table with a QueryDef() function, and then attempts to delete that table,

the following error message appears:

   Table does not exist.

The new table does not get deleted, and is not displayed in the Database

window until the window is refreshed.

CAUSE

If the Database window is displaying the tables while the function is

being run, the Database window must be refreshed to display the

new table before it can be deleted.

RESOLUTION

Refresh the Database window before attempting to delete the table. To

do this, choose another object (for example, forms) in the Database window,

then display the tables again.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

The following function uses the sample database NWIND.MDB to

demonstrate how to create the table and then successfully delete it.

Make sure that you choose Table in the Database window before you run

the function below.

NOTE: In the following sample code, an underscore (_) is used as a

line-continuation character. Remove the underscore when re-creating

this code in Access Basic.

   Function DeleteThisTable ()

      Dim mydb As Database, myq As QueryDef

      Set mydb = CurrentDB()

      Set myq = mydb.CreateQueryDef("createtablequery")

      'Create the Table

      myq.sql = "SELECT  DISTINCTROW Customers.[Customer ID], _

                   Customers.[Company Name] INTO test FROM Customers;"

      myq.Execute

      'Choose any object other than Table to refresh Database

      'window.

      'NOTE: Omit the following line to reproduce the problem:

      DoCmd SelectObject A_FORM, "Customers", True

      'Delete the table

      DoCmd SelectObject A_TABLE, "test", True

      DoCmd DoMenuItem A_DATABASE, A_EDIT, A_DELETE

   End Function

Additional reference words: 1.00 1.10 QueryDef refresh errmsg


PRB: How the Scaling Property Affects Embedded MS Draw Object

 Article Number: Q101371

 CREATED: 12-JUL-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you have an embedded Microsoft Draw object that includes both

text and graphical elements, the text and graphical elements grow and

shrink in different degrees.

STATUS

This behavior is by design.

MORE INFORMATION

If the Scaling property is set to Scale when you adjust the size of an

embedded object's frame, the object grows or shrinks to fit the size of the

frame. This setting allows graphical elements, such as rectangles and

ovals, to become distorted. Fonts do not become distorted when you resize

their width, but will be distored if you resize their height to greater

than 1 inch.

Steps to Reproduce Behavior

---------------------------

1. Create a new unbound form.

2. Create an unbound object frame using the Object Frame tool, which

   is located directly beneath the Graph tool in the toolbox.

3. Select Microsoft Drawing as the Object Type.

4. Select the Text Object tool in Microsoft Draw, and type some text.

5. Select the Rectangle tool in Microsoft Draw and draw a rectangle

   around the text. From the Edit menu, choose Send To Back.

6. From the File menu, choose Exit And Return To Microsoft Access.

   When the dialog box asks you to update Microsoft Access, choose Yes.

7. Change the Scaling property of this Object Frame control to Scale.

8. Stretch the right side of the object to the right a few inches.

Note that the box stretches. The text stretches, but not to the extent that

it becomes disproportionate.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 13, "Using Pictures,

Graphs, and Other Objects," page 320

Additional reference words: 1.00 1.10 2.00 Object Frame


PRB: Using "MSACCESS" in DDE Initiate with Run-Time App
PRB: Using "MSACCESS" in DDE Initiate with Run-Time App [B_WAccADK]

 Article Number: Q101372

 CREATED: 12-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

 - Microsoft Access Developer's Toolkit version 2.0

---------------------------------------------------------------------

SYMPTOMS

Applications can initiate a dynamic data exchange (DDE) conversation

with a run-time application developed with Microsoft Access by specifying

"MSACCESS," rather than the .MDB file, as the application name.

STATUS

This behavior is by design.

MORE INFORMATION

To communicate with a run-time application using DDE, it is strongly

recommended that you use the name of the .MDB file, not "MSACCESS,"

as the application name when you are initiating a DDE conversation.

The run-time version of Microsoft Access responds to both Microsoft Access

and the name of the .MDB file as the application name.

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. In the Database window, choose the Macro button and select Sample

   AutoExec from the list.

3. From the File menu, choose Rename. In the Macro Name box, type

   "AutoExec" (without quotation marks) and press ENTER.

4. Quit Microsoft Access.

5. In Windows Program Manager, choose Run from the File menu.

6. Type the following and press ENTER:

      C:\<ACCESS>\MSARN100.EXE NWIND.MDB

   where <ACCESS> is your Microsoft Access program directory.

7. Start Microsoft Access again and create a new database, or open a

   database other than NWIND.MDB.

8. Create or open a module and add the following Access Basic

   function:

      Option Explicit

      Function DDEWithNWIND ()

         Dim chan

         chan = DDEInitiate("MSACCESS", "NWIND;TABLE Employees")

         MsgBox DDERequest(chan, "FirstRow")

         DDETerminate chan

      End Function

9. From the View menu, choose Immediate Window. Type the following and

   press ENTER:

      ? DDEWithNWIND()

   A message containing the first record from the Employees table in

   NWIND.MDB is displayed.

NOTE: The run-time application responds correctly to the DDEInitiate()

statement that reads:

   chan = DDEInitiate("NWIND", "NWIND;TABLE Employees")

Additional reference words: 1.10 2.00 ADK


PRA: Run Time Partially Displays Sorting and Grouping

 Article Number: Q101373

 CREATED: 12-JUL-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

------------------------------------------------------------

---------

SYMPTOMS

In the run-time version of Microsoft Access, the Sorting and

Grouping

properties of a report are partially displayed. The user is

able to

see only the title bar of the dialog box, as well as the

title bar of

the Group Properties section.

  NOTE: Using the DoMenuItem() function to display other

property

  dialogs boxes, like Field List or Palette, does not work.

These

  dialog boxes are not displayed and do not get the focus.

RESOLUTION

If you want to change the Sorting and Grouping properties of

a report

without allowing the user to see the dialog box, select Echo

Off so

that the screen is not updated while the macro is running.

You can also prevent users from switching to Design view by

using

macros and forms to control what actions the user can take

while in

the application.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

Distribution Kit version 1.1. We are is researching this

problem and

will post new information here in the Microsoft Knowledge

Base as it

becomes available.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. In the sample database NWIND.MDB, create the following

macro:

      Macro Name     Action

      =====================

      Test1        OpenReport

                   DoMenuItem

      Test1 Actions:

      --------------

      OpenReport

         Report Name: Catalog

         View: Design

      DoMenuItem

         Menu Bar: Report

         Menu Name: View

         Command: Sorting and Grouping

2. Save this macro as AUTOEXEC. Close the database and quit

Microsoft

   Access.

3. Start the run-time version of Microsoft Access with

NWIND.MDB.

   Switch to Program Manager and choose Run from the File

menu. Type

   the following in the command line:

      C:\ACCESS\MSARN110.EXE NWIND.MDB

   The Sorting and Grouping dialog box is partially

displayed. Note

   that as you tab through the cells of the dialog box,

cells

   that contain text are visible.

Additional reference words: 1.10 runtime run-time


INF: How to Create a Custom Startup "Splash" Screen

 Article Number: Q101374

 CREATED: 12-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

 - Microsoft Access Developer's Toolkit version 2.0

---------------------------------------------------------------------

SUMMARY

This article explains how to create a custom startup "splash" screen

for your Microsoft Access application.

MORE INFORMATION

A startup "splash" screen (title screen) is used by programmers to

display important information about a program during startup and to

give the user something colorful to look at and read while waiting for

the program to complete its initial processing, such as reading and

setting up user-defined preferences.

A typical splash screen contains the following information:

 - The program name and version number

 - The registered user's name and company

 - Copyright information

 - The developer's company name and logo

This article contains two Access Basic functions to implement splash

functionality.

Creating a New Splash Module

----------------------------

1. Create a new Access Basic module with the following functions:

'******************************************************************

' MODULE NAME: Splash

' DECLARATION SECTION

'******************************************************************

Option Explicit

Dim gSplashStart     ' The time when the splash screen opened.

Dim gSplashInterval  ' The minimum time to leave the splash screen up.

Dim gSplashForm      ' The name of the splash screen form.

'******************************************************************

' FUNCTION: SplashStart()

'

' PURPOSE: Used to invoke the splash screen form specified by the

'    SplashForm argument.

'

' ARGUMENTS:

'    SplashForm     - The name of the form to use as the splash

'                     screen.

'    SplashInterval - The minimum time, in seconds, that the splash

'                     screen must remain active on the screen.

'

'******************************************************************

Function SplashStart (ByVal SplashForm As String, ByVal SplashInterval_

As Integer)

    ' Open the splash form.

    DoCmd OpenForm SplashForm

    ' Set the starting time.

    gSplashStart = Timer

    ' Record the global information.

    gSplashInterval = SplashInterval

    gSplashForm = SplashForm

End Function

'******************************************************************

' FUNCTION: SplashEnd()

'

' PURPOSE: Used to close the splash screen form opened by the

'    SplashStart() function. This function checks to ensure that

'    the splash screen remains active until the user-specified

'    interval has expired.

'

'******************************************************************

Function SplashEnd ()

   Dim RetVal

   ' Loop until the splash screen has been active for

   ' .. the desired interval.

   Do Until Timer - gSplashStart > gSplashInterval

      ' Yield control so other applications can process.

      RetVal = DoEvents()

   Loop

   ' Close the splash screen.

   DoCmd Close A_FORM, gSplashForm

End Function

2. Save the new module as Splash.

How to Use the SplashStart() and SplashEnd() Functions

------------------------------------------------------

1. Create an unbound form with the text and graphics you want to

   display on the splash screen. For more information, see the

   "Setting Form Properties" section below.

2. Create a macro with the following actions and save it as AutoExec:

      Action                                           Arguments

      ----------------------------------------------------------

      RunCode                                                1.

      <any startup macro actions required by your program>   2.

      RunCode                                                3.

   AutoExec Actions

   -------------------------------------------------------------------

   1. RunCode

         Function Name: SplashStart("YourSplashFormNameHere", 5)

   2. <any startup macro actions required by your program .. optional>

   3. RunCode

         Function Name: SplashEnd()

Setting Form Properties

-----------------------

For best results, the splash form should have its form properties set

as follows:

   ScrollBars: Neither

   PopUp: Yes

   Modal: Yes

   RecordSelectors: No

Suppressing the Default Splash Screen

-------------------------------------

To prevent the default Microsoft Access splash screen from appearing,

you can use the run-time version of Microsoft Access, provided with

the Microsoft Access Distribution Kit (ADK) for version 1.1, or the

Microsoft Access Developer's Toolkit (ADT) for version 2.0.

Additional reference words: 1.10 2.00 Title Intro


INF: How to Query SQL Server Tables Without Attaching

 Article Number: Q101375

 CREATED: 12-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to use the SQL clause IN to query an SQL

Server table without attaching it.

MORE INFORMATION

You can use IN to query only one external database at a time.

The IN clause requires two arguments: database name and connect

string. When you attach SQL Server tables, you must specify an

empty string for the database name. The connect string consists of the

following items:

   Data Source Name (DSN)        The name of the SQL Server computer

   Database Name (DATABASE)      The name of the SQL Server database

   Workstation ID (WSID)         The name of the workstation that is

                                 making the connection (optional)

   User ID (UID)                 The login id*

   Password (PWD)                The user password*

* This item is optional within the connect string. If it is not

  present, the system prompts the user with a dialog box to enter this

  information the first time the macro is executed each session.

The following is a sample connect string to SQL Server. Note that it

starts with "ODBC," which tells the system that it uses the ODBC

driver (as opposed to an installable ISAM driver).

   ODBC;DSN=ServerName;Database=Pubs;WSID=Wrk1;USID=JaneDoe;PWD=ABC123

The following example assumes that the ODBC driver manager and SQL

Server driver are installed, that a data source called "Corp" was set

up using the ODBC driver manager, and that the table "Employees" can

be successfully attached using the Attach command on the File menu.

1. Open the sample database NWIND.MDB.

2. Create a new query.

3. From the View menu, choose SQL.

4. Enter the following query:

      Select *

      FROM Employees

      IN "" "ODBC;dsn=Corp;database=Payroll;uid=JSmith;pwd=KL3d";

5. Choose OK to exit the SQL dialog box and close and save the query.

NOTE: If you return to the View SQL window after saving the query,

Microsoft Access may place additional characters in the IN clause that you

must remove to avoid a syntax error.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.1, Appendix B, "Microsoft

Access SQL," page 513

For more information about the IN clause, search for "IN (SQL)" then "IN

Clause (SQL)" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 attach remote data source


PRB: "Btrieve-Out of Resources" Error Msg with Attached Table

 Article Number: Q101405

 CREATED: 13-JUL-1993

 MODIFIED: 31-AUG-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Opening an attached Btrieve table returns the following error message:

   Btrieve-Out of Resources

CAUSE

If you are using compressed Btrieve files, you must be sure that the

compression buffer Btrieve is using is adequate for your data. The

buffer size must be at least as large as the largest record in your

data files.

RESOLUTION

To ensure proper operation, set the compression buffer size option

(/u) in the [btrieve] section of your WIN.INI file. The units for this

setting are kilobytes; if your largest record is 2K, add /u:2 to the

Btrieve options line.

MORE INFORMATION

For more information on setting options, see the topic "Setting

Btrieve Options in WIN.INI" in the BTRIEVE.TXT file, included with

Microsoft Access version 1.1.

Btrieve is manufactured by Novell, Inc., a vendor independent of

Microsoft; we make no warranty, implied or otherwise, regarding this

product's performance or reliability.

Additional reference words: 1.00 1.10 xtrieve attach btrieve


PRA: ERR: Undefined Function Referencing Column Property

 Article Number: Q101673

 CREATED: 20-JUL-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you attempt to run macro actions that contain a "Where" clause

(ApplyFilter, OpenForm, OpenReport, and FindRecord), and queries that

reference the Column property of a combo box on a form, the following

error message is displayed:

   Undefined Function "[Forms]![Formname]![Controlname].column" in

   Expression.

CAUSE

Microsoft Access interprets any text followed by opening and closing

parentheses as a user-defined function.

RESOLUTION

Create an unbound text box on the form that references the Column

property of the combo box. Reference this text box in your query.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1, and 2.0. We are researching this problem and will post new

information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

NOTE: This problem occurs only when you are attempting to reference a

column other than the bound column of the combo box. If you want to

reference the bound column of the combo box, just use the control name

of the combo box.

Steps to Reproduce Problem

--------------------------

1. Using the sample database NWIND.MDB, create a new form based on the

   Orders table.

2. Add a combo box control with the following properties:

      Form: PromptForm

         Record Source: Orders

      Combo Box Control: TheCombo

         ControlSource: OrderID

         RowSource: Orders

         ColumnCount: 4

         BoundColumn: 1

3. Create the following query based on the Employees table:

      Query: ReferenceCombo

      ---------------------

      Type: Select Query

      Field: Employee ID

         Table: Employees

         Criteria: =[Forms]![PromptForm]![TheCombo].column(2)

      Field: Last Name

         Table: Employees

      Field: First Name

         Table: Employees

4. Open the form PromptForm in Form view and select an Order ID record

   from the combo box.

5. Open the query ReferenceCombo in Datasheet view. You will receive

   the following error message:

      Undefined Function "[Forms]![PromptForm]![TheCombo].column" in

      Expression.

To work around this problem, use the following four steps:

1. Open the form PromptForm in Design view.

2. Add the following unbound text box control:

      Text Box Control: TheTextbox

         ControlSource: =TheCombo.column(2)

         Visible: No

3. Open the Query in Design view.

4. Change the criteria for the field [Employee ID] to the following:

      [Forms]![PromptForm]![TheTextbox]

The query will now correctly reference the text box control, which

references the Column property of the combo box.

Additional reference words: 1.00 1.10 2.00


INF: How to Get a List of Object Names in Microsoft Access

 Article Number: Q101674

 CREATED: 20-JUL-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

There is no built-in mechanism in Microsoft Access version 1.x for

enumerating a list of form, report, macro, or module names. This article

demonstrates an Access Basic function, GetObjectNames(), that you can use

to list the names of these objects as well as table and query names.

NOTE: The technique described below relies on the use of system

tables stored with your database. These tables are undocumented and

are subject to change in future versions of Microsoft Access.

(DAO)

information.

MORE INFORMATION

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications with the programming tools

provided with Microsoft Access.

First, create a new module with the code listed below.

NOTE: In the following sample code, an underscore (_) is used as a

line continuation character. Remove the underscore when re-creating

this code in Access Basic.

'********************************************************************

' MODULE DECLARATIONS

'********************************************************************

Option Explicit

'********************************************************************

' FUNCTION: GetObjectNames

'

' PURPOSE:

'    Fills the string array passed as an argument with a list of names

'    of objects of type ObjectType in the currently opened user

'    database.

'

' ARGUMENTS:

'    ObjectType - A string representing the object whose names are to

'                 be retrieved. ObjectType can be one of the

'                 following:

'

'                 Tables, Queries, Forms, Reports, Macros, Modules

'

'    Names      - A single dimensional array of type string

'

' RETURN:

'    The number of names stored in the Names array. The names

'    are stored beginning from 0 to GetObjectNames - 1.

'

' NOTES:

'    This function utilizes information stored in the MySysObject table

'    of the currently opened user database. The system tables are

'    undocumented and are subject to change in future versions of

'    Access.

'

'********************************************************************

Function GetObjectNames (ByVal ObjectType, Names() As String)

   Dim db As Database

   Dim ss As Snapshot

   Dim Count

   Dim SQL

   Dim Msg As String

    SQL = "Select Name,Type from MSysObjects Where Type="

   Select Case ObjectType

      Case "Tables"

         SQL = SQL & "1 And Left(Name,1)<>'~' And Left(Name,4) <> _

                  ""MSys"" Order By Name;"

      Case "Queries"

         SQL = SQL & "5 And Left(Name,1)<>'~' And Mid(Name, _

                  Len(Name) - 3) <> ""0000"" Order By Name;"

      Case "Forms"

         SQL = SQL & "-32768 And Left(Name,1)<>'~' Order By Name;"

      Case "Reports"

         SQL = SQL & "-32764 And Left(Name,1)<>'~' Order By Name;"

      Case "Macros"

         SQL = SQL & "-32766 And Left(Name,1)<>'~' Order By Name;"

      Case "Modules"

         SQL = SQL & "-32761 And Left(Name,1)<>'~' Order By Name;"

      Case Else

         Msg = "Object Name """ & ObjectType & """ is an invalid"

         Msg = Msg & " argument to Function GetObjectNames!"

         MsgBox Msg, 16, "GetObjectNames"

         Exit Function

   End Select

   Set db = CurrentDB()

   Set ss = db.CreateSnapshot(SQL)

   ss.MoveLast

   If ss.RecordCount > 0 Then

      ReDim Names(0 To ss.RecordCount - 1)

   Else

      GetObjectNames = 0

      Exit Function

   End If

   ss.MoveFirst

   Count = 0

   Do While Not ss.EOF

      Names(Count) = ss![name]

      Count = Count + 1

      ss.MoveNext

   Loop

   GetObjectNames = ss.RecordCount

End Function

'********************************************************************

' FUNCTION: TestGetObjectNames

'

' PURPOSE: Used to demonstrate and test the GetObjectNames function

'

' ARGUMENTS:

'    ObjectType - A string representing the object whose names are to

'                 be retrieved. ObjectType can be one of the following:

'

'                 Tables, Queries, Forms, Reports, Macros, Modules

'

'********************************************************************

Function TestGetObjectNames (ObjectType)

   Dim Count, i

   ReDim Names(0) As String

   Count = GetObjectNames(ObjectType, Names())

   Debug.Print "Count: " & Count

   For i = 0 To Count - 1

      Debug.Print Names(i)

   Next i

End Function

How to Use the GetObjectNames() Function

----------------------------------------

The function TestGetObjectNames(), above, demonstrates how to use

the GetObjectNames() function.

1. With the module open in Design view, choose Immediate Window from

   the View menu.

2. Type the following and press ENTER:

      ? TestGetObjectNames("Forms")

Result: A list of forms in the currently-open database will print in

the Immediate window.

REFERENCES

==========

Microsoft Access "Introduction to Programming," version 1.1, Chapter 8,

"Manipulating Data," pages 124-127

Additional reference words: 1.00 1.10


INF: Sample Table Design to Support Questionnaire Applications

 Article Number: Q101675

 CREATED: 20-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes a table design suitable for an application

that tallies results from questionnaires and surveys.

MORE INFORMATION

The following examples outline nonrelational table design commonly

used for questionnaires and surveys and suggests an improved,

relational table design.

Nonrelational Table Design

---------------------------

When designing tables for questionnaire applications, many users begin

with a design that resembles the table below. Each record contains

multiple fields, called Question1 through Question<n>, that contain

responses to the questions.

   Table: Table1 (old)

   --------------------------------------

   FieldName: Respondent ID [Primary Key]

   FieldName: Question1

   FieldName: Question2

   FieldName: Question3

   .

   .

   .

   FieldName: Question<n>

Problems occur when you want to perform crosstab queries to summarize

and/or graph the questionnaire results.

Relational Table Design

-----------------------

A relational table design better supports summary queries, reports,

and graphs. In the table below, the Question ID field identifies the

question and the Response field contains the answer.

   Table: Table2 (new)

   ----------------------------------

   Field: Respondent ID [Primary Key]

   Field: Question ID   [Primary Key]

   Field: Response

How to Switch to Relational Database Design

-------------------------------------------

To convert data that has been entered in Table1 format, complete the

following six steps:

1. Create Table2 according to the above structure, using the following

   data type criteria:

    - All Respondent ID fields must be the same data type.

    - The Question ID field must be a Text data type.

    - The Response field must be the same data type as the Question<x>

      data types.

2. Create a new query based on Table1.

3. From the Query menu, choose Append. Select Table2 as the table to

   which you want to append the data. Design the query as follows:

      Query: Query1

      --------------------------

      Field: Respondent ID

         Append To: Respondent ID

      Field: Question1

         Append To: Response

      Field: "Question1"

         Append To: Question ID

4. Run Query1 to append to Table2 each participant's responses to

   Question1.

5. Repeat steps 2-4 above, replacing Question1 with Question2, and

   "Question1" with "Question2". You must re-create or modify this

   query for each question in Table1.

6. After running all the append queries, the result is a table

   (Table2) that can easily summarize your results in a crosstab

   query:

      Query: CrossTabExample

      ----------------------

      Field: Question ID

         Total: Group By

         Crosstab: Row Heading

      Field: Response

         Total: Group By

         Crosstab: Column Heading

      Field: Response

         Total: Count

         Crosstab: Value

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapters 1, 6, and 7

Additional reference words: 1.00 1.10 2.00 Cross tab append


INF: How to Retrieve Windows For Workgroups User Information

 Article Number: Q101676

 CREATED: 20-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Using the Microsoft Windows for Workgroups API, you can retrieve

information, such as user name, workgroup, domain, and computer name,

about the currently running computer.

MORE INFORMATION

Windows for Workgroups comes with a function called NetWkstaGetInfo()

that returns information about a computer. This function is especially

useful for multiuser applications.

The following procedure explains how to use Access Basic and several

Windows API calls to access the NetWkstaGetInfo() function:

1. Create a new module containing the following declarations and

   functions:

   NOTE: In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

   NOTE: You may have some Microsoft Windows API functions defined in an

   existing Microsoft Access library; therefore, your declarations may be

   duplicates. If you receive a duplicate procedure name error message,

   remove or comment out the declarations statement in your code.

   NOTE: Make sure to choose the Compile All command from the Run menu to

   verify that you do not receive any compilation errors.

      Option Explicit

      Declare Function NetWkstaGetInfo% Lib "NetAPI" (ByVal lServer&, _

         ByVal sLevel%, ByVal pbBuffer&, ByVal cbBuffer%, pcbTotalAvail%)

      Declare Function GlobalAlloc% Lib "Kernel" (ByVal fFlags%,_

         ByVal nSize&)

      Declare Function GlobalLock& Lib "Kernel" (ByVal hMem%)

      Declare Function GlobalUnlock% Lib "Kernel" (ByVal hMem%)

      Declare Function GlobalFree% Lib "Kernel" (ByVal hMem%)

      Declare Sub lstrcpy Lib "Kernel" (ByVal dest As Any,_

         ByVal src As Any)

      Declare Sub hmemcpy Lib "Kernel" (ByVal dest As Any,_

         ByVal src As Any, ByVal size As Long)

      Function GetBinInt (sobj As String, off As Integer)

         If (Asc(Mid$(sobj, off + 1, 1)) < 128) Then

            GetBinInt = Asc(Mid$(sobj, off, 1)) +_

                            Asc(Mid$(sobj, off + 1, 1)) * 256

         Else

            GetBinInt = ((&HFF - Asc(Mid$(sobj, off + 1, 1))) * 256) - _

                          Asc(Mid$(sobj, off, 1))

         End If

      End Function

      Function GetWorkstationInfo (sComputer As String,_

         sUserName As String, sWorkgroup As String, sLogonDomain As String)

         Dim nRetSize As Integer, nStruct, ret As Integer, dummy As Integer

         Dim hMem As Integer, lpMem As Long, sTemp As String

         ' Get the size of the return structure.

         ret = NetWkstaGetInfo(0&, 10, 0&, 0, nRetSize)

         If (ret <> 0) And (ret <> 2123) Then

            GetWorkstationInfo = False

            Exit Function

         End If

         ' Allocate memory for the structure.

         hMem = GlobalAlloc(0, CLng(nRetSize))

         nStruct = nRetSize

         If (hMem <> 0) Then

            lpMem = GlobalLock(hMem)

            ' Read workstation information into structure.

            ret = NetWkstaGetInfo(0&, 10, lpMem, nRetSize, nRetSize)

            If (ret = 0) Then

               sTemp = Space(100)

               hmemcpy sTemp, lpMem, nStruct

               ' Retrieve the computer name.

               sComputer = Space(100)

               lpMem = CLng(GetBinInt(sTemp, 1)) +_

                           (CLng(GetBinInt(sTemp, 3)) * CLng(&H10000))

               lstrcpy sComputer, lpMem

               sComputer = Mid(sComputer, 1, InStr(sComputer, Chr(0)) - 1)

               ' Retrieve the user name.

               sUserName = Space(100)

               lpMem = CLng(GetBinInt(sTemp, 5)) +_

                           (CLng(GetBinInt(sTemp, 7)) * &H10000)

               lstrcpy sUserName, lpMem

               sUserName = Mid(sUserName, 1, InStr(sUserName, Chr(0)) - 1)

               ' Retrieve the workgroup name.

               sWorkgroup = Space(100)

               lpMem = CLng(GetBinInt(sTemp, 9)) +_

                           (CLng(GetBinInt(sTemp, 11)) * &H10000)

               lstrcpy sWorkgroup, lpMem

               sWorkgroup = Mid(sWorkgroup, 1, InStr(sWorkgroup,_

                                                     Chr(0)) - 1)

               ' Retrieve the logon domain name.

               sLogonDomain = Space(100)

               lpMem = CLng(GetBinInt(sTemp, 15)) +_

                           (CLng(GetBinInt(sTemp, 17)) * &H10000)

               lstrcpy sLogonDomain, lpMem

               sLogonDomain = Mid(sLogonDomain, 1, InStr(sLogonDomain,_

                                  Chr(0)) - 1)

            End If

            ' Free the memory allocated.

            dummy = GlobalUnlock(hMem)

            dummy = GlobalFree(hMem)

         Else

            ret = -1

         End If

         GetWorkstationInfo = IIf(ret = 0, True, False)

      End Function

2. Test this function by creating the following Access Basic function:

      Sub ShowInfo ()

         Dim a$, b$, c$, d$

         If GetWorkstationInfo(a$, b$, c$, d$) Then

            MsgBox a$ & " " & b$ & " " & c$ & " " & d$

         Else

            MsgBox "Unable to get information."

         End If

      End Sub

3. In the Immediate window, type the following, and the press ENTER:

      ShowInfo

Either a dialog box displaying information about the computer, or, if you

are running this function on a non-Windows for Workgroups computer, an

error message stating "Unable to get information" will be displayed.

Additional reference words: 1.00 1.10 2.00 user name multi-user networks


PRB: No CanShrink Property for Check Boxes

 Article Number: Q101677

 CREATED: 20-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

There is no CanShrink property for check boxes or option buttons

placed on a form or report.

RESOLUTION

The following workaround demonstrates a method that uses a text box to

simulate a check box on a report. If the text box field is not

selected, the horizontal space the text box occupies will close up and

not print.

1. For a field with a Yes/No data type named Check1, create a text box

   on a report with the following properties:

      ControlName: txtCheck1

      ControlSource: =IIf([Check1]=-1," X ")

      CanShrink: Yes

      BorderStyle: Normal

   Note that the ControlName property must not match the name of any

   fields referenced in the ControlSource property formula; otherwise a

   "#ERROR" message will be generated for the field.

2. Change the ControlName of the text box label to lblCheck1.

3. Create the following macro and save it as ShrinkNo:

      Condition         Action        Defined Below

      ---------------------------------------------

      [Check1]=-1       SetValue            1

      [Check1]=0        SetValue            2

      ShrinkNo Actions

      ----------------------------

      1. SetValue

         Item: [lblCheck1].Visible

         Expression: True

      2. SetValue

         Item: [lblCheck1].Visible

         Expression: False

4. Set the following properties for the report's Detail section:

      CanShrink: True

      On Format: ShrinkNo

5. Size and position the text box and its label appropriately so that it

   looks like a check box.

The text box will shrink up if it is the only item sharing the same

horizontal space on the report. Make sure not to overlap the text box

with any other item positioned to the left or right of the text box.

The label for the text box must also be hidden, which the ShrinkNo

macro accomplishes.

Additional reference words: 1.00 1.10 2.00 shrink can


INF: Trapping SQL Server RAISERROR() Function Values

 Article Number: Q101678

 CREATED: 20-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.1 and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft SQL Server users often create triggers or stored procedures that

perform specific functions that are fired during certain events. Often, a

custom-generated error value is desired to indicate the status of such

events. This article describes a way to trap that value in Microsoft

Access.

NOTE: This article assumes that the user is running Microsoft Access

version 1.1, since that version corrects a problem to allow the SQL

Server RAISERROR() function to return a value to Microsoft Access.

MORE INFORMATION

1. Create the following stored procedure based on the sample database

   PUBS in Microsoft SQL Server:

      CREATE PROCEDURE TestProc

      AS

        RAISERROR 25000 'This is a test error'

2. Create a trigger on the table from which you want this stored

   procedure to run:

   NOTE: Stored procedures cannot be executed directly from Microsoft

   Access 1.1, unless they are triggered from a SQL Server trigger or the

   SQL pass-thru .DLL file (SPT110.DLL) is used. However, when using

   version 2.0, you can invoke a stored procedure using an SQL pass-

   through query. For this example, you will use a trigger that fires when

   a record is updated.

      CREATE TRIGGER TestTrig

      ON Authors

      FOR UPDATE

      AS

        EXECUTE TestProc

3. Add the following code to an Access Basic module. The subprocedure

   updates the Authors table (the attached table dbo_authors) in some

   way, and traps the error value that is passed by the RAISERROR()

   function:

      Sub TrapIt ()

          Dim db As Database, Mydyna As Dynaset

          Dim Xerr As String, Xval As Integer,

          Dim Xstart As Integer, Xlen As Integer

          On Error GoTo ErrorHandler

          Set db = CurrentDB()

          Set Mydyna = db.CreateDynaset("select * from dbo_authors;")

          Mydyna.Edit

          Mydyna!au_fname = Mydyna!au_fname

          Mydyna.Update

          Mydyna.MoveNext

          Exit Sub

      ErrorHandler:

      'This routine parses the error string returned from ODBC and

      'extracts only the error value you assigned with the RAISERROR()

      'function in SQL Server.

      'traps the error message

          xerror = Error$

      'finds start of error value

          Xstart = InStr(1, xerror, "#") + 1

      'finds length of error value

          Xlen = InStr(Xstart, xerror, ")") - Xstart

      'extracts error value from string

          Xval = Mid(xerror, Xstart, Xlen)

          MsgBox ("You have encountered error #" & CStr(Xval))

          Resume Next

      End Sub

Additional reference words: 1.10 2.00


PRA: Setup (STFSETUP) GP Faults in Windows Standard Mode

 Article Number: Q102230

 CREATED: 29-JUL-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

When you are running Microsoft Windows in standard mode, the error message

"STFSETUP caused a general protection fault in STFSETUP.EXE" will occur

near the end of the installation process if you are running any of the

following:

 - The retail Setup of Microsoft Access version 1.1.

 - A workstation Setup (/n) from the version 1.1 upgrade disks.

 - A custom application developed with the Microsoft Access

   Distribution Kit (ADK).

CAUSE

This problem is caused by the detection and implementation of sharing

mechanisms.

RESOLUTION

Run Windows in 386 enhanced mode during Setup. You may then switch

back to standard mode to run your applications.

NOTE: This problem is solely confined to the Setup process. In no way

does it affect how Microsoft Access runs in either standard or 386

enhanced mode.

If for some reason you cannot run Microsoft Windows in 386 enhanced

mode, modify STFSETUP.IN_ as described below. Separate procedures

follow for retail, upgrade, and ADK users.

Steps for Retail Users

----------------------

1. Make a backup copy of Disk1.

2. On the backup disk, use an editor to modify the STFSETUP.IN_ file.

   Change the [System Paths] section from

   [System Paths]

      SYSTEMPATH = "" ? DETCMD.DLL GetWindowsSysDir

      WINDOWSPATH = "" ? DETCMD.DLL GetWindowsDir

      HARDDRIVELIST  = "" ? DETCMD.DLL GetAllValidLocalHardDrives

      NETDRIVELIST = "" ? DETCMD.DLL GetAllValidNetworkDrives

   to

   [System Paths]

      SYSTEMPATH = "" ? DETCMD.DLL GetWindowsSysDir

      WINDOWSPATH = "" ? DETCMD.DLL GetWindowsDir

      HARDDRIVELIST = "" ? DETCMD.DLL GetAllValidLocalHardDrives

      NETDRIVELIST = "" ? DETCMD.DLL GetAllValidNetworkDrives

      WINDOWSMODE = "" ? DETCMD.DLL GetWindowsMode

3. Then change the following

   DoShareStuff = +

    set CurrentDialog = DoShareStuff

     set MAKEBAK = "NO"

     ui start VSHARERunning

     ifstr $(ANSWER) == "NO"

   to

   DoShareStuff = +

    set CurrentDialog = DoShareStuff

     set MAKEBAK = "NO"

     ifstr $(WINDOWSMODE) != "ENHANCED"

        set ANSWER = "NO"

     else

        ui start VSHARERunning

     endif

     ifstr $(ANSWER) == "NO"

Steps for Version 1.1 Upgrade Users

-----------------------------------

Single-user upgrades and Admin upgrades (setup /a) work fine. However,

to run Setup or setup /n from the network with Windows in standard

mode, you must first make the changes mentioned above to the

STFSETUP.IN_ file in the ACCESS\INSTALL subdirectory on the network.

Steps for ADK Users

-------------------

The ADK Setup works fine in Windows standard mode. However, before you

create disks for your application, modify the SETUPWIZ.IN_ file (and

optionally the CUST12MB.IN_, CUST14MB.IN_, and CUST720K.IN_ files) as

follows:

1. Change the following

   [System Paths]

       SystemPath =  "" ? DETCMD.DLL GetWindowsSysDir

       WindowsPath     =  "" ? DETCMD.DLL GetWindowsDir

       HARDDRIVELIST   = "" ? DETCMD.DLL GetAllValidLocalHardDrives

       NETDRIVELIST = "" ? DETCMD.DLL GetAllValidNetworkDrives

   to

   [System Paths]

       SystemPath =  "" ? DETCMD.DLL GetWindowsSysDir

       WindowsPath     =  "" ? DETCMD.DLL GetWindowsDir

       HARDDRIVELIST   = "" ? DETCMD.DLL GetAllValidLocalHardDrives

       NETDRIVELIST = "" ? DETCMD.DLL GetAllValidNetworkDrives

       WINDOWSMODE =  "" ? DETCMD.DLL GetWindowsMode

NOTE: Unlike the Microsoft Access version 1.1 corrections, the first

two variables in the [System Paths] section of the ADK is

case-sensitive.

2. Add the test case around VSHARERunning by changing the following

   from

   DoShareStuff = +

    set CurrentDialog = DoShareStuff

     set MAKEBAK = "NO"

     ui start VSHARERunning

     ifstr $(ANSWER) == "NO"

   to

   DoShareStuff = +

    set CurrentDialog = DoShareStuff

     set MAKEBAK = "NO"

     ifstr $(WINDOWSMODE) != "ENHANCED"

        set ANSWER = "NO"

     else

        ui start VSHARERunning

     endif

     ifstr $(ANSWER) == "NO"

NOTE: This is exactly the same change as the Microsoft Access version

1.1 change.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version

1.1 and the Microsoft Access Distribution Kit version 1.1. This problem no

longer occurs in Microsoft Access version 2.0 or the Microsoft Access

Developer's Toolkit version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Start Windows in standard mode (win /s), using the Microsoft Access

   version 1.1 Retail disks.

2. Insert Disk 1 into drive A for 3.5-inch disks (or B for 5.25-inch

   disks).

3. From the File menu in Program Manager, choose Run.

4. Type a:\setup (or b:\setup) and press ENTER.

5. Follow the instructions on your screen.

When you insert the last disk, you will receive this error.

Additional reference words: 1.10 gpf


INF: Fill New Record with Data from Prev Record Automatically

 Article Number: Q88670

 CREATED: 11-AUG-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you are creating new records, you may want to speed up the data

entry process by having fields in the new record fill with values from

fields in the previous record automatically.

This article demonstrates a sample Access Basic function called

AutoFillNewRecord() that you can use to fill fields in a new record with

values from fields in the previous record.

MORE INFORMATION

One technique used to automate repetitive data entry is to press

CTRL+apostrophe (') with your insertion point in a field. Microsoft

Access then inserts the value contained in the previous record in the

new field.

However, you may want certain fields in a new record to fill with data

from the previous record automatically.

The following Access Basic function, AutoFillNewRecord(), can be used

to fill either selected fields or all fields in a new record with

values from the previous record:

1. Open the sample database NWIND.MDB.

2. Create the following Access Basic module:

   NOTE: In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

   ' ********************************************************************

   ' DECLARATION SECTION

   ' ********************************************************************

   Option Explicit

   ' ********************************************************************

   ' FUNCTION: AutoFillNewRecord

   '

   ' PURPOSE:

   '   Speeds up repetitive data entry by automatically filling

   '   selected fields in a new record with data contained in fields in

   '   the previous record.

   '

   ' USAGE:

   '   Set the OnCurrent property of the form to read:

   '

   '      =AutoFillNewRecord()

   '

   '   If you want only certain fields filled in automatically, create

   '   an unbound text box on the form with the following properties:

   '

   '      ControlName: AutoFillNewRecordCriteria

   '      Visible: No

   '      DefaultValue: ;Company Name;Contact Name;Contact Title;Address;

   '

   '   NOTE: The DefaultValue property should be a semicolon-delimited

   '   list of control names on the form. You must have a semicolon

   '   to the left and right of each entry to avoid confusion with

   '   other fields with similar names.

   '

   '   If you want all fields automatically filled in, do not create the

   '   AutoFillNewRecordCriteria text box described above.

   '

   ' ********************************************************************

   Function AutoFillNewRecord ()

      Dim ds As Dynaset, F As Form, RetVal As Variant, i As Integer

      Dim AutoFillCriteria As String, AutoFillField As Variant

      On Error Resume Next

      ' Get the active form.. and exit if it is not available

      Set F = Screen.ActiveForm

      If Err Then Exit Function

      ' See if we are on the new record by trying to reference

      ' .. the bookmark. An error will occur if it is a new record.

      RetVal = F.Bookmark

      ' If there was no error, we are not on new record, so exit.

      If Err = 0 Then Exit Function

      Err = 0   ' Reset error flag

      ' Get the form dynaset and go to the last record. This last

      ' .. record is used to fill the new record with information.

      Set ds = F.Dynaset

      ds.MoveLast

      ' If we cannot move to, or find, last record, exit the function.

      If Err <> 0 Then Exit Function

      DoCmd Echo False

      ' Step through all the fields in the last record of the dynaset

      For i = 0 To F.Count - 1

         ' Get the list of fields to auto fill. An error will occur

         ' .. if there is no criteria field specified, which is

         ' ..  trapped and is examined later.

         AutoFillCriteria = F![AutoFillNewRecordCriteria]

         ' Do not fill the field in the new record by default.

         AutoFillField = False

         ' Fill the field in the new record if:

         '

         '   1. There are criteria fields (Err=0) and the current

         '      field name in the dynaset is found in the field criteria.

         '

         If (Err = 0 And InStr(1, AutoFillCriteria, ";" & _

            (F(i).ControlName) & ";")) Then

            AutoFillField = True

         End If

         '   2. No criteria fields were specified (Err<>0).

         '      (Fill ALL fields if no criteria is specified on the form)

         '

         If Err <> 0 Then  AutoFillField = True

         Err = 0   ' Reset error flag

         ' If we are going to fill the field, copy the value from the

         ' .. dynaset field (in last record) to the new record field

         ' .. on the form.

         If AutoFillField = True Then

            F(i) = ds((F(i).ControlName))

            ' Ignore error if one occurs during the fill.

            If Err <> 0 Then Err = 0

         End If

      Next i

      DoCmd Echo True

   End Function

3. Open the Customers form in Design view. Change the form's OnCurrent

   property to read:

      =AutoFillNewRecord()

4. Create an unbound text box on the form with the following

   properties:

      ControlName: AutoFillNewRecordCriteria

      Visible: No

      DefaultValue: ;Company Name;Contact Name;Contact Title;Address;

When you go to a new record, the Company Name, Contact Name, Contact

Title, and Address fields are filled in automatically. If you want all

fields to automatically fill in, you can either skip step 4 above or

leave the DefaultValue property blank.

Additional reference words: 1.00 1.10 2.00 default value DefaultValue


PRA: Hard-Coded and Passed Wildcards Different in Query

 Article Number: Q102431

 CREATED: 03-AUG-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The Like operator treats hard-coded asterisk (*) wildcard characters

in queries differently from asterisks passed as query parameters.

With the asterisk as a parameter value, queries do not display records

with null values for the field in which the Like criteria is set.

However, with the asterisk as a hard-coded criteria value (for

example, Like "*"), null values do appear for the field with the Like

condition.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

How to Create TestQuery:

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. Create a new query based on the Employees table.

3. Add the Last Name and Region fields to the query grid.

4. In the Criteria cell in the Region field of the query grid, type

   the following:

      Like "*"

5. Run the query.

   The result is a dynaset containing nine records, including four

   records without values in the Region column (Buchanan, Suyama, King

   and Dodsworth). The wildcard character hard-coded with the Like

   operator in the query returns all records, whether or not there are

   null values in the field.

6. Change the Like operator in step 4 above to the following:

      Like [Forms]![TestForm]![Field0]

   This operator instructs the Like criteria to look in Field0 on a

   form called TestForm for the value it will use in the operation.

7. Save the query as TestQuery.

How to Create TestForm:

1. In the Database window, create a new, unbound form.

2. Place a text box control on the form.

3. Save the form as TestForm.

How to Pass the Asterisk Wildcard Character as a Parameter:

1. Open TestForm in Form view and TestQuery in Design view. Arrange

   the windows so that you can see both the form and the query.

2. Type "*" (without the quotation marks) in the text box on TestForm

   and press ENTER. This asterisk will be passed as a parameter for

   the Like operator in TestQuery.

3. Run TestQuery.

   Note that the query dynaset now contains only five records: those

   containing non-null values in the Region field. When the asterisk

   is passed as a parameter to the query, Microsoft Access displays

   only records with non-null values in the field using the Like

   operator (in this case, the Region field).

REFERENCES

==========

For more information on returning null records, query the Microsoft

Knowledge Base on the following words:

   null and parameter and records

Additional reference words: 1.00 1.10 queries


INF: Debugging & Troubleshooting Tips for Attached SQL Tables

 Article Number: Q102437

 CREATED: 03-AUG-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

Listed below are some techniques that can be used to determine

indirect causes of error messages when using attached SQL tables:

1. Use Microsoft Windows File Manager to search for multiple,

   corrupted, or outdated copies of the following files:

      ODBC.DLL - dated 10-16-92 or later, with 44736 bytes

      DBNMP3.DLL - dated 9-15-92 or later, with 8241 bytes

      SQLSRVR.DLL - dated 10-16-92 or later, with 135792 bytes

      NETAPI.DLL - depends on the network being used

      COMMDLG.DLL - dated 10-25-92 or later, with 89248 bytes

      NOTE: The sizes and dates referenced are correct if the files

      were installed by Microsoft Access version 1.0.

2. Make sure that all the files listed in step 1 are in the

   appropriate locations. All files except NETAPI.DLL are usually

   installed in the Windows SYSTEM subdirectory. NETAPI.DLL is a

   network-specific driver; it is usually located in the network's

   program directory, which should appear in the path.

3. Use another application, such as the three listed below, on the

   same computer and try to attach the same data source:

    - Q+E (comes with Microsoft Excel)

    - SQL Server Administration Facility (SAF)

    - PowerBuilder

   If you cannot access the data source from another application, you

   may have a problem with the network, not with Microsoft Access or

   the Microsoft Open Database Connectivity (ODBC) driver.

4. Try to attach another data source, such as another SQL Server

   table, from a different database server. If you can attach the

   other data source, the original server may be unavailable, or you

   may need to reconfigure the entry for that server using the ODBC

   Administration utility.

5. Try to attach the same data source from a different computer. If

   you still cannot gain access to the SQL Server computer, you may

   have a network-wide problem, or perhaps the server is down or not

   communicating.

6. Try increasing the ODBC time-out settings in the [ODBC] section of

   your MSACCESS.INI file.

7. Rename the current ODBC.DLL, DBNMP3.DLL, and SQLSRVR.DLL files,

   restart the server, and reinstall ODBC.

   For more information on this procedure, see the Microsoft Access

   "User's Guide," version 1.0, Appendix D, "Setting Up Microsoft

   Access on a Network," pages 660-662.

PowerBuilder is manufactured by Powersoft Corporation, a vendor

independent of Microsoft; we make no warranty, implied or otherwise,

regarding this product's performance or reliability.

Additional reference words: 1.00 1.10 2.00 tshoot


INF: Displaying Totals for Each Row in Crosstab Queries

 Article Number: Q102517

 CREATED: 03-AUG-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

Crosstab queries can display totals for each row. To do

this, simply

repeat the field used as the crosstab value and make it a

crosstab row

header.

MORE INFORMATION

The following steps explain how to create a crosstab query

with row

totals:

1. Open the sample database NWIND.MDB.

2. Create a new query based on the Order Review query, as

follows:

      Query: XTAB With Row Totals

      ---------------------------------

      Field: Company Name

         Total: Group By

         CrossTab: Row Heading

      Field: Total Ordered:Order Amount

         Total: Sum

         CrossTab: Row Heading

      Field: Ship Via

         Total: Group By

         CrossTab: Column Heading

      Field: Order Amount

         Total: Sum

         CrossTab: Value

The Total column always appears before the other data

columns, but you

can display the data on a form or report in any order.

REFERENCES

==========

Cue Cards, the Microsoft Access tutorial, walk you through

the

process of creating a crosstab query. On the last step, you

are given

the option to add row totals, using procedures similar to

those shown

above.

For more information, choose Cue Cards from the Help menu

and click

About Cue Cards.

Additional reference words: 1.00 1.10


INF: Using the DDE Item SQLText to Request the Text of a Query

 Article Number: Q102519

 CREATED: 03-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.1 and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access version 1.1 introduces the new DDE item, SQLText,

which can be used to retrieve the SQL statement representing the table

or query topic on which the DDE link has been established.

The SQLText item allows the DDE client to request that the SQLText be

either returned as a whole or divided into substrings. The length of

the substring is specified by the client. The SQLText is returned as

an array of substrings.

This article describes the use of this DDE item to request the text of

a query and place it in a Microsoft Excel worksheet.

MORE INFORMATION

The syntax for the SQLText item name is as follows:

   SQLText;<number>

<number> is the maximum number of characters for each substring. If a

value for <number> is not provided, the entire text is sent as one string.

The last substring of the array may be shorter than the previous

substrings if there are not enough characters.

Creating the Sample Macro

-------------------------

NOTE: The following example assumes that you have a working knowledge

of Microsoft Excel macros. For information on using macros, please

refer to the Microsoft Excel documentation.

The following sample macro should be pasted or entered in a Microsoft

Excel macro sheet, starting with cell A1. (Some formulas are dependent

on starting at that location in the macro sheet.) Also, formulas

designated in opening and closing braces ({}) must be entered as array

formulas, using the CTRL+SHIFT+ENTER key combination. For example, use the

three steps below to yield the following array formula:

   {=FORMULA.ARRAY(TRANSPOSE(SQL))}

1. Go to the cell that contains the formula.

2. Remove the braces ({}).

3. Press CTRL+SHIFT+ENTER.

To verify that the formula is entered as an array, the braces will

reappear around the formula in the Microsoft Excel formula bar. For

more information on using array formulas, please refer to the

Microsoft Excel documentation.

   SQLText

   StringLength=50

   chan=INITIATE("MSACCESS","NWIND.MDB;Query Sales for 1991")

   {=FORMULA.ARRAY(REQUEST(chan,"SqlText;255"),$B$1:$U$1)}

   =IF(LEN($B$1)<255)

   =  SET.NAME("SQLLen",LEN($B$1))

   =ELSE()

   {=  SET.NAME("SQLLen",SUM(IF(ISNA($B$1:$U$1),0,LEN($B$1:$U$1))))}

   =END.IF()

   =SET.NAME("SQLPieces",INT(SQLLen/StringLength)+1)

   =SET.NAME("SQL",REQUEST(chan,"SqlText;"&StringLength))

   =TERMINATE(chan)

   =NEW(1)

   =SELECT("r1c1:r"&SQLPieces&"c1")

   {=FORMULA.ARRAY(TRANSPOSE(SQL))}

   =COPY()

   =PASTE.SPECIAL(3)

   =CANCEL.COPY()

   =FORMULA.REPLACE(CHAR(13)&CHAR(10)," ",2,2,FALSE)

   =COLUMN.WIDTH(,,,3)

   =RETURN()

How the Sample Macro Works

--------------------------

The length of the result string is set to 50, a channel is initiated to the

Microsoft Access query, the SQL statement is requested in 255-character

chunks, and the total length of the query is calculated.

Using SQLLen, the number of rows needed to display the query is

calculated. The SQLText is requested in chunks of 50, based on the

variable StringLength, and then the DDE channel is terminated.

Finally, a new worksheet is opened and the appropriate number of cells

are selected. The Formula.Array() function places the SQLText in the

currently selected cells. The result originally appears as a formula,

but the Copy and Paste.Special() commands change it to text. The

carriage returns and line feeds are changed to spaces and the

ColumnWidth property is set to Best Fit.

Additional reference words: 1.00 1.10 2.00


INF: How to Get Field Data Types from a Table Using DDE

 Article Number: Q102520

 CREATED: 03-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The functionality of the DDE FieldNames item has been enhanced in

Microsoft Access version 1.1 by adding the ability to get the field

type for the field. In Microsoft Access version 1.0, the FieldNames

item could get the field name, but not the field type. The new item is

called FieldNames;T, and can be requested on any open Microsoft Access

database.

Examples showing how to use this DDE feature from Microsoft Excel and

Microsoft Word for Windows are listed below.

MORE INFORMATION

The following sample Microsoft Excel macro demonstrates how to use the

FieldNames;T item to get the field name and field type from the

Categories table in the sample database NWIND.MDB:

1. Start Microsoft Access and open NWIND.MDB.

2. Start Microsoft Excel and open a new worksheet.

3. Select cells A1-D2.

4. Type the formula:

      =MSAccess|'C:\ACCESS\NWIND.MDB;Table Categories'!'Fieldnames;T'

5. Press CTRL+SHIFT+ENTER. This will enter the formula as an array

   formula. The results will be propagated through the selected range.

The following information will be returned:

   Category ID    Category Name    Description    Picture

       10             10               12           11

The numeric values returned describe the data type for the field. The

data types are:

    0    Invalid

    1    True/False (non-Null)

    2    Unsigned byte (Byte)

    3    2-byte signed integer (Integer)

    4    4-byte signed integer (Long)

    5    8-byte signed integer (Currency)

    6    4-byte single-precision floating-point (Single)

    7    8-byte double-precision floating-point (Double)

    8    Date/Time (integral date, fractional time)

    9    Binary data, 255 bytes maximum

   10    ANSI text, not case sensitive, 255 bytes maximum (Text)

   11    Long binary (OLE Object)

   12    Long text (Memo)

The following example for Microsoft Word for Windows demonstrates how

to use the FieldNames;T item to get the field name and field type from

the Categories table in the sample database NWIND.MDB:

1. Start Microsoft Access and open NWIND.MDB.

2. Start Microsoft Word for Windows and open a new document.

3. From the Insert menu, choose Field.

4. Type the following formula in the Field Codes box, and then choose

   OK:

   DDE MSAccess "C:\\ACCESS\\NWIND.MDB;Table Categories" FieldNames;T

The following information will be displayed:

   Category ID    Category Name    Description    Picture

       10              10              12           11

Some formatting of the text may be necessary to align the field type

descriptor numerals under the table names.

NOTE: If you see the formula you typed instead of this data, and you

are using Word 6.0 for Windows, you need to clear the Field Codes

check box on the View tab by choosing Options from the Tools menu. If

you are using Word 2.0 for Windows, choose Field Codes from the View

menu.

Additional reference words: 1.00 1.10 2.00


PRB: "#ERROR" Message When Referencing Subreport Controls

 Article Number: Q102521

 CREATED: 03-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Referencing a subreport control from a main report when the subreport

does not return any matching records results in a "#ERROR" message for the

referenced subreport control.

RESOLUTION

Make sure that any subreport fields referenced in main reports have values

associated with them by adding a function to test for this condition. For

more information, see the "Steps to Solve Problem" section below.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. Create a new query based on the Customers table. Drag the Company Name

   field from the field list to the query grid. Type the following in the

   Criteria field for the column:

      Like "P*"

   Drag the Customer ID field from the field list to the next column on

   the query grid. Save the query as Sorter. Note that this query will

   limit the recordset to only customer records beginning with the letter

   "P", and includes a customer with no orders.

3. Create a new subreport based on the Orders table; call it SubRpt.

4. Drag the Freight field to the detail section of the subreport. In the

   report footer section, place a text box with the following formula

   as the ControlSource property:

      =Sum([Freight])

   Set the ControlName property of the text box to ToTFreight. The

   subreport will print the detailed freight items with a grand total for

   all freight charges.

5. Create a new report called Main Report based on the Sorter query.

6. From the View menu, choose Sorting And Grouping. In the dialog box,

   select Company Name from the Field/Expression combo box and set the

   Group Header property to Yes.

7. Drag the Company Name field to the new Company Name header

   section.

8. Drag the SubRpt subreport from the Database window to the detail

   section of Main Report. Below the subreport, place a label control

   with the caption "Total Order Amount Per Customer:" and a text box

   control with the ControlSource property set to the following formula:

      =([SubRpt].Report![ToTFreight])

   Set both the LinkMasterFields and the LinkChildFields properties

   for the subreport control to [Customer ID]. Setting these properties

   filters the subreport to display the Freight charges per customer.

9. Preview the report.

Note that Parisian Specialties (in version 1.x), or Paris Specialites (in

version 2.0), which has no orders, displays "#ERROR" for the referenced

subreport control.

Steps to Solve Problem

----------------------

1. Create the following new Access Basic function called ErrAvoid():

      Function ErrAvoid (n As Variant)

         On Error GoTo Trap

            ErrAvoid = n

            Exit Function

         Trap:

            ErrAvoid = 0

            Exit Function

      End Function

2. Replace "=([SubRpt].Report![ToTFreight])" in step 8 of the previous

   procedure with the following:

       =ErrAvoid([SubRpt].Report![ToTFreight])

3. Preview the report.

Parisian Specialties, or Paris Specialites, now shows $0.00 dollars in

sales, instead of "#ERROR." The ErrAvoid() function traps for errors that

are caused by the subreport control containing no values. When an error is

encountered, "Object Has No Value," then a value of zero, is assigned to

the main report control.

Additional reference words: 1.00 1.10 2.00 pounderror pounderr link


PRB: "Record Lock Threshold Exceeded" with Large Action Query

 Article Number: Q102522

 CREATED: 03-AUG-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you exceed the maximum number of locks set per connection for the

Novell server, you will get the following error message on the server:

   Record Lock threshold exceeded

This error can also cause the Novell server to crash.

RESOLUTION

To solve this problem, use the following steps:

1. Obtain the TTSFIX.NLM dynamic patch, either directly from Novell or

   from CompuServe. On CompuServe, look for 311PTD.ZIP in the NOVFILES

   forum.

2. Set the Record Lock threshold to some high value greater than the

   default of 500, preferably between 6,000 and 10,000, even though

   the server should no longer crash. However, Microsoft Access may

   still encounter problems when the server exceeds the lock count.

   There are no reports of any problems with the Record Lock threshold

   set to a high value. Even with this maximum set, if the threshold

   is reached, Microsoft Access will stop; with the fix, the Novell

   network will not crash.

3. Load the TTSFIX.NLM dynamic patch on the server to ensure that it

   will not crash if a lock count is exceeded.

   NOTE: The 311LPTD.ZIP file also contains PATCHMAN.NLM and

   TTSFIX.NLM. We recommend that these files be loaded in the

   AUTOEXEC.NCF of the server. This action requires a LOAD

   PATCHMAN.NLM, followed by a LOAD TTSFIX.NLM in the AUTOEXEC.NCF.

The following table details possible lock settings:

                                            Range        Defaults

                                            ---------------------------

#1 SET Maximum record locks per connection: 10-10,000    default 500

#2 SET Maximum file locks per connection:   10-1,000     default 250

#3 SET Maximum record locks:                100-200,000  default 20,000

#4 SET Maximum file locks:                  100-100,000  default 10,000

#1 is the setting that should be increased from the default to some

value within the 6,000 to 10,000 range.

NOTE: This problem is related to the record locks setting on the Novell

server. This problem is not related to the MS-DOS SHARE.EXE locks setting.

Additional reference words: 1.00 1.10 2.00 Novell Server 3.11 out of


PRA: Invalid Characters Added to IN Clause Arguments

 Article Number: Q102523

 CREATED: 03-AUG-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.1

------------------------------------------------------------

---------

SYMPTOMS

When you choose OK from the SQL dialog box, you receive the

error

message

   SQL error in FROM clause.

if the query contains an IN clause.

CAUSE

Microsoft Access version 1.1 incorrectly parses the

arguments for the

IN clause after saving the SQL statement.

RESOLUTION

If you enter the arguments correctly and then save the

query, the

query will run without errors. However, you must correct the

parsing

done by Microsoft Access if you make any changes to the SQL

statement

that you want to commit.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.1. Microsoft is researching this problem and will

post new

information here in the Microsoft Knowledge Base as it

becomes

available.

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB.

2. Attach to the sample dBASE IV file, NEWCUST.DBF, located

in your

   Access program directory.

3. Create a new query base on the attached table, drag

several fields

   to the query grid, and run the query to verify that it

works

   properly.

4. Switch to Design view. From the View menu, choose SQL.

5. After the FROM clause, "FROM NEWCUST", type the

following:

      IN "<c:\access>" "dBASE IV;"

   where <c:\access> is the directory in which you installed

Microsoft

   Access.

6. Choose OK to close the SQL dialog box, then choose OK

again.

7. Run the query.

8. Switch back to Design view. From the View menu, choose

SQL.

   Microsoft Access has changed your IN clause to:

      IN 'c:\access'["dBASE IV;"]

   If you choose OK, the following error message is

displayed:

      Syntax error in From clause

   You must choose Cancel or correct the IN clause.

Additional reference words: 1.10 IN clause attach


INF: How to Disable the Menu Bar When Previewing a Report

 Article Number: Q102524

 CREATED: 03-AUG-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Although you can display a custom menu bar in a form in Microsoft Access

version 1.x, there is no way to display a custom menu bar when previewing a

report. However, you can completely remove the menu bar when previewing a

report using Microsoft Windows API calls. This article demonstrates a

sample Access Basic function that you can use to remove the menu bar when

previewing a report.

Microsoft Access version 2.0 has built-in functionality to create a custom

menu for a report. For more information about creating custom menus, search

for "custom menus" using the Microsoft Access 2.0 Help menu.

MORE INFORMATION

The technique presented in this article removes the menu bar when in

Print Preview. To also remove the toolbar, choose Options from the

View menu and set Show Tool Bar to No.

The Access Basic code below needs to be called for each report every time

you switch to Print Preview. If you display another report after calling

this code, Microsoft Access will re-establish the Print Preview menu.

NOTE: The menu for the report is also re-established if switching from

the report to a form and then back to the report. If the window from

which the report is called is maximized, then the display may become

erratic. Symptoms of an erratic display include duplications of the

Control menu icon and the Min/Max icons before the report appears.

To remove the menu bar that appears when you are printing a report,

use the following steps:

1. Create the new module below.

   NOTE: In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

   NOTE: You may have some Microsoft Windows API functions defined in an

   existing Microsoft Access library; therefore, your declarations may be

   duplicates. If you receive a duplicate procedure name error message,

   remove or comment out the declarations statement in your code.

   '******************************************************************

   'Declarations section of the module

   '******************************************************************

   Option Explicit

   Declare Function FindWindow% Lib "user" (ByVal lpClassName As Any,_

                       ByVal lpCaption As Any)

   Declare Function SetMenu% Lib "User" (ByVal hWnd%, ByVal hMenu%)

   '==================================================================

   'The following function removes the Microsoft Access menu bar by:

   ' - Retrieving the Microsoft Access window handle with FindWindow.

   ' - Removing the Microsoft Access menu bar with SetMenu.

   '==================================================================

   Function RemoveAccessMenu ()

      Dim hWnd%, dummy%

      hWnd% = FindWindow("OMain", 0&)

      dummy% = SetMenu(hWnd%, 0)

   End Function

2. In the report in which you want to disable the menu bar, set the

   OnFormat or OnPrint property of the first section that prints (such

   as the Report Header section) to call the RemoveAccessMenu()

   function:

      OnFormat: =RemoveAccessMenu()

REFERENCES

==========

"Programmer's Reference Library: Microsoft Windows 3.1 Guide to

Programming Reference," Volumes 1-6, Microsoft Press, 1992

Additional reference words: 1.00 1.10 menubar security


PRA: SQORA.DLL Does Not Allow Lengthy SQL Statements

 Article Number: Q102525

 CREATED: 03-AUG-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.1

------------------------------------------------------------

---------

SYMPTOMS

When you are executing a query against, or updating a record

in, an

Oracle table, the following error message is displayed

   Statement was longer then allowable maximum 2000+ chars

if the table and field names are long or the query is

complex.

CAUSE

This occurs because of a problem with SQORA.DLL, the Oracle

ODBC

driver.

RESOLUTION

Obtain and install the updated driver, or use queries to do

updates,

rather than updating records with the Oracle table in

Datasheet view.

The query should yield only the columns to be updated.

For complex queries, reduce both the number of tables or

joins in the

query and the number of fields used or shown in the query.

These workarounds reduce the lengths of SQL statements.

STATUS

Microsoft has confirmed this to be a problem in the Oracle

ODBC driver

shipped with Microsoft Access version 1.1 and Microsoft

Visual Basic

version 3.0 (Professional Edition). An updated driver that

corrects

this specific problem is available from Microsoft.

MORE INFORMATION

How to Obtain the Updated Driver

--------------------------------

ORA110.EXE, a self-extracting zipped file, can be downloaded

from the

MSACCESS forum on CompuServe (Library 11, ODBC

Connectivity), or from

the Microsoft Software Data Library (MSDL).

If you are unable to download the file, Microsoft Product

Support

Services (PSS) will send you the file on disk by mail. This

disk also

contains the updated Btrieve driver.

NOTE: This driver is for use by registered owners of

Microsoft Access

1.1 and Visual Basic 3.0 (Professional Edition) only. By

installing

these files, you are indicating that you own one of these

two

products.

PSS Disk Contents

-----------------

The PSS disk contains the following files:

   README.TXT

   BTRV110.DLL

   ORACLE.TXT

   SQORA.DL_

   SQORASTP.DL_

   ODBC.INF

   SETUP.EXE

NOTE: The SETUP.EXE file is called by the ODBC control panel

facility

and will not run as a stand-alone file.

The following two files are actually updated:

                          Old                     New

                --------------------------------------------

---

SQORA.DLL       Version:  1.00.2816     Version:  1.00.3112

                   Size:  143,600 bytes    Size:  144,096

bytes

                   Date:  4/16/93          Date:  7/12/93

SQORASTP.DLL    Version:  1.00.2403     Version:  1.00.3106

                   Size:  9,328 bytes      Size:  9,632

bytes

                   Date:  5/7/93           Date:  7/6/93

A README.TXT file documents the changes to the Btrieve and

Oracle

drivers and the installation procedures for each.

Oracle drivers are manufactured by Oracle Corporation and

Btrieve

drivers by Novell, Inc., vendors independent of Microsoft;

we make no

warranty, implied or otherwise, regarding these products'

performance

or reliability.

Additional reference words: 1.10


PRA: GP Fault Printing Large Report with Low Disk Space

 Article Number: Q102526

 CREATED: 03-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You get a general protection (GP) fault when you try to print a large

report and have very little free hard disk space.

RESOLUTION

Either free up hard disk space or reduce the size of your report.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

versions 1.0 and 1.1. This problem no longer occurs in Microsoft Access

version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Make sure that you have 12K or less of free disk space on your

   computer.

2. Start Microsoft Access and open the sample database NWIND.MDB.

3. Print the Customer Mailing Labels report.

   You receive a GP fault.

Additional reference words: 1.00 1.10 GPF Printing


INF: How to Check for Duplicate Values in Primary Key Fields

 Article Number: Q102527

 CREATED: 03-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you are adding records, Microsoft Access does not normally check the

values in primary key fields for duplicates until you move to the next

record. If you enter an invalid or duplicate value in a control and move

to the next record, you may invalidate all previous entries. However,

there is a method to force an immediate check for duplicate values. This

article describes how to check for duplicate values immediately.

MORE INFORMATION

The following example uses the Customers form in the sample database

NWIND.MDB. The Customers form is based on the Customers table; Customer

ID is the primary key in the table:

1. Create the following new macro. Make sure to choose Conditions

   from the View menu before you begin entering this macro:

   NOTE: In the following sample macro, an underscore (_) is used as a

   line-continuation character. Remove the underscore when re-creating

   this macro.

      MacroName   Condition                                Action

      ----------------------------------------------------------------

      IsItDup     DCount("[customer id]","customers",_     MsgBox

                  "[customer id]=Form.[customer id]")<>0

                  ...                                      CancelEvent

      IsItDup Actions

      ------------------------

      MsgBox

         Message: Duplicate ID

      CancelEvent

2. Open the Customers form in Design view. Change the BeforeUpdate

   property of the Customer ID field as follows:

      Text Box: Customer ID

         BeforeUpdate: IsItDup

After you make this change, adding a duplicate value in the Customer ID

field will result in an error message. The insertion point will remain in

the field so that you can change the value.

Additional reference words: 1.00 1.10 2.00 count before update fasttips


PRB: Filtering Form with OpenForm Action Causes "#Name?" Error

 Article Number: Q102670

 CREATED: 08-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A form that is opened with an OpenForm action, which specifies a query

for the Filter Name argument, may display a "#Name?" error message for

some controls.

CAUSE

When a query is specified as the filter for the OpenForm action, the

form is bound to the fields in the query. If the form contains

controls bound to fields that are not included in the query, those

controls display the "#Name?" error message.

RESOLUTION

Switch to Design view and either change the query so that it contains

all the fields used in the form, or clear the Restrict Available

Fields check box.

MORE INFORMATION

A similar problem may occur with a report that is filtered by a query

that does not contain all the same fields. The report gives parameter

prompts for all fields not included in the query.

Steps to Reproduce Behavior

---------------------------

1. In the sample database NWIND.MDB, create a query called Filter

   Customers By Letter A based on the Customers table. Set the

   properties as follows:

      Query: Filter Customers By Letter A

      -----------------------------------

      Type: Select Query

      Field: Customer ID

         Table: Customers

         Criteria: Like "a*"

2. From the View menu, choose Query properties to verify that the

   Restrict Available Fields check box is selected.

3. Create the following macro and call it Open Filtered Customers:

      Macro Name                Action

      ----------------------------------

      Open Filtered Customers   OpenForm

      Open Filtered Customers Actions

      -------------------------------

      OpenForm

         Form Name: Customers

         Filter Name: Filter Customers By Letter A

4. Run the macro. Note that all the controls in the Customer form,

   except for [Customer ID], display the "#Name?" error message.

Workaround

----------

1. Open the Filter Customers By Letter A query in Design view.

2. From the View menu, choose Query Properties. Clear the

   Restrict Available Fields check box.

3. Choose OK and save the query. The form now displays the correct

   values for all controls.

REFERENCES

==========

Microsoft Access "User's Guide," versions 1.0 and 1.1, pages 532-534, 558

Additional reference words: 1.00 1.10 2.00 poundname


INF: Using Access Basic CopyFile() Function to Copy Disk Files

 Article Number: Q102671

 CREATED: 08-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Access Basic does not have a command, such as the MS-DOS COPY command,

to copy a disk file.

This article includes two variations of an Access Basic function

called CopyFile(), both of which allow you to copy disk files.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

Two variations of the Access Basic CopyFile() function are provided

below. The first version uses only Microsoft Access Basic code; the

second leverages some function calls to the Windows application

programming interface (API) to optimize performance, particularly with

larger files.

NOTE: You may have some Windows API functions defined in an existing

Microsoft Access library; therefore, your declarations may be

duplicates. If you receive the duplicate procedure name error message

when you compile or run your code, remove or comment out the

appropriate declarations statement from your code.

NOTE: In the following sample code, an underscore (_) is used as a

line-continuation character. Remove the underscore when re-creating

this code in Access Basic.

Method 1: CopyFile() Function Using Standard Access Basic Code

--------------------------------------------------------------

'**************************************************************

' DECLARATION SECTION

'**************************************************************

Option Explicit

'**************************************************************

' FUNCTION: CopyFile()

' PURPOSE:

'   Facilitates copying a disk file.

' ARGUMENTS:

'   Source      - The path\filename of the file to copy from.

'   Destination - The path\filename of the file to copy to.

' RETURN:

'   The length of the file copied.

'**************************************************************

Function CopyFile (ByVal Source$ ByVal Destination$) As Long

    Dim Index As Integer, NumBlocks As Integer

    Dim FileLength As Long, LeftOver As Long, AmountCopied As Long

    Dim SourceFile As Integer, DestFile As Integer

    Dim FileData As String

    Dim RetVal As Variant

    Const BlockSize = 32768

    On Error GoTo Err_CopyFile

    ' Remove the destination file.

    DestFile = FreeFile

    Open Destination For Output As DestFile

    Close DestFile

    ' Open the source file to read from.

    SourceFile = FreeFile

    Open Source For Binary Access Read As FreeFile

    ' Open the destination file to write to.

    DestFile = FreeFile

    Open Destination For Binary As DestFile

    ' Get the length of the source file.

    FileLength = LOF(SourceFile)

    ' Calculate the number of blocks in the file and left over.

    NumBlocks = FileLength \ BlockSize

    LeftOver = FileLength Mod BlockSize

    ' Create a buffer for the leftover amount.

    FileData = String$(LeftOver, 32)

    ' Read and write the leftover amount.

    Get SourceFile, , FileData

    Put DestFile, , FileData

    ' Create a buffer for a block to be read.

    FileData = String$(BlockSize, 32)

    ' Read and write the remaining blocks of data.

    For Index = 1 To NumBlocks

       ' Read and write one block of data.

       Get SourceFile, , FileData

       Put DestFile, , FileData

    Next Index

    Close SourceFile, DestFile

    CopyFile = AmountCopied

Bye_CopyFile:

    Exit Function

Err_CopyFile:

    CopyFile = -1 * Err

    Resume Bye_CopyFile

End Function

Method 2: CopyFile() Function Using Standard Access Basic Code

--------------------------------------------------------------

'****************************************************************

' DECLARATION SECTION

'****************************************************************

Declare Function fWrite Lib "kernel" Alias "_lwrite" (ByVal hFile%,

                    ByVal lpBuff&, ByVal nBuff%) As Long

Declare Function fRead Lib "kernel" Alias "_lread" (ByVal hFile%,

                    ByVal lpBuff&, ByVal nBuff%) As Long

Declare Function GlobalAlloc Lib "Kernel" (ByVal wFlags%,

                    ByVal dwBytes&) As Integer

Declare Function GLobalFree Lib "kernel" (ByVal hMem%) As Long

Declare Function GlobalLock Lib "Kernel" (ByVal hMem%) As Long

Declare Function GLobalUnlock Lib "kernel" (ByVal hMem%) As Long

'****************************************************************

' FUNCTION: CopyFile()

' PURPOSE:

'   Facilitates copying a disk file.

' ARGUMENTS:

'   Source      - The path\filename of the file to copy from.

'   Destination - The path\filename of the file to copy to.

' RETURN:

'   The length of the file copied, if successful.

'***********************************************************

Function CopyFile (ByVal Source$, ByVal Destination$) As Long

    Dim FileLength As Long, AmountCopied As Long

    Dim RetVal As Variant, lpBuff As Long

    Dim DestFile As Integer, SourceFile As Integer

    Dim DestDOS As Integer, SourceDOS As Integer

    Dim ApiErr As Integer, AmtRead As Integer

    Dim hMem As Integer

    Const nBuff = 32767

    Const wFlags = &H20

    On Error GoTo Err_CopyFile

    ' Get the size of the file.

    SourceFile = FreeFile

    Open Source For Binary Access Read As SourceFile

    FileLength = LOF(SourceFile)

    Close SourceFile

    ' Allocate and lock memory to buffer file contents.

    hMem = GlobalAlloc(wFlags, nBuff)

    lpBuff = GlobalLock(hMem)

    ' Open the source file to read from.

    SourceFile = FreeFile

    Open Source For Input As SourceFile Len = 1

    ' Open the destination file to write to.

    DestFile = FreeFile

    Open Destination For Output As DestFile Len = 1

    ' Get the operating system file handles.

    DestDOS = FileAttr(DestFile, 2)

    SourceDOS = FileAttr(SourceFile, 2)

    Do

       ' Read and write nBuff worth of data.

       AmtRead = fRead(SourceDOS, ByVal lpBuff, nBuff)

       ApiErr = fWrite(DestDOS, ByVal lpBuff, AmtRead)

       AmountCopied = AmountCopied + AmtRead

    Loop Until AmtRead = 0

    Close SourceFile, DestFile

    ' Unlock and free the file buffer memory.

    lpBuff = GLobalUnlock(hMem)

    hMem = GLobalFree(hMem)

    CopyFile = AmountCopied

Bye_CopyFile:

    Exit Function

Err_CopyFile:

    CopyFile = -1 * Err

    Resume Bye_CopyFile

End Function

The CopyFile() function can be tested from the Immediate window, as

follows:

1. Create or open a module in Microsoft Access.

2. From the View menu, choose Immediate Window.

3. Type the following and press ENTER:

      ? CopyFile(C:\WINDOWS\CHESS.BMP", "C:\CHESS.BMP")

   The CopyFile() function can be invoked from an Access Basic

   function

      Dim RetVal As Long

      RetVal = CopyFile("C:\WINDOWS\CHESS.BMP", "C:\CHESS.BMP")

   or by using the RunCode macro action:

      RunCode

      Function Name: CopyFile("C:\WINDOWS\CHESS.BMP", "C:\CHESS.BMP")

Additional reference words: 1.00 1.10 2.00


INF: How to Simulate Changing RecordSource Property of Report

 Article Number: Q102672

 CREATED: 08-AUG-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Although you cannot actually change the RecordSource property of a

report, you can simulate the change by using a OpenReport macro action

and calling a different query source from the Filter Name argument.

MORE INFORMATION

The Filter Name argument must reference a query that contains the same

number of fields (with the same names) as appear in the existing

report. If the fields do not exist in the query, the report may

display the "#Name?" error message for controls bound to those fields.

To simulate changing the RecordSource property of a report called

MyReport, do the following:

1. Create a new report called MyReport.

2. Create a new query called MyNewQuery, using the same fields that

   appear in MyReport.

3. Create a macro with one action as follows:

      OpenReport

      -----------------------

      Report Name: MyReport

      View: Print Preview

      Filter Name: MyNewQuery

   NOTE: A SQL statement cannot be substituted for the query name.

Using this method, you can use the same report to print data from

multiple data sources.

REFERENCES


INF: List of Articles Relating to MSACCESS.INI File

 Article Number: Q102673

 CREATED: 08-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

The following is a list of articles found in the Microsoft Knowledge

Base that relate in some way to the MSACCESS.INI file:

   ARTICLE#             TITLE & DESCRIPTION

   --------             -------------------

   Q88175      INF: Creating, Debugging, and Using an Access Library

               (Refers to the [Libraries] section)

   Q88648      INF: Easy Way to Add Items to the Help Menu

               (Refers to the [Menu Add-Ins] section)

   Q90105      INF: Could not Find SYSTEM.MDA or UTILITY.MDA File

               (Refers to the [Options] section)

   Q98224      PRB: ErrMsg: Couldn't Open Table MSysAccounts

               (Refers to the [Options] section)

   Q96996      INF: How to Change the Font for the Zoom Box

               (Refers to the [Options] section)

   Q90170      INF: How to Make Access Opening Screen Display

               (Refers to the [Microsoft Access] section, Tutorial

               setting only)

   Q95051      PRB: Unable to Connect to Attached SQL Server Table,

               Error Msg

               (Refers to the [SQLSERVER] section of the WIN.INI

               file)

   Q101323     INF: Five Parameters to Set in ISAM Section of

               MSACCESS.INI

               (Refers to the [ISAM] section)

   Q95388      INF: Doc Err: dBASE SET DELETED Characteristic in

               MS Access

               (Refers to the [dBASE ISAM] section, Deleted

               setting only)

   Q98805      PRB: Internal Database Error (-5207) When Attaching

               Tables

               (Refers to the [Paradox ISAM] section,

               CollatingSequence only)

   Q100176     INF: Upper Limit on QueryTimeout and LoginTimeout

               (Refers to the [ODBC] section)

   Q100972     INF: Forcing Access to Use Snapshot Method on Attached

               Data

               (Refers to the [ODBC] section)

   Q95050      PRB: Data Source Not Found, No Default Driver Specified

               Error

               (Refers to the ODBC.INI file)

   Q103173     PRACC9307: Options in Form and Report Wizards Do Not

               Display

               (Refers to the [Form Wizards], [Report Wizards] and

                [Libraries] sections)

Additional reference words: 1.00 1.10 2.00 Initialization x-ref


PRB: Tops of Letters May Be Cut Off with Some PostScript Fonts

 Article Number: Q102921

 CREATED: 12-AUG-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00

------------------------------------------------------------

-------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

-------

SYMPTOMS

If you print Microsoft Access documents to a PostScript

printer using

certain PostScript fonts, the tops of taller letters may be

cut off,

even though the letters display correctly when you preview

the document.

Microsoft has reproduced this problem with the

CoventryScript font,

supplied in the Fluent Laser Fonts package manufactured by

Casady &

Greene, Inc. This problem may also occur with other

PostScript Type 1

fonts that have tall ascenders or tall capital letters.

CAUSE

This problem occurs because of the method Microsoft Access

uses to

define cutoff regions for control boxes.

RESOLUTION

Microsoft has confirmed this to be a problem in Microsoft

Access

version 1.0. This problem was corrected in Microsoft Access

version

1.1.

MORE INFORMATION

Fluent Laser Fonts are manufactured by Casady & Greene,

Inc., a vendor

independent of Microsoft; we make no warranty, implied or

otherwise,

regarding these products' performance or reliability.

Additional reference words: 1.00 PtrIss PSCRIPT.DRV ATM Adobe Type

Manager


PRB: "#NAME?" Error Referring to Combo Box Column in Subform

 Article Number: Q103129

 CREATED: 18-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You can refer to a particular column of a combo box in a text box on a form

using the .Column property as follows:

   =Forms![Formname]![ControlName].Column(x).

However, if the combo box is on a subform, the text box returns the

message:

   #Name?

RESOLUTION

To work around this behavior, you can refer to the column of the combo box

that is on the subform through the main form, even though the text box is

actually on the subform.

For a subform with a combo box and a text box, the following syntax returns

the correct result:

   =Forms![MainForm]![Subform].Form![Controlname].Column(x)

NOTE: Columns are numbered starting with 0, not with 1.

Additional reference words: 1.00 1.10 2.00 poundname


INF: How to Export the Results of a Query

 Article Number: Q103130

 CREATED: 18-AUG-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SUMMARY

Microsoft Access does not provide a direct way to export the results

of a query directly to a file using the Export command from the File

menu. After the user selects Export from the File menu and selects an

output format, the Select Microsoft Access Object dialog is

presented which lists only tables, not queries, from the current

database.

MORE INFORMATION

The following information discusses two ways to export the results of

a query to a file.

1. Method 1: Uses the Transfer macro actions (TransferText,

   TransferDatabase, TransferSpreadsheet) to export query results

   directly to a file.

2. Method 2: Uses a Make Table query to save the results to a new

   table. Once this table exists, it can be exported by choosing Export

   from the File menu.

Method 1: Transfer Macro Action

-------------------------------

The three Transfer macro actions: TransferText, TransferSpreadsheet,

and TransferDatabase were designed to help automate the process of

exporting (and importing) data from the file menu. These commands can

also be used to facilitate exporting data from a query directly to a

file.

The following examples use the Employee Sales for 1991 query included

with the sample database NWIND.MDB supplied with Microsoft Access.

Example A

---------

To export a query to a comma delimited text file using TransferText:

1. Open NWIND.MDB.

2. Choose the Macro button, then the New button, from the Database

   window. This will present you with a new macro grid containing

   Action and Comments columns.

3. In the Action column choose TransferText.

4. Below the macro grid you will see the arguments that need to be

   filled in for the TransferText action. Fill them in with the

   following settings:

    Action: TransferText

    --------------------

       Transfer Type: Export Delimited

       Specification Name: <leave empty>

       Table Name: Employee Sales for 1991

       File Name: C:\EMPSALES.TXT

       Has Field Names: Yes

   NOTE: You can specify the name of a query in the Table Name

   argument.

5. Choose Save from the File menu, type a unique macro name, and press

   ENTER.

6. Choose Run from the Macro menu to execute the macro. Microsoft

   Access will run the query and save the results to the specified

   destination file name (EMPSALES.TXT).

Example B

---------

To export a query as a DBase IV file using TransferDatabase:

1. Follow steps 1-3 for TransferText, but choose TransferDatabase as

   the macro action.

2. Fill in the macro arguments with the following settings:

   Action: TransferDatabase

   ------------------------

      Transfer Type: Export

      Database Type: dBASE IV

      Database Name: c:\

      Object Type: Query

      Source: Employee Sales for 1991

      Destination: EMPSALES

      Structure Only: No

3. Follow steps 5-6 for TransferText.

Example C

---------

To export a query as an Excel spreadsheet using TransferSpreadsheet:

1. Follow steps 1-3 for TransferText, but choose TransferSpreadsheet

   as the macro action.

2. Fill in the macro arguments with the following settings:

   Action: TransferSpreadSheet

   ---------------------------

      Transfer Type: Export

      Database Type: Microsoft Excel

      Table Name: Employee Sales for 1991

      File Name: c:\empsales.xls

      Has Field Names: No

      Range: <leave empty>

   NOTE: You can specify the name of a query in the Table Name

   argument.

3. Follow steps 5-6 for TransferText.

Method 2: Make Table Query

--------------------------

Use a Make Table query to export the query results to a table. Once

the data is in a new table, the Export command from the File menu can

be used to export the data to a file.

The disadvantage of this approach is that a new table increases the

size of your database. After you export the data, the table is no

longer needed. If you delete the table, Microsoft Access will not

reclaim the once occupied space until you compact the database file.

The following examples use the "Employee Sales for 1991" query

included with the sample database NWIND.MDB.

1. Open NWIND.MDB.

2. Choose the Query button in the Database window, select Employee

   Sales for 1991, and choose the Design button.

3. Choose Make Table from the Query menu.

4. In the Table Name box, type a unique table name where the data will

   be exported to. Choose OK.

5. Choose Run from the Query menu. The query stores the results in the

   new table.

   You may want to save this query and give it a new name via the Save

   As command on the File menu if you need to export the results

   regularly.

6. Use the Export command from the File menu to export the new table's

   contents to a file.

REFERENCES


PRA: Error Previewing Subreports that Call Filter Macro

 Article Number: Q103131

 CREATED: 18-AUG-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you attempt to print a form or report containing a subreport/subform

that calls a macro that in turn executes an ApplyFilter action, then you

call that macro from the OnOpen property of the subreport/subform, the

following error message is displayed:

   Action isn't valid because the form or report isn't bound to a

   table or query.

Even if you do not receive this error message, note that the ApplyFilter

action has not been executed. Currently, this functionality is not

available.

CAUSE

When printing, Microsoft Access erroneously attempts to apply the

filter that is run from the macro to the outermost (main) report/form,

rather than to the subreport/subform.

The error occurs because the main report/form does not contain a

RecordSource to perform the ApplyFilter action against.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1 and 2.0. Microsoft is researching this problem and will post new

information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. Create a new macro that executes an ApplyFilter action. Enter

   criteria such as the following for the Where condition:

      [Last Name]="Fuller"

3. Create a new, blank, unbound report.

4. Drag the Employee Sales Subreport from the Database window to

   create a subreport on the new report.

5. Double-click the subreport to edit it. For the OnOpen property of

   the subreport, select the macro you created in step 2 from the

   combo box.

6. Preview the report. The following error message appears:

      Action isn't valid because the form or report isn't bound

      to a table or query.

7. Change the RecordSource property of the main report to point to the

   Employees table.

8. Preview the report. Note that the error message no longer appears,

   however, neither the subreport nor the main report have been filtered.

Additional reference words: 1.00 1.10 2.00 Subreports Reports Subforms


INF: OpenQuery Is Not Method; Use OpenQueryDef Instead

 Article Number: Q103132

 CREATED: 18-AUG-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

The examples on pages 132 and 133 of the Microsoft Access "Introduction

to Programming" manual incorrectly use OpenQuery as a method. OpenQuery

is an action, not a method. Instead, the OpenQueryDef method should be

used in the examples on pages 132 and 133.

MORE INFORMATION

Change the third line of the example on page 132 from

   Set Q = db.OpenQuery("Sales Totals")

to:

   Set Q = db.OpenQueryDef("Sales Totals")

Change the third line of the example on page 133 from

   Set Q = db.OpenQuery("Update Sales")

to:

   Set Q = db.OpenQueryDef("Update Sales")

REFERENCES


PRA: DISTINCTROW Keyword Ignored in a Cartesian Product

 Article Number: Q103133

 CREATED: 18-AUG-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.1

------------------------------------------------------------

---------

SYMPTOMS

Your query dynaset includes duplicate records, which should

have been

eliminated by the presence of the keyword DISTINCTROW.

CAUSE

This problem occurs if no join is specified between the

tables in the

query.

RESOLUTION

To hide the duplicate records, verify that the query output

includes

one field that uniquely identifies each record, then replace

the

keyword DISTINCTROW with the keyword DISTINCT.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access version

1.1. This problem no longer occurs in Microsoft Access

version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create a new query based on the Customers and Orders

tables. Join

   the tables on the Customer ID field.

3. Drag the Contact Name field to the query grid and run the

query.

   Note that your dynaset contains 90 records.

4. Switch to Design view and delete the join line between

the tables.

5. Add the following criteria in the Contact Name field on

the query

   grid:

      Customers.[Customer ID] = Orders.[Customer ID]

6. Run the query. The dynaset now contains 1078 records.

Contact names

   from companies that have placed multiple orders are

displayed

   multiple times.

REFERENCES

==========

Search for "ALL," "DISTINCT," "DISTINCTROW," and "Predicates

(SQL)"

using the Microsoft Access Help menu.

Microsoft Access "User's Guide," version 1.1, page 187

Additional reference words: 1.10 relationship many-to-many


INF: How to Search the CompuServe Knowledge Base

 Article Number: Q103134

 CREATED: 18-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to access the Microsoft Knowledge Base

(MSKB) forum on the CompuServe Information Service (CIS).

MORE INFORMATION

The MSKB is completely menu driven. Articles are broken up into three

different groups: INF, PRB, and PRACC articles. INF articles are those

that provide "how to" procedures or advanced tips and tricks. PRB

articles contain perceived problems that are actually associated with

either incorrect use of the product or "by-design" characteristics of

the product. PRACC articles document known problems with Microsoft

Access or other products that may cause problems with Microsoft

Access, such as video drivers.

The text below is a sample script in which a user is searching for all

articles that are associated with PRACC articles. The >> symbol is

used in this article to point out user input.

------------------------------

 Start of sample script

------------------------------

   >>GO MSKB

   One moment please...

   Knowledge Base+

   Welcome to The Microsoft Knowledge Base

   Copyright (c) 1993 Microsoft Corporation

    1 What's New in the Knowledge Base

    2 Description of Database

    3 Online User's Guide

    4 Search the Knowledge Base

    5 Search using Expert Mode

    6 Quick Search - By Document Id Number

    7 Microsoft Software Library

   >>4

   Knowledge Base+

   Current selection: 33378 record(s)

   SELECT SEARCH CRITERIA:

    1 Product Name            [  ]

    2 Product Version         [  ]

    3 Publication Date        [  ]

    4 Operating Environment   [  ]

    5 Document Type           [  ]

    6 Document Text           [  ]

    7 Title Text              [  ]

    8 Display Results

    9 Begin a New Search

   >>7

   You may enter up to 3 words/phrases, one at each prompt.

   Only records indexed under all specified words/phrases will be

   located.

      Words/phrases:

           1: >>PRACC

      and  2:

   Knowledge Base+

   Current selection: 79 record(s)

   SELECT SEARCH CRITERIA:

    1 Product Name            [  ]

    2 Product Version         [  ]

    3 Publication Date        [  ]

    4 Operating Environment   [  ]

    5 Document Type           [  ]

    6 Document Text           [  ]

    7 Title Text              [ PRACC ]

    8 Display Results

    9 Begin a New Search

   >>8

   Knowledge Base+

   Search Results: 7 records

   Enter "/DOWN" to download document

    1 PRACC9301: Wrong RowSourceType for combo box Causes GP Fault

    2 PRACC9302: Importing Delimited Text Files Strips Off Decimals

    3 PRACC9303: Screen Redraw Problems When Reordering Groups

    4 PRACC9303: Error: Not Enough System Resources in Access

    5 PRACC9303: Setting OLE Object Property May Cause GP Fault

    6 PRACC9303: Orders Form Does not Print/Preview SubTotal & Total

    7 PRACC9210: '#' Appears in Attached Table Name in Error Message

------------------------------

 End of sample script

------------------------------

NOTE: CIS is a service independent of Microsoft; we make no warranty,

implied or otherwise, regarding its performance or reliability.

Additional reference words: 1.00 1.10 2.00


INF: Macro to Check for Duplicate Values in a Field

 Article Number: Q103135

 CREATED: 18-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article demonstrates how to use a macro using the DLookup()

function to check for duplicate values in a field.

MORE INFORMATION

Microsoft Access provides automatic checking for duplicate values in a

field that has been designated as the primary key. However, this

check occurs after all fields for a record have been entered, just

before the record is committed to the database. The following sample

macro is based on the sample database NWIND.MDB and will perform a

duplicate check as the data in a field is entered:

NOTE: In the following sample code, an underscore (_) is used as a

line-continuation character. Remove the underscore when re-creating

this code.

1. Open the NWIND.MDB database.

2. Create a new form based on the Customers table.

3. Create a new macro as follows:

      Macro Name     Condition     Action

      --------------------------------------

      MyMacro        1.            MsgBox

                     ...           SendKeys

      1. DLookup("[Customer ID]", "Customers", "[Customer ID] = _

            Form.[Customer ID]") is Not Null

      MyMacro Actions

      --------------------------------------

      MsgBox

         Message: That value already exists.

      SendKeys

         Keystrokes: +{TAB}

         Wait: No

   Note that the ellipsis (...) under the condition indicates that the

   condition controls both macro actions. The SendKeys action will

   return the cursor to the field just exited.

4. In Design view for the form, attach this macro to the AfterUpdate

   property of the Customer ID control.

5. In Form view, make a note of the value of the current Customer ID.

6. From the Records menu, choose Data Entry to add a new record.

7. Enter the value of the earlier noted Customer ID. The message box

   with your message will appear and the cursor will be returned to

   the Customer ID field.

REFERENCES

==========

Microsoft Access "User's Guide," Chapter 22, and Appendix C

Additional reference words: 1.00 1.10 2.00 validate same validationrule


PRA: Open OLE Objects Not Saved When Record Changes

 Article Number: Q103136

 CREATED: 18-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you are editing an OLE object that is opened from an OLE field and

you then move to a different record, there is no indication that the

record was changed. The OLE object in the OLE server is closed and all

changes to the object are lost.

RESOLUTION

Version 1.0 Workaround

----------------------

One way to work around this problem in Microsoft Access version 1.0 is

to call an Access Basic function in the OnExit property of the object.

The function prompts you to verify that the object has been

updated. The following is an example of this function:

1. Place the function called =ProcessOLEObject() in the OnExit

   property of the OLE object.

2. Create the following module:

   Function ProcessOLEObject ()

      Saved = MsgBox("Have you saved your changes for this object?", 36)

      If Saved = 7 Then

         DoCmd CancelEvent

         DoCmd DoMenuItem A_FormBar, A_EditMenu, A_Object, A_ObjectUpdate

      End If

   End Function

Every time you pass through the OLE field, the function will be run

and the dialog box displayed. Unfortunately, there is no way to test

whether or not the object has been edited.

Version 1.1 and 2.0 Workaround

------------------------------

In Microsoft Access versions 1.1 and 2.0, a dialog box appears, indicating

that the object is editable and giving you the option to update the object

before moving on to the next record.

For example, the following message appears after you open one of the

pictures in the Employees table in the sample database NWIND.MDB:

   The object "Paintbrush Picture" is open for editing and may have

   been modified. Update before saving? Yes, No, Cancel or Help

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB in Microsoft Access version 1.0.

2. Open the Employees form.

3. Double-click the image that you want to edit. This action will

   start Paintbrush.

4. Make some change to the image.

5. Press ALT+TAB to return to Microsoft Access without saving the

   image.

6. Move to the next record.

If you press CTRL+ESC to view the task list, you will note that Paintbrush

is no longer available. If you go back to the record you were editing, the

picture will not contain the changes you made.

Additional reference words: 1.00 1.10 2.00 photo


PRB: Undo Cut Does Not Restore Previous Clipboard Contents

 Article Number: Q103137

 CREATED: 18-AUG-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Choosing Undo Cut from the Edit menu does not restore the Clipboard

to its previous state.

STATUS

This behavior is by design.

MORE INFORMATION

There are many cases in which restoring previous data to the Clipboard

does not work (for example, if Clipboard data was imported from

another application).

Steps to Reproduce Behavior

---------------------------

1. Create a new, unbound form.

2. Add a label containing the text "Hello" (without quotation marks).

3. Add another label containing the text "Good-bye" (without quotation

   marks).

4. Select the "Hello" label. From the Edit menu, choose Copy. The Clip-

   board now contains this label.

5. Select the "Good-bye" label. From the Edit menu, choose Cut. The

   contents of the Clipboard have now been replaced with the "Good-bye"

   label.

6. From the Edit menu, choose Undo Cut. Then choose Paste from the Edit

   menu.

REFERENCES

==========

For more information, search for "undo changes", then "undoing changes"

using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 WinIss reports forms


INF: Function to Get Date of Monday Prior to Current Day

 Article Number: Q103138

 CREATED: 18-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article contains a function to find the date of the Monday prior

to the current day.

MORE INFORMATION

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

The following function determines Monday's date according to the

following criteria:

 - If the current date is Tuesday through Sunday, it yields the prior

   Monday's date.

 - If the current day is Monday, it returns the current date.

 - If the date is Null or is not a valid date, it returns Null.

   Function GetMonDate(CurrentDate)

     If VarType(CurrentDate)<>7 then

       GetMonDate=Null

     Else

       Select Case WeekDay(CurrentDate)

         Case 1       ' Sunday

           GetMonDate=CurrentDate-6

         Case 2       ' Monday

           GetMonDate=CurrentDate

         Case 3 to 7  ' Tuesday..Saturday

           GetMonDate=CurrentDate-WeekDay(CurrentDate)+2

       End Select

     End If

   End Function

To test the above function, type the following in the Immediate

window:

   Print GetMonDate(#4/30/93#)

The result is as follows:

   #4/26/93#

Additional reference words: 1.00 1.10 2.00


PRB: Where Condition Refers to Fields Not Controls

 Article Number: Q103140

 CREATED: 18-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

On page 348 of the Microsoft Access "Language Reference" manual, the

description for the action argument Where Condition reads:

   To open a form in which the value of one of its controls

   equals the value of a control on another form, use this

   syntax:

      [controlname on opened form] =

         Forms!formname![controlname on other form]

RESOLUTION

The description for the action argument Where Condition on page 348

should read:

   To open a form and show only records where one of the fields

   matches the value of a control on another form, use this

   syntax:

      [field in opened form's recordsource] =

         Forms!formname![controlname on other form]

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

The action argument Where Condition is used to filter the records in

the form's dynaset. Microsoft Access compares the specified fields in

each record on the form being opened to the controls on the original

form. Records on the form being opened will be included in the dynaset

only if the record's fields satisfy the Where Condition argument.

The steps below demonstrate the correct usage of the Where Condition

argument:

1. Open the sample database NWIND.MDB. Create a new unbound form with

   the following controls. Save the form as ChooseState.

      Textbox

      ------------------------

      ControlName: ChosenState

      Command Button

      ------------------

      OnPush: Open Emp 2

2. Create a new form, bound to the Employees table, with the following

   controls. Save the form as Emp 2.

      Textbox

      ------------------------

      ControlName: Last Name

      ControlSource: Last Name

      Textbox

      --------------------

      ControlName: State

      ControlSource: State

3. Create a new macro with the following action. Save the macro as

   Open Emp 2.

      Action: OpenForm

      ----------------------------------------------------------

      Formname: Emp 2

      Where Condition: [State] = Forms!ChooseState![ChosenState]

4. Open the ChooseState form. Type "WA" (without the quotation marks)

   in the text box, and choose the command button. The Emp 2 form

   opens and shows only those employees who live in Washington state.

5. Close the forms.

6. Open the Emp 2 form in Design view. Change the ControlName property

   of the State text box to Test. Save and close the form.

7. Open the form ChooseState. Type "WA" (without the quotation marks)

   in the text box, and choose the command button. The Emp 2 form will

   open and show the same records as in step 4. This demonstrates that

   you are filtering the underlying data, not the controls on the

   form.

REFERENCES

==========

Microsoft Access "Language Reference," page 348

Additional reference words: 1.00 1.10 docerr


PRB: Printing on Avery 5267 labels

 Article Number: Q103171

 CREATED: 18-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you print Avery 5267 labels, the text may appear to "creep" down

the page.

CAUSE

Avery 5267 labels are not cut in precise .5-inch increments on the

page. Because the labels are slightly larger than .5 inch, if you

print in .5-inch increments, the text appears to creep down the page.

RESOLUTION

When you are placing the controls in a report, allow room for the

label discrepancy. The following steps print three lines of text on

Avery 5267 labels. This example uses a function that concatenates the

fields for optimal use of space on each label.

1. From Print Setup, set the top and bottom margins to .5 inch and

   set the left and right margins to .25 inch. Press the More button and

   set Items Across to 4, Row Spacing to 0, and Column Spacing to 0.3

   inches. Under Item Size, select the Same As Detail option.

2. Make the width of the report 1.75 inches.

3. Set the Height property for the Detail section to .5 inch and set

   the CanGrow and CanShrink properties to No.

4. Locate one text box control and set the properties manually as

   follows:

   Control: Text Box

      Top:       .01

      Height:    .48

      CanGrow:   Yes

      CanShrink: Yes

      Font:      Arial

      FontSize:  8

      ControlSource:

          =AddressBlock([First],[Last],[Address],[City],[State],[Zip])

5. Create a new Access Basic module, and type the following code into

   it:

   NOTE: In the following sample code, an underscore (_) is used as a

   line-continuation character. Remove the underscore when re-creating

   this code in Access Basic.

   Option Explicit

   Function AddressBlock$ (First, Last, Address, City, State, Zip)

      Dim A1$, A2$, A3$, CR$

      CR$ = Chr(13) & Chr(10)  'Carriage return and line feed

      A1$ = IIf(ISB(First),"",First & " " & IIf(ISB(Last),"" ,Last _

      & CR$))

      A2$ = IIf(ISB(Address),"",Address & CR$)

      A3$ = City & ", " & State & " " & Zip

      AddressBlock = A1$ & A2$ & A3$    'Concatenate the strings.

   End Function

   Function ISB (V) As Integer

      If IsNull(V) or V = "" Then ISB = True Else ISB = False

   End Function

The spacing above creates a .01 reserve above and below the text

control. Variations of this layout may also print correctly.

NOTE: The Mailing Label ReportWizard creates two controls, each with

a height of .17, leaving a reserve below and above the text for label

adjustments.

To see another example, query on the following words in the Microsoft

Knowledge Base:

   white and space and canshrink and reports

Additional reference words: 1.00 1.10 2.00


PRA: Options in Form and Report Wizards Are Not Displayed

 Article Number: Q103173

 CREATED: 18-AUG-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you select the Form Wizard button or the Report Wizard button, an

empty list box is displayed.

CAUSE

The [Form Wizards] and [Report Wizards] sections of the MSACCESS.INI file

(in Microsoft Access version 1.x) or the MSACC20.INI file (in Microsoft

Access version 2.0) either do not exist or are empty.

RESOLUTION

In version 2.0, using Notepad or another text editor, add the following

sections in your MSACC20.INI file. The MSACC20.INI file is located in

your Windows directory.

  [Form Wizards]

  Single-Column=zwform,1

  Tabular=zwform,2

  Graph=zwgraph,,

  Main/Subform=zwmainsub,,

  Autoform=zwautoform,,

  [Report Wizards]

  Single-Column=zwreport,3

  Groups/Totals=zwreport,4

  Mailing Label=zwmailinglabel,,

  Summary=zwreport,12

  Tabular=zwreport,11

  Autoreport=zwautoreport,,

  MSWordMailmerge=PM_Entry,,

  [Libraries]

  wzlib.mda=rw

In version 1.x, using Notepad or another text editor, add the following

sections in your MSACCESS.INI file. The MSACCESS.INI file is located in

your Windows directory.

   [Form Wizards]

   Single-Column=zwInitWizard, 1

   Tabular=zwInitWizard, 2

   Graph=zwInitWizard, 6

   Main/Subform=zwInitWizard, 7

   [Report Wizards]

   Single-Column=zwInitWizard, 3

   Groups/Totals=zwInitWizard, 4

   Mailing Label=zwInitWizard, 5

   [Libraries]

   wizard.mda=ro

Additional reference words: 1.00 1.10 2.00 option wizard blank disappear


PRB: Exporting Date Fields to Text Includes Time Format

 Article Number: Q103174

 CREATED: 18-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you export a table that includes a date field to a text file,

Microsoft Access will automatically add the time format to the date in

the exported text file. The information will be formatted as "mm/dd/yy

hh:nn:ss".

CAUSE

In Microsoft Access, dates are stored with both date and time formats.

During the export process Microsoft Access creates both the date and

time format in the exported text file. If there is no data for the

time format it will show up as all zeros (indicating 12 A.M.).

RESOLUTION

There are two methods you can use to work around this problem:

Method 1

--------

Create a query with a calculated field to format the date field

appropriately, and then export the results of the query. The details

of this method are listed below in the "workaround" section.

Method 2

--------

Microsoft Access can create a fixed width text file, using the "Text

(Fixed Width)" export format. Using this method, you can set the size

of the date field to 8 characters in the Import/Export specification.

This will truncate the time portion of the date field during export.

NOTE: Common text exports require the data to be delimited using the

"Text (Delimited)" format. Method 2 will not be useful in these cases.

For more information on this method, see the Microsoft Access "User's

Guide," pages 78-79.

STATUS

This behavior is by design. This feature is under review and will be

considered for revision in a future release.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a table with a new field called Birthday with Date/Time

   chosen as the data type.

2. From the File menu, choose Save. Save the table with a unique name,

   such as "MyTable".

3. From the View menu, choose Datasheet. Type "11/15/67" (without the

   quotation marks) in the first record, and then close the table.

4. From the File menu, choose Export.

5. Select "Text (Delimited)" from the list of available export

   formats, and then choose OK.

6. Select the table saved in step 2 from the list of available tables,

   and then choose OK.

7. Type a unique name in the File Name box, and then choose OK.

8. In the Export Text Options dialog box, select OK.

9. Open the exported text file in any text editor (for example, the

   Windows Notepad text editor), and note that the date is formatted

   as "11/15/67 00:00:00".

Workaround (Using a Query to Export Date Fields Appropriately)

--------------------------------------------------------------

1. Create a new query and add the name of the table to be exported.

2. Include all desired fields in the query grid except for the date

   field.

3. For a date field called "Birthday", type the following in an empty

   column's FieldName box:

      Birthday2: Format([Birthday], "mm/dd/yy")

   NOTE: The new calculated field name cannot match the name of any

   other field that is included in the query.

4. Repeat step 3 for all other date fields.

5. From the Query menu, choose Make Table. In the Table Name box, type

   a unique table name, and then choose OK.

6. From the Query menu, choose Run to execute the query.

   The query will run and the results will be stored in the new table

   named in step 5.

7. Close the query. Make sure to save the query with a unique name if

   you will want to use it again.

8. Activate the Database window, and then export the new table using

   the Export command on the File menu.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 78-79 and 162-167

Additional reference words: 1.00 1.10 2.00


PRB: Zoom Box Does Not Appear When SHIFT+F2 Is Pressed

 Article Number: Q103175

 CREATED: 18-AUG-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Pressing SHIFT+F2 does not bring up a zoom box. In Microsoft Access,

pressing SHIFT+F2 should display the expression zoom box for easy

viewing and editing of expressions.

CAUSE

Possible causes for this problem include:

 - Low system resources within Microsoft Windows.

 - A damaged .LDB file.

 - Syntax errors in any of the modules in the database.

RESOLUTION

Low System Resources

--------------------

To free up system resources, close as many running applications as

possible. Note that some applications and drivers return fewer

resources to Microsoft Windows when they close than they originally

requested. Over time, this behavior can cause a low system resources

situation. In these cases you may need to restart Microsoft Windows in

order to refresh system resources.

To check Microsoft Windows system resources while running Microsoft

Access, press CTRL+ESC, and then select Program Manager from the Task

List dialog box. From the Help menu, choose About Program Manager. The

About Program Manager dialog box will display the amount of available

system resources.

Damaged .LDB File

-----------------

Microsoft Access may generate an .LDB file for a database. The .LDB

file maintains lock information about the database. Occasionally, this

file becomes damaged and causes problems that include preventing the

zoom box from appearing. If you suspect the .LDB file of being

damaged, close the database, and then delete the associated .LDB file.

The .LDB file will be named <DBName>.LDB, where <DBName> is the same

name as the database. Microsoft Access will create a new .LDB file for

the database if necessary.

Syntax Errors in Modules

------------------------

The zoom box is a Microsoft Access form, coded in Access Basic.

Microsoft Access will not run any code if the compiler contains syntax

errors. If you suspect that a module may contain syntax errors, try

compiling the code in a Microsoft Access module to find the errors. In

Microsoft Access version 2.0, you will receive the error message

   Access Basic Compile Error.  View Error in Context?

when you try to bring up the zoom box.

Additional reference words: 1.00 1.10 2.00


PRB: "Permissions Denied" Running Macro with SQL Statements

 Article Number: Q103176

 CREATED: 18-AUG-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You receive the error message "permissions denied" when you run an action

query SQL statement either in a RunSQL macro statement or as the RowSource

property for a control in a secured database.

CAUSE

SQL statements used in a RunSQL macro or as the RowSource property for a

control are not real objects--instead, they are compiled and built when

they are run. Because they are not real objects in the Database window,

they do not have an owner, and the Run With Owners Permissions property is

ignored when they are run. If you do not have permissions for the

underlying table, the error message stated above will occur.

RESOLUTION

Set the RowSource property to an intermediate query object that was created

by the owner of the secured table. The query object should have the Run

With Owner's Permissions property set.

STATUS

This behavior is by design.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.1, Chapter 25

Microsoft Access "Language Reference," version 1.1, pages 353-354

Additional reference words: 1.00 1.10 2.00


INF: Resizing Multiple Controls Simultaneously

 Article Number: Q103178

 CREATED: 18-AUG-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Changing properties (size, font, color, and so forth) of several

controls (text boxes, labels, and so forth) on a form or report is

normally accomplished by changing each individual control. This

article describes how to change more than one control at a time.

MORE INFORMATION

The following steps describe how to change more than one control at

a time:

1. Resize one of the controls to the desired size by using the mouse

   or by indicating the width and the height in that control's property

   sheet.

2. After changing the desired properties, choose Change Default from

   the Layout menu.

   NOTE: If multiple controls are selected when Change Default is

   chosen, the properties of the last control selected are used as the

   defaults.

3. Select the remaining controls you want to resize. You can do this

   by either dragging the mouse pointer through all of them or by holding

   down the SHIFT key and clicking the mouse button once.

4. From the Layout menu, choose Apply Default.

This changes the size of all the selected controls on the forms.

NOTE: This applies all defaults (including fonts, colors, size, and so

on) to the selected control(s).


PRB: "Help Topic Does Not Exist" Invoking Custom Help File
PRB: "Help Topic Does Not Exist" Invoking Custom Help File [B_WAccADK]

 Article Number: Q103179

 CREATED: 18-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - Microsoft Access Distribution Kit version 1.1

 - Microsoft Access Developer's Toolkit version 2.0

---------------------------------------------------------------------

SYMPTOMS

Pressing F1 to invoke a custom Help file topic for a form control

produces the message "Help topic does not exist" twice.

CAUSE

The number entered in the HelpContextID property could not be mapped

to a Help file context string in the custom Help file.

RESOLUTION

Make sure a [MAP] section exists in the Help project file that

correctly maps the HelpContextID context number to the context string

in the custom Help file.

MORE INFORMATION

The number entered in the HelpContextID property for a Microsoft

Access form control can be mistaken for the context string used to

identify a topic in the help system. The HelpContextID is actually

known as a context number. A context number is an optional number that

you can associate with context strings by using the [MAP] section in

the help project file. A context number can be assigned to each object

in an application to enable context sensitivity.

A typical [MAP] section in the Help project file will look like the

following:

   [MAP]

   TitlePageContextString   3

   Topic1ContextString      1

   Topic2ContextString      2

The context string appears first, followed by the HelpContextID

context number. The context string and context number are separated by

white space, using either space characters or tabs.

In the example above, the # footnote for the first topic would be set

to the string TitlePageContextString. Within Microsoft Access, you

would set HelpContextID to the number 3.

REFERENCES

==========

Microsoft Access Distribution Kit "Help Compiler Guide," version 1.1,

Chapter 6

Additional reference words: 1.00 1.10 2.00


PRB: White Lines or Missing Data When Printing Reports

 Article Number: Q103180

 CREATED: 18-AUG-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The following problems can occur when you are printing from Microsoft

Access using the Canon BJC800 or BJ10E printer drivers:

 - Horizontal white lines appear on the report.

 - Portions of the text are not printed.

 - You can only print the report using a lower resolution than normal.

 - You can only print color reports in monochrome.

 - You can only print the report one page at a time, rather than

   printing the whole document at once.

NOTE: These problems can occur with other printer drivers also.

CAUSE

These problems are due to an interaction between the way Microsoft

Windows sends data to the printer, and the amount of time the printer

needs to interpret the data. Microsoft Access treats lines or borders

as a bitmap or large graphic, and the printer needs more time to

interpret the data.

RESOLUTION

Change the default settings for the printer in the Microsoft Windows

Control Panel. Choose the Printers icon in the Control Panel, and then

choose Connect. Make the following entries in the Timeouts (seconds)

box:

   Option                 Setting

   ------------------------------

   Device Not Selected    15

   Transmission Retry     90

The default setting for Device Not Selected is 15, and Transmission

Retry is 45. These settings may need to be increased even further, to

30 and 120 or higher for printing complex graphics images, or for

printing over a network.

Additional reference words: 1.00 1.10 2.00 PtrIss whitespace


INF: Showing All Records (Including Null) in a Parameter Query

 Article Number: Q103181

 CREATED: 18-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you are running a query that takes its parameters from a form, no

records are returned by the query if you leave the field blank. If you

type an asterisk (*) in the field, only records with non-Null values

are returned.

This article describes a method for returning all records, including

those with Null values, when you leave the parameter blank.

MORE INFORMATION

The following example is based on the sample database NWIND.MDB and

assumes that you are familiar with Microsoft Access form, macro, and

query design.

1. Create the following unbound form:

      Form: Pick Employees

      --------------------

         Control: Textbox

            ControlName: Region

         Control: Command Button

            Caption: Run Query

            OnPush: Run Employee Query

Note: In Access 2.0 use OnClick instead of OnPush

2. Create the following macro:

      Macro: Run Employee Query

      -------------------------

         Action: OpenQuery

            Query Name: Employee Query

            View: Datasheet

            Data Mode: Edit

3. Create the following query based on the Employees table:

      Query: Employee Query

      ---------------------

         Field: First Name

            Show: True

         Field: Last Name

            Show: True

         Field: Region

            Show: True

            Criteria: Like Forms![Pick Employees]!Region & "*"

            Or: <leave blank>

         Field: Forms![Pick Employees]!Region

            Show: False

            Criteria: <leave blank>

            Or: Is Null

4. Open your query in Design view. From the Query menu, choose

   Parameters. Type "Forms![Pick Employees]!Region" (without the

   quotation marks) as the parameter name, with Text as the data type.

5. Open the Pick Employees form, type "WA" (without the quotation

   marks) in the Region field, and choose the Run Query button. The

   dynaset will contain five employee names.

6. Open the Pick Employees form, clear the Region field, and choose

   the Run Query button again. The dynaset now contains nine employee

   names, four with blank region codes.

By adding the parameter as a field, we can test the parameter and

control the other criteria. The equivalent SQL Where condition is the

following:

   Where Region Like Forms![Pick Employees]!Region & "*"

      Or Forms![Pick Employees]!Region Is Null

Additional reference words: 1.00 1.10 2.00 SQL Queries query


INF: Function to Determine Retail or Run-Time Version
INF: Function to Determine Retail or Run-Time Version [B_WAccADK]

 Article Number: Q103182

 CREATED: 18-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.1 and 2.0

 - Microsoft Access Distribution Kit version 1.1

 - Microsoft Access Developer's Toolkit version 2.0

---------------------------------------------------------------------

SUMMARY

This article demonstrates how to use a function to determine if your

Microsoft Access application is running in the run-time or the retail

version of Microsoft Access. This function can be used to prevent your

application from being used in the retail version of Microsoft Access.

MORE INFORMATION

NOTE: This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

The following example demonstrates how to create a function called

IsRunTime() that can be used to prevent an application from being run

in the retail version of Microsoft Access.

1. Add the following function called IsRuntime() to a new or existing

   module in your application:

      Function IsRuntime ()

         On Error GoTo ErrIsRuntime

         IsRuntime = SysCmd(6)

      ByeIsRuntime:

         Exit Function

      ErrIsRuntime:

         If (Err = 5) Then

            IsRuntime = False

         Else

            Error Err

         End If

         Resume ByeIsRuntime

      End Function

Note that it is necessary to trap for Err = 5, Illegal Function Call,

in case your application is being run in Microsoft Access version 1.0,

which does not support the SysCmd(6) call.

2. Create the following macro and save it with the name AutoExec:

      Condition         Action        Defined Below

      ---------------------------------------------

      Not IsRuntime()   MsgBox        1

      ...               Quit          2

      AutoExec Actions

      ----------------

      1. MsgBox

            Message: Invalid setup, run YourAppName setup and try again.

            Beep: Yes

            Type: Critical

            Title: YourAppName

      2. Quit

Additional reference words: 1.10 2.00


INF: How to Create a Running Sum on a Form

 Article Number: Q103183

 CREATED: 18-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

While reports have a RunningSum property, forms do not. This article

describes a method to create a running sum on a form.

MORE INFORMATION

1. You need a unique, sequential ID field, such as a Counter or a

   Date/Time field.

   NOTE: If such a field does not already exist, you can create one by

   opening the table in Design view and adding a new field.

2. Start Microsoft Access and open the sample database NWIND.MDB.

3. Create a new, blank form based on the Orders table.

4. Set up the form as follows:

   NOTE: The underscore (_) is used in the code below as a

   line-continuation character to improve readability. You must enter

   the entire text as one line.

   Form:  Form1

   ------------

   RecordSource: Orders

   Form Controls

   -------------

   Text Box: Order ID

      ControlSource: Order ID

   Text Box: Order Amount

      ControlSource: Order Amount

   Text Box: Total

      ControlSource: =DSum("[Order Amount]","Orders",_

                             "[Order ID] <= Forms![Form1]![Order ID]")

   The DSum() function calculates the sum total of all orders with an

   Order number less than or equal to the currently displayed order

   number. For this reason, it is important to have a unique and

   sequential ID field.

Additional reference words: 1.00 1.10 2.00 subtotal


INF: FindEOM() Sample Function to Find Last Day of Month

 Article Number: Q103184

 CREATED: 18-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes a sample Access Basic function called FindEOM()

that accepts a date as an argument and returns the last day of the

month.

MORE INFORMATION

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

The sample code below demonstrates how to set up the FindEOM()

function. Enter the following in a new or existing module:

   '******************************************************

   'Declarations Section of Module

   '******************************************************

   Option Explicit

   '******************************************************

   'FindEOM Function

   '******************************************************

   'This function takes a date as an argument and returns the last

   'day of the month.

   Function FindEOM (MyDate)

       Dim NextMonth, EndOfMonth

       NextMonth = DateAdd("m", 1, MyDate)

       EndOfMonth = NextMonth - DatePart("d", NextMonth)

       FindEOM = EndOfMonth

   End Function

Use the following sample expression to call the FindEOM() function:

   =FindEOM(#5/5/93#)

To view the results of the FindEOM() function, type the following in

the module's Immediate window:

   ?FindEOM(#5/5/93#)

Additional reference words: 1.00 1.10 2.00


INF: How to Tell if Windows for Workgroups Is Running

 Article Number: Q103185

 CREATED: 18-AUG-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

------------------------------------------------------------

SUMMARY

Although Microsoft Windows and Windows for Workgroups can both display

the same version number, you can determine whether Windows for

Workgroups is running by using a Windows API call in an Access Basic

function.

MORE INFORMATION

The following example can be used to determine if Windows for

Workgroups is running.

NOTE: In the following sample code, an underscore (_) is used as a

line-continuation character. Remove the underscore when re-creating

this code in Access Basic.

1. Create a new module and enter the following code:

      '***************************************************************

      '  Declarations section of the module

      '***************************************************************

         Option Explicit

         Const WNNC_NET_MultiNet = &H8000

         Const WNNC_SUBNET_WinWorkgroups = 4

         Const WNNC_NET_TYPE = 2

         Declare Function WNetGetCaps% Lib "User" (ByVal nIndex%)

      '================================================================

      'This function returns True if Windows for Workgroups is running,

      'or False if it is not (generic Windows). It accomplishes this by:

      ' - Calling WNetGetCaps and retrieving the net type flag.

      ' - Inspecting the low word of the flag to see if the Windows for

      '   Workgroups bit is set.

      '================================================================

         Function IsWFW% ()

            Dim wNetType As Integer

            wNetType = WNetGetCaps(WNNC_NET_TYPE)

            IsWFW = False

            If (wNetType And WNNC_NET_MultiNet) Then

               IsWFW = ((wNetType And &HFFFF) And _

                     WNNC_SUBNET_WinWorkgroups) <> 0

            End If

         End Function

2. From the View menu, choose Immediate Window. Type the following in

   the Immediate window:

      MsgBox IIf(IsWFW(), "WFW", "Windows") & " is running!"

If Windows for Workgroups is running, you will see the message "WFW is

running!"

Additional reference words: 1.00 1.10 2.00


PRB: Error Message: Too Many Memo or OLE Fields

 Article Number: Q103186

 CREATED: 18-AUG-1993

 MODIFIED: 19-AUG-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

The following error message

   Too many Memo or OLE fields

is displayed when you try to export a Microsoft Access table that

contains more than one memo field to Btrieve format.

CAUSE

Microsoft Access follows the Xtrieve specification for writing to

Btrieve tables. This specification allows only one memo field, which

must be the leftmost field in the table.

RESOLUTION

Change the table so that it contains only one memo field by doing

either of the following:

 - Changing the data types of all but one memo field.

   -or-

 - Moving the memo fields to other tables so that there is only one

   memo field per table.

Btrieve and Xtrieve are manufactured by Novell, Inc. a vendor

independent of Microsoft; we make no warranty, implied or otherwise,

regarding these products' performance or reliability.

Additional reference words: 1.00 1.10 Export Btrieve Xtrieve


PRB: Cannot Open a Database with a DoMenuItem Macro

 Article Number: Q103187

 CREATED: 18-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A Microsoft Access macro that should open another Microsoft Access

database does not open the database specified in the macro.

CAUSE

The macro contains two actions, SendKeys and DoMenuItem. Microsoft

Access cannot open a second database while the DoMenuItem action is

still running in the currently open database. Microsoft Access does

not support opening multiple databases.

RESOLUTION

To open the database, you can use a macro with only one action,

SendKeys. The following sample macro demonstrates how to open a

database with a SendKeys action:

   Macro Name      Action

   ------------------------

   OpenMe          SendKeys

   OpenMe Actions

   --------------------------------

   SendKeys

      Keystrokes: %fo<YOURFILE>.MDB~

      Wait: No

Replace <YOURFILE> with the name of the database you want to open.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new database.

2. Create a new macro named OpenMe with the following actions:

      Macro Name        Action

      ----------------------------

      OpenMe            SendKeys

                        DoMenuItem

      OpenMe Actions

      -------------------------

      SendKeys:

         NWIND.MDB~

      DoMenuItem:

         Menubar: Database

         Menu Name: File

         Command: Open database

3. Run the macro. It will not open the NWIND.MDB database specified in

   the SendKeys action.

Additional reference words: 1.00 1.10 2.00 opendb


PRB: Unable to Close Microsoft Access from Control-Menu Box

 Article Number: Q103188

 CREATED: 18-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You receive the following error message when you attempt to close

Microsoft Access from the Control-menu box:

   Currently unable to quit Microsoft Access

CAUSE

This problem occurs if the currently selected form has an OnClose

property pointing to a macro that contains the Quit action.

RESOLUTION

Do not attach a macro containing the Quit action to the OnClose

property of the form if you will be using the Control-menu box to quit

Microsoft Access.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a blank, unbound form and save it as Form1:

      Form: Form1

      ---------------

      OnClose: Macro1

2. Create a new macro and save it as Macro1:

      Macro Name      Action

      ----------------------

      Macro1          Quit

3. Open Form1 in Form view, and then double-click the Microsoft Access

   Control-menu box, or choose Close from the Control-menu box. You

   will receive the error message:

      Currently unable to quit Microsoft Access.

Additional reference words: 1.00 1.10 on close system


INF: How to Use Aggregate Functions in a Query

 Article Number: Q103189

 CREATED: 18-AUG-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The error message "Can't group on fields selected with '*'" occurs when

you have set the following query property:

   Version                 Property                     Value

   ----------------------------------------------------------

   Microsoft Access 2.0    Output All Fields            Yes

   Microsoft Access 1.x    Restrict Available Fields    No

MORE INFORMATION

This error message occurs when you are attempting to use aggregate

functions without setting the Output All Fields query property to No for

version 2.0, or without selecting the Restrict Available Fields property

for version 1.x.

The following procedure shows how to correctly set this property

for your query with aggregate functions:

1. Open the query in Design view.

2. In version 2.0, make sure that the Properties command on the View

   menu has a check mark, so that the property sheet is being displayed.

   Click anywhere in the Query window outside of the query grid. Set the

   Output All Fields property to No.

   In version 1.x, from the View menu, choose Query Properties. Then,

   select the Restrict Available Fields option.

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Run the Daily Order Totals query, which uses the aggregate

   functions Count() and Sum(), to confirm that it works correctly.

3. View the Daily Order Totals query in Design view.

4. In version 2.0, set the Output All Fields property to Yes.

   In version 1.x, clear the Restrict Available Fields check box.

5. Run the query.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.x, Chapter 6

Microsoft Access "User's Guide", version 2.0, Chapter 10

For more information, search for "Setting Query Properties" using the

Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


PRA: Cannot Use First() and Last() Functions in a Report

 Article Number: Q103190

 CREATED: 18-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Microsoft Access returns a #ERROR message in your Report field when

you use First() or Last() functions.

RESOLUTION

It may be possible to use DFirst() or DLast() domain aggregate

functions to achieve the results you want. However, these functions

ignore any sorting or grouping in your report. You may need to supply

a criteria to these domain functions to return the data desired.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB.

2. Open the Alphabetical List of Products report in Design view.

3. Add an unbound text box to the Report Header section as follows:

      Object: Text Box

      ----------------

      ControlName: First Product

      ControlSource: =First([Product Name])

4. From the File menu, choose Print Preview.

   The text box that you added, First Product, evaluates to #ERROR.

REFERENCES

==========

Microsoft Access "Language Reference," versions 1.0 and 1.1, page 139

Additional reference words: 1.00 1.10 first last pounderror


PRA: Slow Repaint When Saving Form with Many Controls

 Article Number: Q103191

 CREATED: 18-AUG-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

---------

SYMPTOMS

The first time you save a form that contains both a large

number of

controls and a counter field, Microsoft Access repaints the

controls

one at a time. This process may take 2 to 10 seconds,

depending on

the speed of your processor.

CAUSE

Because the form contains a counter field, it must be

repainted when

the counter value is determined (the first time the record

is saved).

All fields on the form are repainted, not only the counter.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access version

1.0. This problem no longer occurs in Microsoft Access

version 1.1.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Create a table with a counter field and approximately 100

fields

   with the Yes/No data type.

2. Create a new form based on the above table and include

all fields.

3. Add the Yes/No fields to the form as check boxes.

4. Open the form and select a majority of the check boxes.

When you

   save the record, the drive light flashes momentarily as

each record

   is saved. Microsoft Access then takes several seconds to

update the

   display.

NOTE: This problem occurs only the first time the record is

saved.

Subsequent changes to the record do not cause this behavior.

Additional reference words: 1.00 forms update counter paint


INF: Equivalent of Microsoft Excel's Fill Down Functionality

 Article Number: Q103192

 CREATED: 18-AUG-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to replicate the Microsoft Excel fill down

functionality in Microsoft Access.

MORE INFORMATION

In Microsoft Access, you can use an update query to achieve fill down

functionality. The following example creates a copy of the Orders

table (called Orders1) in the sample database NWIND.MDB before

performing the fill down functionality to make every shipping charge

$10.

 1. In the Database window, select the Orders table.

 2. From the Edit menu, choose Copy.

 3. From the Edit menu, choose Paste. You are then prompted to enter a

    name for the new table; name it Orders1.

 4. Choose Query and press the New button.

 5. Add the Orders1 and close the Add Table window.

 6. Drag the Freight field onto the graphical query-by-example (QBE)

    grid.

 7. From the Query menu, choose Update.

 8. On the Update To: line, type "$10.00" (without the quotation marks)

    and press the TAB key.

 9. From the Query menu, choose Run. Microsoft Access informs you that

    1078 records will be updated.

10. Choose OK.

11. Open the Orders1 table.

All the records should now have a shipping charge of $10.00.

Additional reference words: 1.00 1.10 2.00 queries fill down excel


INF: Form Controls to Increment and Decrement a Date

 Article Number: Q103194

 CREATED: 18-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to create form controls that increment or

decrement a date. After a date control is initialized to the date

stored in the computer, command buttons will be used to increment or

decrement the displayed date.

MORE INFORMATION

The following example demonstrates how to create controls on a form

that can be used to increment or decrement the displayed date:

1. Create a new unbound blank form named Date Selector.

2. Add an unbound text box for the date value:

      Object: Text Box

      ----------------------

      ControlName: Call Date

      Format: General Date

      Default Value: =Date()

      Locked: Yes

      SpecialEffect: Sunken

3. Add command buttons to change the date value:

      Object: Command Buttons

      -----------------------

      ControlName: Decrease

         Caption: <

         Auto Repeat: Yes

         OnClick: Change Date

      ControlName: Advance

         Caption: >

         Auto Repeat: Yes

         OnClick: Change Date

NOTE: The OnClick property is in Microsoft Access version 2.0 only. In

version 1.x, it is called the OnPush property.

3. Create a macro to increase and decrease the date:

   Macro Name  Condition                                   Action

   -------------------------------------------------------------------

   Change Date Screen.ActiveControl.ControlName="Advance"  SetValue

               ...                                         GoToControl

               ...                                         GoToControl

               Screen.ActiveControl.ControlName="Decrease" SetValue

               ...                                         GoToControl

               ...                                         GoToControl

   Change Date Actions

   --------------------------------------------------

   SetValue

      Item: Forms![Date Selector]![Call Date]

      Expression: Forms![Date Selector]![Call Date]+1

   GoToControl

      ControlName: [Call Date]

   GoToControl

      ControlName: [Advance]

   SetValue

      Item: Forms![Date Selector]![Call Date]

      Expression: Forms![Date Selector]![Call Date]-1

   GoToControl

      ControlName: [Call Date]

   GoToControl

      ControlName: [Decrease]

4. Open the Date Selector form. The date will default to the

   computer's date. Choose the > button to increase the date. Choose

   the < button to decrease the date.

The date will continue to change while the button is depressed. Note

that although the cursor can be moved into the date text box with the

TAB key, the date cannot be changed except by using the command

buttons.

REFERENCES

==========

Microsoft Access "User's Guide," version 2.0, Chapters 8, 24, and 25

Microsoft Access "User's Guide," version 1.0 and 1.1, Chapters 9 and 12

Additional reference words: 1.00 1.10 2.00 date/time


PRA: Setup Program Not Handling All Palette Messages

 Article Number: Q103250

 CREATED: 19-AUG-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The colors on the Microsoft Access Setup screen may appear completely

random.

CAUSE

This problem occurs if you load a 256-color bitmap in an application

such as Paintbrush before starting the Microsoft Access Setup program,

then switch to this application while the Microsoft Access Setup

program is running. This problem occurs only if you are using a driver

other than a 16-color video driver.

RESOLUTION

You can correctly redraw the Microsoft Access Setup screen by

maximizing and then minimizing the application in which you loaded the

256-color bitmap (for example, the Paintbrush window containing the

256-color bitmap). You can also switch to a 16-color video driver.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Make sure that you are using a 256-color video driver.

2. Open Paintbrush and load a 256-color bitmap.

3. Size the Paintbrush window to fill the right half of your screen.

4. Start the Microsoft Access Setup program. At the first opportunity

   (after entering your name and company), size the Setup window to

   fill the left half of the screen.

5. Activate the Paintbrush window by clicking the title bar. Random

   colors now appear in the Microsoft Access Setup window.

Additional reference words: 1.00 1.10 WinIss install file bmp


PRB: Macro with Two SendKeys Actions Loops Infinitely

 Article Number: Q103251

 CREATED: 19-AUG-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you run a macro that includes two SendKeys actions, the macro

enters an infinite loop and you must restart your computer to regain

control.

CAUSE

When only one SendKeys action is used in a macro, the macro can be

stopped by pressing CTRL+BREAK and then choosing Halt. However, using

a second SendKeys action toggles the default, or non-Single Step,

macro mode so that the macro cannot be terminated without restarting

your computer.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

CAUTION: Save all work on your computer before you set up the example

below. You will have to restart your computer after you run the sample

macro.

1. Create a macro as follows:

      Macro Name       Action

      -------------------------

      Go Loop          SendKeys

                       SendKeys

      Go Loop Actions

      ------------------

      SendKeys

         Keystrokes: " "

         Wait: No

      SendKeys

         Keystrokes: " "

         Wait: No

2. Open a new form and place a command button on it.

3. Add the Go Loop macro to the command button's OnPush property.

4. Change to Form view, and then select the command button.

REFERENCES

==========

For more information on the SendKeys action, search for "SendKeys" using

the Help menu.

Additional reference words: 1.00 1.10 2.00 reboot hang


INF: Query with Parameters to Evaluate Complex Criteria

 Article Number: Q103252

 CREATED: 19-AUG-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access allows the use of variable parameters in queries.

This article discusses how to construct a query requiring more than

one prompt. Each parameter can be used both as criteria and as a field

to allow complicated evaluation of the value entered in each

parameter.

MORE INFORMATION

The following parameter query is based on the Orders table in the

sample database NWIND.MDB. It selects orders written between two

variable dates provided by the user.

If either the Start Date or the End Date is not entered, the query

returns all dates greater than or equal to the Start Date, or less

than or equal to the End Date. If neither a Start Date nor an End Date

is entered, the query returns all orders.

   Query: FindOrdersByDate

   -----------------------------------------------------------

   Field: Order ID

      Show: Yes

   Field: Order Date

      Sort: Ascending

      Show: Yes

      First Criteria Line: Between [Start Date] and [End Date]

      Second Criteria Line: <=[End Date]

      Third Criteria Line: >=[Start Date]

      Fourth Criteria Line:

   Field: [Start Date]

      Show: No

      First Criteria Line: Is Not Null

      Second Criteria Line: Is Null

      Third Criteria Line: Is Not Null

      Fourth Criteria Line: Is Null

   Field: [End Date]

      Show: No

      First Criteria Line: Is Not Null

      Second Criteria Line: Is Not Null

      Third Criteria Line: Is Null

      Fourth Criteria Line: Is Null

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 178-181

For more information on similar criteria, query on the following

phrase here in the Microsoft Knowledge Base:

   query by form

Additional reference words: 1.00 1.10 2.00 queries ui parameter query


PRB: Insert Object Dialog Box Has No "All Files" (*.*) Option

 Article Number: Q103253

 CREATED: 19-AUG-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you choose Insert Object from the Edit menu, All Files (*.*) is

not an option in the List Files Of Type box in the Insert Object From

File dialog box.

CAUSE

This behavior is by design. The List Files Of Type box displays only

file types that represent OLE server applications stored in your

computer's registration database file, REG.DAT. The All Files (*.*)

option is omitted to prevent you from unintentionally trying to link

or embed an object using a non-OLE or unregistered application.

RESOLUTION

You can type "*.*" (without the quotation marks) in the File Name text

box if you want to display all file types. However, if your purpose in

selecting All Files is to link or embed an object from a non-OLE or

unregistered application, you must use the Microsoft Windows Object

Packager to create and paste an object into Microsoft Access.

For information on using Object Packager, see the Microsoft Windows

"User's Guide," Chapter 13.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. In the sample database NWIND.MDB, open the Categories table in

   Datasheet view.

2. Move to a new record and select the Picture field.

3. From the Edit menu, choose Insert Object.

4. Choose the File button in the Insert Object dialog box.

5. Open the List Files Of Type box. Note that All Files (*.*) is not

   an option.

Additional reference words: 1.00 1.10 WinIss


PRB: Error Message "Couldn't Open File" in Shared Environment

 Article Number: Q103254

 CREATED: 19-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You cannot open multiple instances of a Microsoft Access database even

though multiuser options have been set. You receive either the error

message

   Couldn't Open File <database name>

or the error message:

   <Database name> This file is already in use. Use a new filename or

   close the file in use by another application.

CAUSE

This problem can occur if you attempt to open a shared database by

choosing it from the list at the bottom of the File menu, instead of

using the Open Database command on the File menu. When you open a

database by choosing it from the bottom of the File menu, Microsoft

Access opens the database with the same settings as the last time it

was opened.

RESOLUTION

Running a single instance of Microsoft Access, open that particular

database with the Open Database command on the File menu. Then close

the database, thereby making the correct settings to the database.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

This problem occurs when Microsoft Access is being shared on a

network, but can be reproduced on a stand-alone computer with the

following steps:

1. Open the sample database NWIND.MDB by choosing Open Database from

   the File menu. Select the Exclusive check box and clear the Read

   Only check box before choosing OK.

2. From the View menu, choose Options.

3. In the Category box, choose Multiuser.

4. In the Items box, set Default Mode For Open Databases to Shared,

   and then choose OK.

5. Quit Microsoft Access.

6. Restart Microsoft Access, and then open the sample database

   NWIND.MDB by choosing Open Database from the File menu.

7. Start a second instance of Microsoft Access.

8. Open the sample database NWIND.MDB by choosing the database from

   the bottom of the File menu.

The following error message occurs:

    Couldn't Open File.

If steps 6 and 8 are reversed the following error message occurs:

    This File Already In Use.

REFERENCES

==========

For more information on problems opening databases in a shared

environment, query on the following words here in the Microsoft

Knowledge Base:

   couldn't and open and file

   -or-

   file and already and use

Additional reference words: 1.00 1.10 2.00 UI err msg recent multi user


INF: Two Ways to Edit Forms Without Adding New Records

 Article Number: Q103256

 CREATED: 19-AUG-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

This article demonstrates two methods for creating a form to

edit data

without adding new records.

The first method uses a macro to move the insertion point to

the last

record when you try to go to a new record. The second method

uses a query

that makes it impossible to add a new record and also

prevents a blank

new record.

MORE INFORMATION

Method 1: Macro Method

----------------------

1. Create a new macro called EditOnlyMacro:

      Condition:               Action

      ----------------------------------------------

      [Product ID] Is Null     DoMenuItem

                                  Menu Bar: Form

                                  Menu Name: Records

                                  Command: GoTo

                                  Subcommand: Last

2. Open the Products form in Design view. In the OnCurrent

property,

   add the name of the macro that you created above.

Method 2: Query Method

----------------------

Editing the Products Table Without Adding New Records:

This example makes it possible to edit records in the

Products table

without adding any new records. The Categories table is the

"one" side

(also called the "parent") and the Products table is the

"many" side

of this one-to-many relationship. The linked field, Category

ID, is

from the Categories table.

If the table in which you want to edit records is not on the

"many"

side of the one-to-many relationship, one method you can use

to create

a parent table is shown below:

1. Create a new query called EditOnlyQuery:

      Type: Select Query

      Join: Categories.[Category ID] <-> Products.[Category

ID]

      Field: Category ID

         Table: Categories

      Field: Product ID

         Table: Products

      Field: Supplier ID

         Table: Products

      Field: Product Name

         Table: Products

      Drag the rest of the fields down from the Products

table

   NOTE: The Category ID field is from the Categories table,

not the

   Products table.

2. Open the Products form in Design view. Change the

RecordSource

   property of the Products form from Products to

EditOnlyQuery.

Editing the Categories Table Without Adding New Records:

The above method depends on using the ID field of the parent

table in

a one-to-many relationship. If the table you want to edit

does not

have a parent table, you can create one. For instance, if

you want to

edit data in the Categories table, but not add new records,

do the

following:

1. Create a new table called NewParent as follows with one

primary key

   field:

      FieldName: ID

         DataType: Number

         FieldSize: Byte

2. Save the table, then switch to Datasheet view.

3. Type "1" (without quotation marks) in the first record,

then close the

   table.

4. Open the table that you want to edit in Design view, and

add the

   following field:

      FieldName: EditOnlyJoin

         DataType: Number

         FieldSize: Byte

5. Now type "1" (without quotation marks) in every record.

Hint: Use an

   update query to do this.

6. Establish a relationship between the NewParent table and

the

   Categories table. The NewParent table is the "one" side

and the

   Categories table is the "many" side of the one-to-many

   relationship. (In the Database window, choose Edit

Relationships

   from the Edit menu to establish the relationship.)

7. Add the NewParent and Categories tables in a query (see

Method 2

   above). Be sure that this new query has the ID field from

the NewParent

   table and does not have the EditOnlyJoin field from the

Categories

   table.

Additional reference words: 1.00 1.10 Forms


INF: Reading, Storing, & Writing Binary Large Objects (BLOBs)

 Article Number: Q103257

 CREATED: 19-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The OLE data type is often used to store large data objects (such as

sound, video, and graphic data) in a Microsoft Access table. However,

some large binary data objects cannot be represented if they do not

have an OLE server that understands the data being stored. You may

also want to store copies of executable program files (or other large,

non-OLE data) in a Microsoft Access table.

This type of data is often referred to as a binary large object (BLOB).

The following information discusses how to use a Microsoft Access Memo

field to store and work with large binary objects.

MORE INFORMATION

Provided below are two Access Basic functions that you can use to

manage large amounts of binary data in Microsoft Access Memo fields:

 - ReadBLOB() facilitates reading a binary file from disk and storing

   its contents in a Microsoft Access Memo field.

 - WriteBLOB() facilitates writing binary data stored in a Microsoft

   Access Memo field to a file on disk.

Information that demonstrates how to use these functions is also

provided.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

Create a new module with the following Declaration section and

functions:

NOTE: In the following sample code, an underscore (_) is used as a

line continuation character. Remove the underscore when re-creating

this code in Access Basic.

'*******************************************************************

' DECLARATION SECTION

'*******************************************************************

Option Explicit

Const BlockSize = 32768

'*******************************************************************

' FUNCTION: ReadBLOB

'

' PURPOSE:

'   Reads a large binary file (BLOB) from disk and stores the contents

'   it in the specified table/memo field.

'

' PREREQUISITES:

'   The specified table with the memo field to contain the binary

'   data must be opened in Access basic code and the correct

'   record navigated to prior to calling ReadBLOB.

'

' ARGUMENTS:

'   Source - The path\filename to be read and stored.

'   T      - The table object to store the data into.

'   Field  - The memo field name in table T to store data into.

'

' RETURN:

'   The number of bytes read from the Source file.

'

'*******************************************************************

Function ReadBLOB (ByVal Source As String, T As Table, _

Field As String)

    Dim NumBlocks As Integer

    Dim FileLength As Long, LeftOver As Long

    Dim FileData As String

    Dim SourceFile As Integer

    Dim i As Integer, RetVal As Variant

    On Error GoTo Err_ReadBLOB

    ' Open the source file to read from

    SourceFile = FreeFile

    Open Source For Binary Access Read As SourceFile

    ' Get the length of the file

    FileLength = LOF(SourceFile)

    If FileLength = 0 Then

        ReadBLOB = 0

        GoTo Bye_ReadBLOB

    End If

    ' Calculate number of blocks to read and left over bytes

    NumBlocks = FileLength \ BlockSize

    LeftOver = FileLength Mod BlockSize

    ' Initialize the status bar meter

    RetVal = SysCmd(1, "Reading BLOB", FileLength \ 1000)

    ' Put the table in edit mode to read data into

    T.Edit

    ' Read the 'left over' amount of data, writing it to the table

    FileData = String$(LeftOver, 32)

    Get SourceFile, , FileData

    T(Field).AppendChunk (FileData)

    ' Update status bar meter

    RetVal = SysCmd(2, LeftOver / 1000)

    ' Read the remaining blocks of data, writing them to the table

    FileData = String$(BlockSize, 32)

    For i = 1 To NumBlocks

        Get SourceFile, , FileData

        T(Field).AppendChunk (FileData)

        ' Update status bar meter

        RetVal = SysCmd(2, BlockSize * i / 1000)

    Next i

    ' Update the table record

    T.Update

    ' Remove status bar meter

    RetVal = SysCmd(3)

    Close SourceFile

    ReadBLOB = FileLength

Bye_ReadBLOB:

    Exit Function

Err_ReadBLOB:

    ReadBLOB = -1 * Err

    Resume Bye_ReadBLOB

End Function

'*******************************************************************

' FUNCTION: WriteBLOB

'

' PURPOSE:

'   Writes large binary file (BLOB) information stored in the

'   specified table/memo field to the specified path\file on disk.

'

' PREREQUISITES:

'   The specified table with the memo field containing the binary

'   data must be opened in Access basic code, and the correct record

'   navigated to prior to calling WriteBLOB.

'

' ARGUMENTS:

'   T           - The table object containing the binary information

'                 to write.

'   Field       - The memo field name in table T containing the

'                 binary information to write.

'   Destination - The path\filename to write the binary

'                 information to.

'

' RETURN:

'   The number of bytes written to the Destination file.

'

'*******************************************************************

Function WriteBLOB (T As Table, Field As String, _

ByVal Destination As String)

    Dim NumBlocks As Integer

    Dim FileLength As Long, LeftOver As Long

    Dim FileData As String

    Dim i As Integer, RetVal

    Dim DestFile As Integer

    On Error GoTo Err_WriteBLOB

    ' Get the size of the field

    FileLength = T(Field).FieldSize()

    If FileLength = 0 Then

        WriteBLOB = 0

        GoTo Bye_WriteBLOB

    End If

    ' Calculate number of blocks to write and left over bytes

    NumBlocks = FileLength \ BlockSize

    LeftOver = FileLength Mod BlockSize

    ' Remove any existing destination file

    DestFile = FreeFile

    Open Destination For Output As DestFile

    Close DestFile

    ' Open the destination file to write to

    Open Destination For Binary As DestFile

    ' Initialize status bar meter

    RetVal = SysCmd(1, "Writing BLOB", FileLength / 1000)

    ' Write the 'left over' amount of data to the output file

    FileData = T(Field).GetChunk(0, LeftOver)

    Put DestFile, , FileData

    ' Update status bar meter

    RetVal = SysCmd(2, LeftOver / 1000)

    ' Write the remaining blocks of data to the output file

    For i = 1 To NumBlocks

        ' Clear the buffer and read a chunck

        FileData = ""

        FileData = T(Field).GetChunk((i - 1) * BlockSize _

    + LeftOver, BlockSize)

        ' Write the chunck to the output file

        Put DestFile, , FileData

        ' Update status bar meter

        RetVal = SysCmd(2, ((i - 1) * BlockSize + LeftOver) / 1000)

    Next i

    ' Remove status bar meter

    RetVal = SysCmd(3)

    Close DestFile

    WriteBLOB = FileLength

Bye_WriteBLOB:

    Exit Function

Err_WriteBLOB:

    WriteBLOB = -1 * Err

    Resume Bye_WriteBLOB

End Function

How to Use the ReadBLOB() and WriteBLOB() Functions

---------------------------------------------------

The following subroutine, CopyFile, demonstrates how to copy a binary

file into a Microsoft Access Memo field and then write it back out to

a new disk file.

1. Create the following table:

   Table BLOB

   ----------

   FieldName: Blob

      DataType: Memo

2. Add the following function to the BLOB module created earlier:

'***************************************************************

' SUB: CopyFile

'

' PURPOSE:

'   Demonstrates how to use CopyBLOB and WriteBLOB.

'

' PREREQUISITES:

'   A table called "BLOB" must be created which contains a

'   memo field with the name "Blob".

'

' ARGUMENTS:

'   Source - The source path\file name to copy

'   Destination - The destination path\file name to write to

'

' EXAMPLE:

'   CopyFile "c:\access\msaccess.hlp", "c:\access\msacces2.hlp"

'

'***************************************************************

Sub CopyFile (ByVal Source As String, ByVal Destination As String)

    Dim BytesRead, BytesWritten

    Dim Msg As String

    Dim db As Database, T As Table

    ' Open the BLOB table

    Set db = CurrentDB()

    Set T = db.OpenTable("BLOB")

    ' Create a new record and move to it

    T.AddNew

    T.Update

    T.MoveLast

    BytesRead = ReadBLOB(Source, T, "Blob")

    Msg = "Finished reading """ & Source & """"

    Msg = Msg & Chr$(13) & ".. " & BytesRead & " bytes read."

    MsgBox Msg, 64, "Copy File"

    BytesWritten = WriteBLOB(T, "Blob", Destination)

    Msg = "Finished writing """ & Destination & """"

    Msg = Msg & Chr$(13) & ".. " & BytesWritten & " bytes written."

    MsgBox Msg, 64, "Copy File"

End Sub

3. With the BLOB module open in Design view, choose Immediate window

   from the View menu.

4. Type the following and press ENTER:

      CopyFile "c:\access\msaccess.hlp", "c:\access\msacces2.hlp"

   Result: The Microsoft Access Help file, which is over 3 megabytes in

   size, is copied into the BLOB Memo field in the BLOB table. Then, this

   information is copied to the hard disk with a new name.

REFERENCES

==========

Microsoft Access "Introduction to Programming," version 1.1, Chapter 2,

"Writing a New Function," pages 8-14, and Chapter 8, "Manipulating

Data,"pages 98-117

Microsoft Access Distribution Kit "The Secrets of Access Wizards," version

1.1, Chapter 2, "Inclinations: AccessWizard Functions and Properties,"

pages 30-32

Additional reference words: 1.00 1.10 2.00


PRB: Err Msg "The Other Application Quit" with MS Excel 4.0

 Article Number: Q103258

 CREATED: 19-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You receive the error message "The Other Application Quit" when you

are closing Microsoft Excel over a dynamic data exchange (DDE)

channel.

CAUSE

Microsoft Excel version 4.0 automatically closes down any open DDE

channels when quitting, rather than waiting for the DDE channels to be

closed properly. This behavior generates the error message "The Other

Application Quit" in Microsoft Access.

RESOLUTION

There are two methods to work around this problem. The first method is

to add an On Error Resume Next statement to your Microsoft Access

function, before the DDE quit command. The sample function below

demonstrates this method:

   Function CallExcel ()

      Dim chan

      x = Shell("c:\excel\excel.exe c:\excel\macro1.xlm", 1)

      chan = DDEInitiate("Excel", "System")

      DDEExecute chan, "[Run(""macro1.xlm!Message"")]"

      AppActivate "Microsoft excel"

      On Error Resume Next

      DDEExecute chan, "[quit]"

      DDETerminate chan

    End Function

The second method is to have Microsoft Excel quit itself, rather than

having Microsoft Access send the quit instruction. You can do this by

having the second to last line in a Microsoft Excel macro call another

macro. The first macro will contain a line similar to

   =ON.TIME(NOW()+"0:0:3","Leave")

that will call a second macro in three seconds. The second macro will

contain the two lines:

   =QUIT()

   =RETURN()

You can remove the DDE quit command from your Microsoft Access function

if you use this method.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

The following sample Access Basic function will open Microsoft Excel

and run a macro named Message. When the function instructs Microsoft

Excel to quit, the error message stated above will occur:

   Function CallExcel ()

      Dim chan

      x = Shell("c:\excel\excel.exe c:\excel\macro1.xlm", 1)

      chan = DDEInitiate("Excel", "System")

      DDEExecute chan, "[Run(""macro1.xlm!Message"")]"

      AppActivate "Microsoft excel"

      DDEExecute chan, "[quit]"

      DDETerminate chan

   End Function

REFERENCES

==========

Microsoft Excel "Function Reference," version 4.0, page 305

Additional reference words: 1.00 1.10 2.00


PRA: Problem Exporting "Single" Numeric Data to MS Excel

 Article Number: Q103259

 CREATED: 19-AUG-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You may be unable to export numeric data to Microsoft Excel if the

Microsoft Access data has a Number data type, a Single field size, and

a fixed format. When you export the table, the numbers lose their

formatting and are altered slightly.

RESOLUTION

Format the data stored as Number-Single in Microsoft Access as "fixed

- 2 decimal places" in Microsoft Excel. All the data stored as

Number-Single in Microsoft Access is also stored as Number-Double.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new table with two fields:

      FieldName:  NumSingle

         Data Type: Number

         Field Size: Single

         Format: Fixed

         Decimal Places: 2

      FieldName:  NumDouble

         Data Type: Number

         Field Size: Double

         Format: Fixed

         Decimal Places: 2

2. Add the following data:

      NumSingle       NumDouble

      -------------------------

      0.00            0.00

      0.01            0.01

      0.02            0.02

      0.03            0.03

      0.04            0.04

      0.05            0.05

      0.06            0.06

      0.07            0.07

      0.08            0.08

      0.09            0.09

      0.10            0.10

      0.10            0.10

      0.11            0.11

      0.12            0.12

      0.13            0.13

      0.14            0.14

      0.15            0.15

      0.16            0.16

      0.17            0.17

      0.18            0.18

      0.19            0.19

      0.20            0.20

3. Export the file to Microsoft Excel and open it.

   The data appears as follows:

     NumSingle        NumDouble

     --------------------------

     0                0.00

     0.01             0.01

     0.02             0.02

     0.029999999      0.03

     0.039999999      0.04

     0.050000001      0.05

     0.059999999      0.06

     0.07             0.07

     0.079999998      0.08

     0.090000004      0.09

     0.100000001      0.10

     0.100000001      0.10

     0.109999999      0.11

     0.119999997      0.12

     0.129999995      0.13

     0.140000001      0.14

     0.150000006      0.15

     0.159999996      0.16

     0.170000002      0.17

     0.180000007      0.18

     0.189999998      0.19

     0.200000003      0.20

Numbers stored as "singles" are imported as numbers with nine decimal

places. Numbers stored as "doubles" are imported with no errors.

Additional reference words: 1.00 1.10


INF: How to Get Record Position Number from Record Selector

 Article Number: Q103260

 CREATED: 19-AUG-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access does not provide a way to retrieve the position

number found in the record selector at the bottom of the form or

datasheet.

This article demonstrates a sample user-defined Access Basic function

called GetRecordPosition() that you can use to retrieve the current record

position. This article also explains how to use the GetRecordPosition()

function to create your own custom record position box on a form.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

MORE INFORMATION

The number that appears in the record selector is actually not a

record number. It is a number used to indicate the record's relative

position in the current record set, not the record's natural position

in the table.

The following Access Basic function, GetRecordPosition(), can be used

to get the record's relative position in the record set. Add this

function to a new or existing module.

   'Global Declaration Section

   Option Explicit

   '***************************************************************

   ' FUNCTION: GetRecordPosition

   '

   ' PURPOSE:

   '   Gets the number representing the relative position of the

   '   record in the currently active form. This is the number that

   '   appears in the record selector found at the bottom of a form

   '   or datasheet.

   '

   ' RETURN:

   '   The relative record position. If there are no records in

   '   the active form's dynaset, or if there is no active form,

   '   Null is returned.

   '

   '***************************************************************

   Function GetRecordPosition ()

       Const ERR_NO_CURRENT_RECORD = 3021

       Dim DS As Dynaset

       Dim RecordPos As Long

       On Error GoTo Err_GetRecordPosition

       Set DS = Screen.ActiveForm.Dynaset

       DS.Bookmark = Screen.ActiveForm.Bookmark

       RecordPos = 0

       While Not DS.BOF

           DS.MovePrevious

           RecordPos = RecordPos + 1

       Wend

       GetRecordPosition = RecordPos

   Bye_GetRecordPosition:

       Exit Function

   NoCurrentRec_GetRecordPosition:

       On Error Resume Next

       DS.MoveLast

       If Err <> 0 Then

           ' There must be no records in the set, so new record is 1

           GetRecordPosition = 1

       Else

           ' We are on last record of set, so count + 1

           GetRecordPosition = DS.RecordCount + 1

       End If

       GoTo Bye_GetRecordPosition

   Err_GetRecordPosition:

       Select Case Err

           Case ERR_NO_CURRENT_RECORD

               Resume NoCurrentRec_GetRecordPosition

           Case Else

               Resume Bye_GetRecordPosition

       End Select

   End Function

Creating a Record Position Box on a Form

----------------------------------------

Use the following steps to create your own custom record position box

on a form using the GetRecordPosition() function:

1. Create a new macro called Refresh Record Position with the

   following macro action:

      Requery

         ControlName: Record Position

2. Open your form in Design view. Make sure that the Form Hdr/Ftr

   option is selected on the Layout menu.

3. Create a text box in the footer with the following properties:

      Name: Record Position   (ControlName: Record Position in version 1.x)

      ControlSource: =GetRecordPosition()

4. Set the following properties on the form (not on the control):

      OnCurrent: Refresh Record Position

      AfterUpdate: Refresh Record Position

   The current record position will display in the text box in the

   footer of the form either when you navigate to a different record

   or when a new record is created.

   NOTE: The AfterUpdate property of the form is set in the event a

   new record is created and written to disk. The current record

   position may need to account for this new record.

REFERENCES

==========

For more information on record numbers, query on the following words

here in the Microsoft Knowledge Base:

   access and record and numbers and position

Additional reference words: 1.00 1.10 2.00 VCR


INF: How to Remove the Caption Bar from a Form

 Article Number: Q103261

 CREATED: 19-AUG-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

There is no built-in mechanism in Microsoft Access version 1.x for removing

the caption bar from a form. The caption bar runs across the top of the

window and includes the Control menu and the minimize and maximize buttons.

Microsoft Access version 2.0 does have properties that can be used for

removing the minimize and maximize buttons, and the Control menu. For more

information, search for "MinButton, MaxButton, and ControlBox" using the

Help menu in Microsoft Access 2.0.

This article demonstrates a sample user-defined Access Basic function

called RemoveCaptionBar() that you can use to remove the caption bar from a

form. Procedures for creating a form with no caption bar are also listed.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools

provided with Microsoft Access. For more information on Access Basic,

please refer to the "Introduction to Programming" manual.

MORE INFORMATION

Creating a New Module to Delete Caption Bar

-------------------------------------------

NOTE: In the following sample code, an underscore (_) is used as a

line-continuation character. Remove the underscore when re-creating

this code in Access Basic.

NOTE: You may have some Windows API functions defined in an existing

Microsoft Access library; therefore, your declarations may be

duplicates. If you receive the duplicate procedure name error message

when you compile or run your code, remove or comment out the

appropriate declarations statement.

'**************************************************************

' MODULE DECLARATION SECTION

'**************************************************************

Option Explicit

' Windows API Rect structure

Type RECT

    x1 As Integer

    y1 As Integer

    x2 As Integer

    y2 As Integer

End Type

' Windows API Declarations

Declare Function SetWindowLong& Lib "User" (ByVal hwnd%, _

                    ByVal index%, ByVal style&)

Declare Function GetWindowLong& Lib "User" (ByVal hwnd%, _

                    ByVal index%)

Declare Function GetSystemMetrics% Lib "User" (ByVal iIndex%)

Declare Function GetWindowRect% Lib "User" Alias "GetWindowRect" _

                    (ByVal hwin%, rectangle As RECT)

Declare Function MoveWindow% Lib "User" Alias "MoveWindow" _

                    (ByVal hwin%, ByVal x%, ByVal y%, ByVal dx%, _

                    ByVal dy%, ByVal fRepaint%)

' GetWindowLong Constants

Const GWL_STYLE = -16

' Window Styles Constants

Global Const WS_CAPTION = &HC00000

' System Metrics Constants

Global Const SM_CYCAPTION = 4

'**************************************************************

' FUNCTION: RemoveCaptionBar

'

' PURPOSE:

'   Removes the caption bar, which includes the system menu

'   and minimize and maximize buttons, from a form.

'

' ARGUMENTS:

'   F - The form object from which to remove the caption bar.

'

' USAGE:

'   Enter the following for the OnOpen property of a form called

'   MyForm:

'

'       =RemoveCaptionBar(Forms![MyForm])

'

' SIDE AFFECTS:

'   With a normal form, the form opens slightly lower than

'   expected. With a dialog form (PopUp=Yes, Modal=Yes), the form

'   opens slightly higher than expected. Also, you cannot close the

'   form using the Microsoft Access menu; you must close it

'   programmatically.

'

'***************************************************************

Function RemoveCaptionBar (F As Form)

    Dim OldStyle As Long, NewStyle As Long

    Dim R As RECT

    Dim RetVal As Integer

    Dim dx As Integer, dy As Integer

    ' Get the current window style of the form.

    OldStyle = GetWindowLong(F.hwnd, GWL_STYLE)

    ' Set the window style to be the same, minus the caption bar.

    NewStyle = OldStyle And Not WS_CAPTION

    'Change the window style of the form.

    OldStyle = SetWindowLong(F.hwnd, GWL_STYLE, NewStyle)

    ' The caption is removed, but the border has not snapped down

    ' .. onto the smaller window. We will call the Windows API to

    ' .. move and size the window to the same location and size,

    ' .. with the window shortened by the length of the caption bar.

    RetVal = GetWindowRect(F.hwnd, R)

    dx = R.x2 - R.x1

    dy = R.y2 - R.y1 - GetSystemMetrics(SM_CYCAPTION)

    RetVal = MoveWindow(F.hwnd, R.x1, R.y1, dx%, dy%, True)

End Function

Creating a Form with No Caption Bar

-----------------------------------

The following instructions show how to create a form that does not

have a caption bar:

1. Create or open a database in Microsoft Access.

2. Create a new, blank, unbound form and save it with the name

   NoCaption.

3. Change the OnOpen property of the form to read:

      =RemoveCaptionBar(Forms![NoCaption])

4. From the View menu, choose Form.

Additional reference words: 1.00 1.10 menu bar


INF: How to Create a Dynamic Crosstab Report

 Article Number: Q103262

 CREATED: 19-AUG-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Using Microsoft Access version 1.x, you may want to create dynamic reports

based on parameter crosstab queries, or have reports to match a dynaset

returned by a such a query. Dynamic reports allow your customized reports

to show only the most recently modified data and eliminate the need for

fixed column headings and empty columns.

dynamic

The example below uses starting and ending dates entered on a form as

the parameters in a crosstab query. When a button on the form is

chosen, Access Basic functions run the crosstab query, which creates a

dynaset whose contents are displayed in a report.

In the following example, the report shows which employees had sales

for the current week, based on the dates entered on the form.

MORE INFORMATION

The steps below show how to create a dynamic crosstab report based on

tables in the sample database NWIND.MDB.

The following new objects must be added to the database: one table,

one query, one form, one report and two functions. Each item is

explained in a separate section below.

TABLE: XTabResult

-----------------

This table must contain enough columns to hold the maximum number of

fields that the crosstab query can possibly generate. The table is

later filled with data by Access Basic functions.

For this example, the maximum number of fields generated by the

crosstab query is 10, with no primary key necessary. Create a new

table with 10 columns (columns 0-9) with the Text data type (for

example, Column0, Column1, and so forth).

QUERY: CrossQry

---------------

Create a new crosstab query based on the Employees, Orders, Order

Details, and Products tables. (These tables are already joined, based

on previously created relationships in the NWIND database.) To do

this, use the following steps:

1. Choose the Query button in the Database window, then choose the New

   button.

2. Add the Employees, Orders, Order Details, and Products tables.

3. Drag the following fields to the query grid and add the values

   shown below:

   NOTE: To display the crosstab field, choose Crosstab from the Query

   menu.

      Field: Order Amount

         Table: Orders

         Total: Sum

         Crosstab: Value

      Field: Product Name

         Table: Products

         Total: Group By

         Crosstab: Row Heading

      Field: RowTotal:Order Amount

         Table: Orders

         Total: Sum

         Crosstab: Row Heading

      Field: Last Name

         Table: Employees

         Total: Group By

         Crosstab: Column Heading

      Field: Order Date

         Table: Orders

         Total: Where

         Crosstab:

         Criteria: Between [Start Date] and [End Date]

   If you choose SQL from the View menu, the SQL statement should look

   like the following:

      PARAMETERS [Start Date] DateTime, [End Date] DateTime;

      TRANSFORM Sum(Orders.[Order Amount]) AS [SumOfOrder Amount]

      SELECT Products.[Product Name], Sum(Orders.[Order Amount])

      AS RowTotal

      FROM Employees, Orders, [Order Details], Products, Orders

      INNER JOIN [Order Details]

      ON Orders.[Order ID] = [Order Details].[Order ID], Employees

      INNER JOIN Orders

      ON Employees.[Employee ID] = Orders.[Employee ID], Products

      INNER JOIN [Order Details]

      ON Products.[Product ID] = [Order Details].[Product ID]

      WHERE ((Orders.[Order Date] Between [Start Date] And [End Date]))

      GROUP BY Products.[Product Name]

      PIVOT Employees.[Last Name]

      WITH OWNERACCESS OPTION;

4. In the Query Parameters box, add two parameters with the same data

   type, as follows:

      Parameter     DataType

      ------------------------

      [Start Date]   Date/Time

      [End Date]     Date/Time

FORM: XTabSample

----------------

1. Create an unbound form. Add two unbound text box controls with the

   following properties:

      (Text_Box_1) ControlName: Start Date

      (Text_Box_2) ControlName: End Date

2. Add a button to the form with the following properties:

      Caption: "Print Report"

      OnPush:  =XTabPrint()

REPORT: CrossReport

-------------------

1. Create a bound report with Page Header and Detail sections and the

   following RecordSource property:

      RecordSource:  XTabResult

2. In the page header, create 10 tabular text box controls, without

   labels, and change the ControlSource property of each to one of the

   matching functions below:

      =GetPageHdr(0)  =GetPageHdr(1)  =GetPageHdr(2)  =GetPageHdr(3)

      =GetPageHdr(4)  =GetPageHdr(5)  =GetPageHdr(6)  =GetPageHdr(7)

      =GetPageHdr(8)  =GetPageHdr(9)

   For example, the ControlSource property of the first text box should

   be set to =GetPageHdr(0), the second to =GetPageHdr(1), and so

   forth.

3. In the Detail section, create 10 tabular text box controls without

   labels. Bind each of these controls to one of each of the fields in

   the XTabResult table:

      [Column0] [Column1] [Column2] [Column3] [Column4] [Column5]

      [Column6] [Column7] [Column8] [Column9]

MODULE: <Any Name>

------------------

Create a new module with the following Access Basic code and call it

any name you choose:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   Option Compare Database   'Use database order for string comparisons.

   Option Explicit

   '==================

   ' Global variables

   '==================

   Dim MyFields()            ' For holding field names.

   Dim nColumns As Integer   ' For holding the number of columns.

   '=====================

   ' GetPageHdr Function

   '=====================

   Function GetPageHdr (col)

      If (col < nColumns) Then

         GetPageHdr = MyFields(col)

      Else

         GetPageHdr = ""

      End If

   End Function

   '====================

   ' XTabPrint Function

   '====================

   Function XTabPrint ()

      Dim MyDB As Database, MyTable As Table

      Dim MyDyna As Dynaset, MyQueryDef As QueryDef

      Dim MySnap As Snapshot, i As Integer

      ' Create a dynaset from the query.

      Set MyDB = CurrentDB()

      Set MyQueryDef = MyDB.OpenQueryDef("CrossQry")

      MyQueryDef![Start Date] = Forms![XTabSample]![Start Date]

      MyQueryDef![End Date] = Forms![XTabSample]![End Date]

      Set MyDyna = MyQueryDef.CreateDynaset()

      MyQueryDef.Close

      ' Get field information and store the field names.

      Set MySnap = MyDyna.ListFields()

      MySnap.MoveLast

      MySnap.MoveFirst

      nColumns = MySnap.RecordCount

      ReDim MyFields(nColumns)

      i = 0

      While Not MySnap.EOF

         MyFields(i) = MySnap!Name

         i = i + 1

         MySnap.MoveNext

      Wend

      MySnap.Close

      ' Delete the contents of the XTabResult table.

      Set MyTable = MyDB.OpenTable("XTabResult")

      While Not MyTable.EOF

         MyTable.Delete

         MyTable.MoveNext

      Wend

      ' Dump the dynaset into the XTabResult table.

      ' Table should have a column called COLUMN# for each column in

      ' the crosstab dynaset.

      While Not MyDyna.EOF

         MyTable.AddNew

         For i = 0 To nColumns - 1

            MyTable("Column" & i) = MyDyna(MyFields(i))

         Next

         MyTable.Update

         MyDyna.MoveNext

      Wend

      MyTable.Close

      MyDyna.Close

      ' Print the report.

      DoCmd OpenReport "CrossReport", A_PREVIEW

   End Function

Choosing a Date Range

---------------------

After you create the new database objects specified above, you will be

able to open the XTabSample form and enter starting and ending dates

on the form. A recommended data range is 1/1/91 through 12/21/92.

However, if you alternate short date ranges with long date ranges, you

will see how the report dynamically changes to fit the data.

After entering the date range, choose the Print Report button on the

form to display your dynamic report.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 154-159

Additional reference words: 1.00 1.10 Reports


INF: Updating Summary Information with Data from Second Table

 Article Number: Q103269

 CREATED: 19-AUG-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to create a query that will update a record

in one table with data from another table.

MORE INFORMATION

The sample query below adds data from the Current Week table to the

records in the Yearly Rainfall table.

NOTE: This type of query will not work if the data being added is the

result of a totaling or grouping query. For more information on how to

update a record with the result of a totaling or grouping query, query

on the following words here in the Microsoft Knowledge Base:

   access and update and dlookup

1. Create a new table with the following fields and save it as Yearly

   Rainfall:

      City      Inches   Last Updated

      -------------------------------

      Baroda     0.5     4/2/93

      Basildon  22.0     4/2/93

      Beaver    18.0     4/2/93

2. Create a new table with the following fields and save it as Current

   Week:

      City      Inches   Week Of

      --------------------------

      Baroda     0.1     4/9/93

      Basildon   2.0     4/9/93

      Beaver     2.5     4/9/93

3. Create a new query based on the tables Yearly Rainfall and Current

   Week. Join the tables on the City field.

4. From the Query menu, choose Update.

5. Drag the Last Updated and Inches fields from the Yearly Rainfall

   table to the query grid.

6. Create the following entries in the Update To row of the query

   grid:

      Field: Last Updated

         Update To: [Current Week].[Week Of]

      Field: Inches

         Update To: [Yearly Rainfall].[Inches]+[Current Week].[Inches]

7. Save and then run the query.

The data in the table Yearly Rainfall will now be:

      City      Inches     Last Updated

      ---------------------------------

      Baroda     0.6       4/9/93

      Basildon  24.0       4/9/93

      Beaver    20.5       4/9/93

Additional reference words: 1.00 1.10 2.00 Total Archive History


INF: Graphing Current Sales Compared with Accumulated Sales

 Article Number: Q103270

 CREATED: 19-AUG-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article describes how to create a graph that displays each customer's

total sales for all years compared with their sales for 1992. The data in

the graph is also broken out according to the company from which the orders

were shipped.

This example uses tables in the sample database NWIND.MDB.

MORE INFORMATION

How to Create the Queries

-------------------------

1. Create the following new query based on the Orders table, and then

   save the query as Total Sales:

      Field:  Customer ID   Ship Via   Order Amount

      Total:  Group By      Group By   Sum

2. Create the following new query based on the Orders table, and then

   save this query as 1992 Sales:

      Field:    Customer ID   Ship Via   Order Amount   Order Date

      Total:    Group By      Group By   Sum            Where

      Criteria:                                         >=#1/1/92#

3. Create a new query based on the Total Sales and 1992 Sales queries.

4. Join on the field [Customer ID]. Double-click the join line and

   select the option Include ALL Records From Total Sales.

5. Join on the field [Ship Via]. Double-click the join line and select

   the option Include ALL Records From Total Sales.

6. Drag [Customer ID], [Ship Via], and [SumofOrder Amount] from Total

   Sales to the query grid. Add the label Total: to [Sum of Order

   Amount] as follows:

      Total: [SumofOrder Amount]

7. Drag [SumofOrder Amount] from 1992 Sales and add the label 1992 as

   follows:

      1992: [SumofOrder Amount]

8. Run the query to verify that it works correctly and then save it

   as Sales Summary.

How to Create the Graph

-----------------------

1. Create a new, blank report based on the Customers table. Display

   the field list and drag the Customer ID field to the detail section.

2. Create a new graph in the detail section by selecting the Graph

   tool from the Toolbox and drawing an unbound object frame.

3. Make the following selections in the Graphing Wizard:

   a. Data source: Sales Summary

         Totals: Sum

   b. Which field(s) for data and labels: Ship Via, Total, and 1992

   c. What labels do you want: Ship Via

   d. What labels for the legend: Total and 1992

   e. Link the Graph to the Report: Yes

   f. Which fields will link: Customer ID = Customer ID

4. Save the report and then preview it. For each customer, the report

   should display a graph of that customer's total sales and 1992 sales

   organized by the shipping company.

Additional reference words: 1.00 1.10 overlay multiple summary


INF: Reporting the Median Value of a Group of Records

 Article Number: Q103271

 CREATED: 19-AUG-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article demonstrates how to create a report that shows the median

value for a set of records. Note that a median value is the midpoint

in an ordered set of values (the value above and below which there is

an equal set of values), or the arithmetic mean of the two middle

numbers if there is no one middle number.

MORE INFORMATION

The following sample report is based on the Orders table in the sample

database NWIND.MDB. The report will group records by the Customer ID

field, and will sort records within each group by the Freight

field.

1. Create a new report based on the Orders table in NWIND.MDB.

2. From the View menu, choose Sorting And Grouping. Select Customer ID

   as the first field. Set GroupHeader and GroupFooter to Yes.

3. Select Freight as the second field. Select Ascending for the

   Sort Order.

4. From the View menu, choose Field List. Drag the Customer ID field

   from the field list to the Customer ID header on the report.

5. Drag the Freight field to the detail section.

6. Add the following fields to the Customer ID header:

      Name         Control Source

      -------------------------------

      IDCount      =Count(*)

      Half         =Int([IDCount]/2)

      Odd          =([IDCount] Mod 2)

   NOTE: The Name property is called ControlName in version 1.x.

7. Add the following controls to the detail section:

   NOTE: In the following example, an underscore (_) is used as a

   line-continuation character. Remove the underscore when re-creating

   this example.

      Name         Control Source

      (Control Name in version 1.x)

      -------------------------------------------------------------

      Position     =1

      Arg1         =IIf([Position]=([Half]+[Odd]),[Freight],0)

      Arg2:        =IIf([Odd]=0,IIf([Position]=([Half]+_

                      [Odd]+1),[Freight],0))

   Set the RunningSum property to Over Group for each of the controls in

   this section.

8. Add the following control to the Customer ID Footer:

      Name         Control Source

      ---------------------------------------------------

      Median       =IIf([Odd]=0,([Arg1]+[Arg2])/2,[Arg1])

9. Save and run the report.

Additional reference words: 1.00 1.10 2.00


PRA: Setup Cannot Recognize Forward Slash in Path

 Article Number: Q103272

 CREATED: 19-AUG-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

------------------------------------------------------------

---------

SYMPTOMS

When you are running the Microsoft Access Setup program, the

following

error message may appear if your path statement contains

forward

slashes (/):

   Badly formed Setup Script Command

   "CreateIniKeyValue C:/WIN\WINHELP.INI Files CUECARDS.DLL

   C:\ACCESS\, Can't find CUECARDS.DLL O"

CAUSE

The Setup routine used by Microsoft Access cannot interpret

the

forward slash (/) as used in the path statement. When

Microsoft Access

calls for the path variable, the result is C:/WINDOWS.

Microsoft

Access is unable to append the addenda necessary for the

various

.INI file entries.

RESOLUTION

Change forward slashes to back slashes (\) in all paths

statements and

path variables in your AUTOEXEC.BAT and CONFIG.SYS files.

For example,

change

   PATH C:/WINDOWS;C:/DOS;

to read

   PATH C:\WINDOWS;C:\DOS;

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

versions 1.0 and 1.1. We are researching this problem and

will post

new information here in the Microsoft Knowledge Base as it

becomes

available.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Type the following at the command prompt:

      PATH C:/WINDOWS;C:/DOS;

2. Start Microsoft Windows.

3. Install Microsoft Access and start the Setup program.

   The error will occur at the end of Setup, when Microsoft

Access

   tries to update the .INI files.

Additional reference words: 1.00 1.10


INF: How to Create Tasks in MS Project for Windows Using DDE

 Article Number: Q103273

 CREATED: 19-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Before data can be sent to Microsoft Project version 3.0 for Windows,

a task must exist in the active project. This article contains sample

code to start Project, create 10 tasks, and fill the task fields with

data.

MORE INFORMATION

This article assumes that the user has some knowledge of Access Basic

and is intended as a demonstration of the technique required to create

a task in Project. The following function is not intended to

be replicated exactly.

1. Create a new module in a Microsoft Access database. Add the

   following statement to the Declarations section of the module:

   '------------------------------------------------------------------

   'Declarations Section

   '------------------------------------------------------------------

   Option Explicit

2. Add the following function to the module:

   NOTE: In the following sample code, an underscore (_) is used as a

   line-continuation character. Remove the underscore when re-creating

   this code in Access Basic.

'---------------------------------------------------------------------

'Start of Function

'---------------------------------------------------------------------

Function dde_createtasks (ProjectPath)

   Const DDE_ERROR = 282   'Define DDE return error.

   Dim Temp, Mynum, Chan1, Chan2 'Define variables.

   On Error GoTo StartUp  'If Project is not open, start it.

   Chan1 = DDEInitiate("winproj", "system")

   'Initiate a channel to Project.

   On Error GoTo QuitNow:

   Chan2 = DDEInitiate("winproj", DDERequest(Chan1, "ActiveProject"))

   'Initiate a channel to the active Project.

   For Mynum = 1 To 10

      DDEExecute Chan2, "EditGoto .ID=[" & Mynum & "]"

      'Go to the task.

      DDEExecute Chan2, "SetField .Field=[Name] .Value=MyNewTask" &_

         Mynum & " .Create=[Yes]"

      'Create a new task.

      DDEPoke Chan2, "T((" & Mynum & "),(Name,Duration))", "Task_

         Number " & Mynum & Chr(9) & Mynum & "d"

      'Send information to Project.

   Next

   DDETerminateAll 'Terminate the DDE channel.

   Exit Function

   QuitNow:

      DDETerminateAll  'Terminate the DDE channel.

      Exit Function

   StartUp:

      If Err = DDE_ERROR Then

         Temp = Shell(ProjectPath, 6)  'Start Project.

         Resume    ' Re-execute DDEInitiate() function.

      End If

End Function

'---------------------------------------------------------------------

'End of Function

'---------------------------------------------------------------------

3. To test this function, type the following in the Immediate window

      ?dde_createtasks ("<c:\winproj\winproj.exe>")

   where "<c:\winproj\winproj.exe>" is the path to Project.

Project installs two files, MACRO.WRI and DDEINFO.WRI, in the program

directory that contain more information about macro commands and

dynamic data exchange (DDE) functionality. These files can be opened

in Microsoft Windows Write.

REFERENCES

==========

Microsoft Access "Introduction to Programming," version 1.0, Chapter 9,

"Dynamic Data Exchange"

Additional reference words: 1.00 1.10 2.00 dde


INF: How to Mark Records with Unmatched or Invalid Values

 Article Number: Q103400

 CREATED: 23-AUG-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

A table imported from an external source may contain invalid or erroneous

data. This article demonstrates how to use an update query to compare an

imported table to a reference table and mark the imported records that do

not match the reference table values.

In Microsoft Access version 2.0, this functionality is provided by the Find

Unmatched Query Wizard. For more information, search for "Find Unmatched

Query Wizard" using the Help menu in Microsoft Access 2.0.

MORE INFORMATION

For the following example, assume that you have imported a customer

order table and have found that the records in the imported table have

valid but misspelled customer names. The example below demonstrates

how to compare names in the imported table with a table of valid names

and mark the imported records that do not match the reference table.

1. Create two tables. One table will be called Reference Table and the

   other will be called Imported Table. Create a field called Customer

   Name in each table, and add the following entries:

      Reference Table   Imported Table

      --------------------------------

      ACE               ACE

      BAT               ACE

      CAD               ACA

      CAT               BAT

                        BAR

                        CAD

                        CAD

                        CAT

2. Add a field named Matched to the Imported Table. Assign the Yes/No

   data type to this field. Note that the default values in this field

   will be set to No.

3. Create a query based on both tables. Join the tables by dragging

   the Customer Name field from the Reference Table to the Customer

   Name field on the Imported Table. Then choose Update on the Query

   menu.

4. Fill out the query grid with the following entries:

      Query: Mark Unmatched

      ----------------------------------------------

      Field name: Customer Name

         Table: Imported Table

         Criteria: [Reference Table].[Customer Name]

      Field name: Matched

         Table: Imported Table

         Update to: "Yes"

5. Run the query. The Matched field will be set to Yes for all records

   in the Imported Table that have a Customer Name that matches a

   value in the Customer Name field of the Reference Table.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 7, "Designing Action

Queries and Parameter Queries, page 176

Additional reference words: 1.00 1.10 unmatched misspell spell


INF: How to Create Custom Domain Function Similar to DCount()

 Article Number: Q103401

 CREATED: 23-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Custom domain functions can be used to provide functionality other

than that provided by the standard domain functions DLookup(), DMin(),

DLast(), and so on.

This article demonstrates how to write a custom domain function that

is similar to the DCount() function. In addition, it demonstrates a

sample function, DFix(), to overcome limitations in concatenating

variables in criteria strings. Information about the limitations of

custom domain functions is at the end of this article.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

The DRecCount() sample custom domain function is useful when the

domain is a totals or aggregate query based on an attached SQL table.

The DRecCount() custom domain function will accurately return the

count of such a dynaset.

To create these examples, open a new module within Microsoft Access

and add the following functions with the appropriate declaration

section:

'-------------------------------------

' GLOBAL DECLARATION

'-------------------------------------

Option Compare Database

Option Explicit

Function DRecCount (FieldName, DomainName, Criteria)

   '---------------------------------------------------

   ' Use DRecCount to return a count

   '   of records when the domain is a query based on a

   '   totals/aggregate query on an attached SQL table.

   '---------------------------------------------------

  Dim MyDB As Database, Myset As Dynaset

  If VarType(FieldName) <> 8 Or Len(FieldName) = 0 Then

    MsgBox "You Must Specify a Field name", , "DRecCount"

    Exit Function

  End If

  If VarType(DomainName) <> 8 Or Len(DomainName) = 0 Then

    MsgBox "You Must Specify a Domain name", , "DRecCount"

    Exit Function

  End If

  If VarType(Criteria) <> 8 And Not IsNull(Criteria) Then

    MsgBox "Invalid Criteria", , "DRecCount"

    Exit Function

  End If

  Set MyDB = CurrentDB()

  Set Myset = MyDB.CreateDynaset(DomainName)

  If FieldName <> "*" Then

    If Len(Criteria) > 0 Then

      Criteria = Criteria & " AND "

    End If

    Criteria = Criteria & "[" & FieldName & "] Is Not Null"

    Myset.Filter = Criteria

    Set Myset = Myset.CreateDynaset()

  End If

  If Myset.EOF Then

    DRecCount = 0

  Else

    Myset.MoveLast

    DRecCount = Myset.recordcount

  End If

  Myset.Close

  MyDB.Close

End Function

Function DFix (ByVal T, DQuote As Integer)

   '------------------------------------------------------------------

   ' Fixes string arguments that are passed

   '   to Criteria in domain functions

   '

   ' DQuote should be TRUE or -1 if Double Quotes (") delimit Criteria

   ' DQuote should be FALSE or 0 if Single Quotes (') delimit Criteria

   '

   ' e.g. this gives an error

   '   (note the quote (') in the data)

   '   X="Mike's Diner"

   '   A=DRecCount("*","Clients","Name='" & X & "'")

   '

   ' Use either:

   '   X=DFix("Mike's Diner",False)

   ' Or:

   '   A=DRecCount("*","Clients","Name='" & DFix(X,False) & "'")

   '------------------------------------------------------------------

  Dim P As Integer, OldP As Integer, Q As String * 1

  If VarType(T) = 8 Then

    If DQuote = 0 Then

      Q = "'"

    Else

      Q = """"

    End If

    P = InStr(T, Q)

    Do While P > 0

      OldP = P + 2

      T = Left$(T, P) & Q & Mid$(T, P + 1)

      P = InStr(OldP, T, Q)

    Loop

  End If

  DFix = T

End Function

General Limitations to Custom Domain Functions

----------------------------------------------

 - You cannot use Forms!FormName!ControlName or Form.ID in quotation

   marks. The following example is not allowed:

      DRecCount("ID","LOG","Name=Form.Name")

   Instead, use:

      DRecCount("ID","LOG","Name = '" & DFix(Name,False) & "'")

   Note that the DFix() function is another custom function that is

   demonstrated in this article.

 - You must always specify a criteria, even if it is "" or Null.

 - Do not place field names or domain names in brackets. For example,

   use "First Name" instead of "[First Name]".

NOTE: DFix() can be used with other criteria strings, such as the

FindRecord method, or when building custom SQL criteria.

REFERENCES

==========

For more information on custom domain functions, query on the

following words here in the Microsoft Knowledge Base:

   custom and domain and function

Additional reference words: 1.00 1.10 2.00 Modules ab


INF: Snapshot and Underlying Table Updated Until Snapshot Full

 Article Number: Q103402

 CREATED: 23-AUG-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

A snapshot, along with its underlying table, continues to update until the

snapshot is completely filled with data. The link to the snapshot's

underlying table is not "severed" until you move to the end of the

snapshot's recordset.

When you first create a snapshot recordset, memory is allocated to store

data. In order to optimize memory, Microsoft Access does not load all the

table's records at once, meaning that you have only a partial recordset in

memory. When you move to the end of the snapshot, the data is then

"severed" from the live table.

MORE INFORMATION

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

Steps To Reproduce Behavior

---------------------------

The first function, Udate(), creates a snapshot of a table, adds a new

record to the table, and then prints the snapshot to the Immediate window.

The snapshot includes the new record in its output.

The second function, NoUdate(), also creates a snapshot of a table, moves

to the end of the snapshot, adds a new record to the table, and then prints

the snapshot. In this example, the snapshot does not include the new record

since the MoveLast command is executed before the new record is added.

Function Udate()

----------------

1. Open the sample database NWIND.MDB.

2. Copy the Categories table to a table called Cat.

3. Create a new Access Basic module and add the following function:

   Function Udate ()

      Dim MyDB As Database, MyTable As Table, MySnap As Snapshot

      Set MyDB = CurrentDB()

      Set MyTable = MyDB.OpenTable("Cat")

      Set MySnap = MyTable.CreateSnapshot()

      MyTable.AddNew

         MyTable.[Category Name] = "TEST"

         MyTable.[Description] = "Still being updated"

      MyTable.Update

      Debug.Print "Category Name / Description"

      MySnap.MoveFirst

      Do While Not MySnap.EOF

         Debug.Print MySnap.[Category Name] & " / " & MySnap.[Description]

         MySnap.MoveNext

      Loop

   End Function

4. In the Immediate window, type the following:

      ?Udate()

The snapshot contains the new record.

Function NoUdate()

------------------

1. Open the Cat table in Datasheet view.

2. Delete the TEST record added above.

3. Add the following function to the module you created in step 2 of

   the previous procedure:

   Function NoUdate ()

      Dim MyDB As Database, MyTable As Table, MySnap As Snapshot

      Set MyDB = CurrentDB()

      Set MyTable = MyDB.OpenTable("CAT")

      Set MySnap = MyTable.CreateSnapshot()

      MySnap.MoveLast

      MyTable.AddNew

         MyTable.[Category Name] = "TEST"

         MyTable.[Description] = "Still being updated"

      MyTable.Update

      Debug.Print "Category Name / Description"

      MySnap.MoveFirst

      Do While Not MySnap.EOF

         Debug.Print MySnap.[Category Name] & " / " & MySnap.[Description]

         MySnap.MoveNext

      Loop

   End Function

4. In the Immediate window, type the following:

      ?NoUdate()

Note that since the snapshot was filled (MoveLast was executed) before the

new record was added, the snapshot does not contain the new record added to

the Cat table.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, "CreateSnapshot

Method," pages 91-92

For more information on creating a snapshot, search for "CreateSnapshot"

using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 tables snap shot


INF: Custom Domain Functions Similar to DFirst() and DLast()

 Article Number: Q103403

 CREATED: 23-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

By design, the DFirst() and DLast() functions always return the first and

last record that you entered in the underlying table, not the first and

last record listed in the sorted query. This article provides examples of

how to write custom domain functions that can be used in a way similar to

DFirst() and DLast().

The DStart() and DEnd() custom domain examples in this article return

the first and last records listed in a sorted query. Also included in

this article is the DFix() function, which can be used to overcome a

limitation of concatenating variables into criteria strings.

Information about the limitations of custom domain functions and how

to use DFix() appears at the end of the article.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications with the programming tools

provided with Microsoft Access.

MORE INFORMATION

Create a new module within Microsoft Access and add the following

functions with the appropriate declaration section. Each command

should be entered on one line.

NOTE: In the following sample code, an underscore (_) is used as a

line-continuation character. Remove the underscore when re-creating

this code in Access Basic.

'-------------------------------------

' GLOBAL DECLARATION

'-------------------------------------

Option Compare Database

Option Explicit

'--------------------------------------

' Use DStart()instead of DFirst() to return

' the first sorted record in a domain.

'--------------------------------------

Function DStart (FieldName As String, DomainName As String, _

                 Criteria As String)

   Dim MyDB As Database, Myset As Dynaset

   ' ERROR OUT IF THERE IS NO FIELDNAME SENT.

   If Len(FieldName) = 0 Then

      MsgBox "You Must Specify a Field name", , "DStart"

      End

   End If

   ' ERROR OUT IF THERE IS NO DOMAIN SENT.

   If Len(DomainName) = 0 Then

      MsgBox "You Must Specify a Domain name", , "DStart"

      Exit Function

   End If

   Set MyDB = CurrentDB()

   Set Myset = MyDB.CreateDynaset(DomainName)

   '

   If Len(Criteria) > 0 Then

      Myset.Filter = Criteria

      Set Myset = Myset.CreateDynaset()

   End If

   ' IF THERE ARE NO RECORDS, RETURN THE NULL, ELSE RETURN THE VALUE

   ' OF THE FIRST RECORD.

   If Myset.EOF Then

      DStart = Null

   Else

      Myset.MoveFirst

      DStart = Myset(FieldName)

   End If

   Myset.Close

   MyDB.Close

End Function

'-------------------------------------------

'Use DEnd()instead of DLast() to return

'  the last sorted record in a domain.

'--------------------------------------

Function DEnd (FieldName As String, DomainName As String, _

               Criteria As String)

   Dim MyDB As Database, Myset As Dynaset

   ' ERROR OUT IF THERE IS NO FIELDNAME SENT.

   If Len(FieldName) = 0 Then

      MsgBox "You Must Specify a Field name", , "DEnd"

      Exit Function

   End If

   ' ERROR OUT IF THERE IS NO DOMAINNAME SENT.

   If Len(DomainName) = 0 Then

      MsgBox "You Must Specify a Domain name", , "DEnd"

      Exit Function

   End If

   Set MyDB = CurrentDB()

   Set Myset = MyDB.CreateDynaset(DomainName)

   If Len(Criteria) > 0 Then

      Myset.Filter = Criteria

      Set Myset = Myset.CreateDynaset()

   End If

   If Myset.EOF Then

      DEnd = Null

   Else

      Myset.MoveLast

      DEnd = Myset(FieldName)

   End If

   Myset.Close

   MyDB.Close

End Function

Function DFix (ByVal T, DQuote As Integer)

   '------------------------------------------------------------------

   ' Fixes string arguments that are passed

   '   to Criteria in domain functions

   '

   ' DQuote should be TRUE or -1 if Double Quotes (") delimit Criteria

   ' DQuote should be FALSE or 0 if Single Quotes (') delimit Criteria

   '

   ' For example, this gives an error

   '   (note the quote (') in the data)

   '   X="Mike's Diner"

   '   A=DStart("ID","Clients","Name='" & X & "'")

   '

   ' Use either:

   '   X=DFix("Mike's Diner",False)

   ' Or:

   '   A=DStart("ID","Clients","Name='" & DFix(X,False) & "'")

   '------------------------------------------------------------------

   Dim P As Integer, OldP As Integer, Q As String * 1

   If VarType(T) = 8 Then

      If DQuote = 0 Then

         Q = "'"

      Else

         Q = """"

      End If

      P = InStr(T, Q)

      Do While P > 0

         OldP = P + 2

         T = Left$(T, P) & Q & Mid$(T, P + 1)

         P = InStr(OldP, T, Q)

      Loop

   End If

   DFix = T

End Function

General Limitations to Custom Domain Functions

----------------------------------------------

 - You cannot use Forms!FormName!ControlName or Form.ID in quotation

   marks. For example, instead of

      DStart("ID","LOG","Name=Form.Name")

   use:

      DStart("ID","LOG","Name = '" & DFix(Name,False) & "'")

   The DFix() function is another custom function.

 - You must always specify a criteria, even if it is "" or Null.

 - Do not place field names or domain names in square brackets ([]),

   that is, use "First Name" instead of "[First Name]".

NOTE: DFix() can be used anywhere you concatenate criteria strings,

such as the FindFirst method or when building custom SQL criteria.

REFERENCES

==========

For information about other custom domain functions, query on the

following words here in the Microsoft Knowledge Base:

   custom and domain and function

Additional reference words: 1.00 1.10 2.00 ab dfirst dlast modules


INF: How to Use the Status Bar Progress Meter

 Article Number: Q103404

 CREATED: 23-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The SysCmd() function in Microsoft Access can be used to create a

progress meter in the status bar to give a visual representation of

the progress of an operation. When you perform an operation with a

known duration or number of steps, you can use the SysCmd() function to

visually represent the operation's progress.

The following information documents the use of the SysCmd() function

in Microsoft Access to display a progress meter.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

The syntax of the SysCmd() is as follows:

   SysCmd(<action> [, <text>][, <value>])

Where

    - <action> is a numeric expression identifying the type of action

      to take. The expression is one of the following:

         1 - Initialize the progress meter.

         2 - Update the progress meter with the specified value.

         3 - Remove the progress meter.

    - <text> is a string expression identifying the text that will

      appear left-aligned in the status bar to the left of the

      progress meter.

    - <value> is a numeric expression that controls the display of the

      meter. This is required when the action is 1 or 2.

      When the action is 1, the value indicates the maximum number the

      meter should display, with the maximum value for the meter

      indicating 100 percent.

      When the action is 2, the value is used to calculate and update

      the percentage complete in the progress meter.

NOTE: The SysCmd() function returns NULL, which is not used.

Initializing the Progress Meter

-------------------------------

When the <action> argument is 1, the <value> argument is the maximum

value of the meter, or 100 percent. To display a progress meter with a

maximum value of 1000 initialized, type the following in the Immediate

window:

   ? SysCmd(1, "This is my meter!", 1000)

Updating the Progress Meter

---------------------------

When the <action> argument is 2, the <value> argument is used by

SysCmd() to calculate the percentage displayed by the meter. To update

the progress meter to 25 percent complete, type the following in the

Immediate window:

   ? SysCmd(2, 250)

Removing the Progress Meter

---------------------------

When the <action> argument is 3, the progress meter is removed from

the status bar. To remove the meter, type the following in the

Immediate window:

   ? SysCmd(3)

Using SysCmd() in an Access Basic Function

------------------------------------------

The following sample function will open the Customers table in the

sample database NWIND.MDB. The function will display a list of the

contact names in the table. As the names are displayed, a meter will

progress in the status bar indicating the relative progress of the

function.

1. Open the sample database NWIND.MDB.

2. Create a new module called "Meter Test."

3. Place the following statement in the declarations section:

      Option Explicit

4. Create a new function called "Meter ()" as follows:

   Function Meter ()

      Dim MyDB As Database, MyTable As Table

      Dim Count As Long

      Dim Progress_Amount As Integer, RetVal As Variant

      Set MyDB = CurrentDB()

      Set MyTable = MyDB.OpenTable("Customers")

      ' Move to last record of the table to get the total

      ' number of records.

      MyTable.MoveLast

      Count = MyTable.RecordCount

      ' Move back to first record.

      MyTable.MoveFirst

      ' Initialize the progress meter.

      RetVal = SysCmd(1, "Reading Data...", Count)

      ' Enumerate through all the records.

      For Progress_Amount = 1 To Count

         ' Update the progress meter.

         RetVal = SysCmd(2, Progress_Amount)

         ' Print the contact name in the Immediate window.

         Debug.Print MyTable![contact name]

         ' Goto the next record.

         MyTable.MoveNext

      Next Progress_Amount

      ' Remove the progress meter.

      RetVal = SysCmd(3)

      End Function

To run the function, type the following in the Immediate window:

   ? Meter()

REFERENCES

==========

Microsoft Access Distribution Kit, "The Secrets of Access Wizards,"

page 30

Additional reference words: 1.00 1.10 2.00 thermometer statusbar


INF: How to Use a Function to Quit Windows

 Article Number: Q103405

 CREATED: 23-AUG-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - Microsoft Access Distribution Kit version 1.1

 - Microsoft Access Developer's Toolkit version 2.0

---------------------------------------------------------------------

While it is possible to quit Microsoft Windows from within a Microsoft

Access program by making use of the Windows application programming

interface (API) function ExitWindows(), Microsoft Windows will not shut

down cleanly. Open files in Windows-based applications may not be saved,

and temporary (.TMP) files may be left on your hard disk.

The sample function listed below demonstrates another method of

shutting down Windows from within Microsoft Access. This method will

save open files before shutting down, and will not leave .TMP files on

your hard disk.

   Function QuitWindows ()

      AppActivate ("Program Manager")

      SendKeys "%{F4}"

   End Function

In the sample function above, the QuitWindows() function activates the

Microsoft Windows Program Manager, and then sends the keystrokes

necessary to instruct the Program Manager to close Windows.

Additional reference words: 1.00 1.10 2.00 WinIss exiting


INF: How to Use Graphic Images as Wallpaper for Forms

 Article Number: Q103428

 CREATED: 24-AUG-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

You can use graphic images as "wallpaper," or background, for your forms to

make them more attractive.

MORE INFORMATION

The following example demonstrates how to add wallpaper to a form:

1. Start the Microsoft Windows Paintbrush program (or any graphics program

   of your choice) and open the WINLOGO.BMP bitmap file (or any bitmap file

   of your choice).

2. Select the graphics image. If you are using Paintbrush, choose the Pick

   tool (a pair of open scissors below a dotted rectangle) from the

   toolbox. Select the bitmap image by using the mouse to place the

   crosshairs in the upper-left corner of the bitmap, then click and hold

   down the left mouse button and drag the rectangle to the lower-right

   corner to encompass the entire image.

3. From the Edit menu, choose Copy. This places a copy of the bitmap image

   on the Windows Clipboard.

4. Start Microsoft Access, and open the sample database NWIND.MDB.

5. Open the Customers form in Design view. Select the form by clicking the

   small, white box in the upper-left corner of the form.

6. From the Edit menu, choose Paste. This pastes the bitmap image to an

   object frame control on the form.

   Note that the graphic image does not cover the entire form, but only the

   upper-left corner of it. This is because this particular graphic image

   is too small for the form. To cover the entire form, either use a larger

   graphic image, or use a different graphics program to alter the

   graphic's size.

7. From the Layout menu, choose Send To Back. This puts the graphic image

   in the background.

8. On this form, the BackStyle property for all the label controls is set

   to Clear. In order to make the labels more readable against the new

   background, change the labels' BackStyle properties to Normal. You can

   also change the BackColor properties, using the Color Palette.

REFERENCES

==========

"Inside Microsoft Access," April 1993, Vol. 1, No. 2, pages 1-5

Additional reference words: 1.00 1.10 2.00


PRB: "Out of Memory" or "Query too Complex" Running Report

 Article Number: Q103429

 CREATED: 24-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You receive an "Out of Memory" or "Query too Complex" error message when

you run your report.

CAUSE

Reports create temporary queries for each section of the report, including

the report header, page header, group header, detail section, group footer,

page footer, and report footer.

All of the temporary queries for each report are combined into a segmented

virtual table (SVT). The final output must be compiled within a 64K segment

limit. When this limit is reached, you may see either the "Query too

Complex," or the "Out of Memory" error message.

Similar 64k limits are used to compile and store all of the expressions

from page to page when the report is being processed or to store the

unbound controls or label information. If any of these segments exceed the

limit, controls on the report may displaying the "#Name?" error message.

RESOLUTION

The error messages stated above are related to the complexity of the

report. The following items suggest several ways to reduce the complexity

of your report:

 - Shorten table names, column names, and control names. Reducing a

   30-character name to the minimum length may help.

 - Reduce the number of text fields on the report.

 - Avoid extra overhead by removing any fields in the underlying query

   that are not used in the final output for the report.

 - Reduce expressions in underlying queries. Reducing space used for

   expressions in the select list helps to avoid these errors. If

   possible, place the expressions directly in the report.

 - Move complex expressions to a user-defined function that does all the

   evaluation.

 - Avoid stacked query objects, such as situations in which Query1 is

   used to pull data from Table2, where Query2 filters the data.

   Pulling information together in one query is preferable to having

   multiple queries each doing portions of the task.

 - Avoid basing main reports and their subreports on the same queries.

   Look for stacked query objects and for tables that are unnecessary

   to the subset.

 - Use subreports to break up a complex report into several less

   complicated reports.

Additional reference words: 1.00 1.10 2.00


PRB: Forms and Reports Print Slowly, Large Temporary Files

 Article Number: Q103430

 CREATED: 24-AUG-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You run out of temporary disk space when you print forms and reports.

Or, your reports seem to print very slowly.

CAUSE

Forms and reports that contain lines, bordered fields, or opaque

fields print much more slowly than the same form or report without

graphic objects. This behavior holds true for Microsoft Windows

applications in general.

Because lines, bordered fields, and opaque fields are treated as

bitmaps, a great deal of data is being sent to the printer at once.

Large temporary files are needed to print the form or report.

If you specify an incorrect or low setting for printer memory in

Control Panel, Windows "bands" complex print jobs. It sends small

chunks of graphics to the printer, then clears them after the printer

has processed them. Since Windows cannot band text, it sends TrueType

fonts to the printer as graphics. When this occurs, the files become

extremely large.

When you print your document in landscape format, your print speed may

decrease and your temporary files may increase in size. This problem

occurs primarily because Microsoft Access versions 1.0 and 1.1

print lines as graphics.

Printing a line as a graphic is acceptable if the line is horizontal,

since graphics are sent to the printer one row of pixels at a time.

However, vertical lines can be a problem. In large graphics, a record

is sent to the printer for each pixel in the line. When you print in

landscape format, the printer interprets these horizontal lines as

vertical lines.


PRA: Printer Fonts Cause Text to Shift Down and Right

 Article Number: Q103431

 CREATED: 24-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The first page of a report prints fine, but the text is shifted down and

to the right on the other pages. This shift occurs when you use printer

fonts.

CAUSE

The problem is related to the GENDRV.DLL file. Any printer driver that

uses this .DLL file creates the same distortion when using any printer

fonts.

The following printers use the GENDRV.DLL file:

Generic Printer Driver-GENDRV.DLL (GENDRV.EXE) 06/24/93 version (1.68)

----------------------------------------------------------------------

              Canon LBP 8-III             (CANON.EXE)

              Digital DECLaser 1100       (DEC1.EXE)

              Digital DECLaser 2100/Plus  (DEC1.EXE)

              Digital DECLaser 2200/Plus  (DEC1.EXE)

              Digital DECLaser 3200       (DEC1.EXE)

              Digital LA70                (DEC1.EXE)

              Digital LA75                (DEC1.EXE)

              Digital LA75 Plus           (DEC1.EXE)

              Digital LA324               (DEC1.EXE)

              Digital LJ250/252           (DEC1.EXE)

              Digital LN03/Plus           (DEC1.EXE)

              IBM Laser Printer 4029      (IB4029.EXE)

              Olivetti DM 124 C           (OLIVE.EXE)

              Royal CJP 450               (OLIVE.EXE)

              Seiko CH 4104               (SEIKO.EXE)

              Seiko CH 5504               (SEIKO.EXE)

              Seiko CH 5514               (SEIKO.EXE)

NOTE: The IBM4029 is the only printer driver certified by Microsoft

Compatibility Labs (MCL). All other printers using the GENDRV.DLL file

have been neither tested nor certified by MCL.

RESOLUTION

Use TrueType fonts or, for the IBM4029 printer, use the the most

current Microsoft Windows drivers for this printer, which are

available by calling Lexmark at (606) 232-3000. These drivers are also

available from the Lexmark bulletin board at (606) 232-5238.

The printer driver for Windows version 3.0 is called 29W30_PS.EXE; the

printer driver for both Windows 3.0 and 3.1 is called 29W3X_PP.EXE. A

README.DOC file with installation instructions is included with each

driver.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

versions 1.0, 1.1, and 2.0. We are researching this problem and will post

new information here in the Microsoft Knowledge Base as it becomes

available.

Steps to Reproduce Problem

--------------------------

To duplicate this problem using the sample database NWIND.MDB, do the

following:

1. Open the List of Products by Category report in Design view.

2. From the File menu, choose Print Setup. Change the print driver to

   Canon LBP 8-III or to one of the print drivers listed above.

3. Select all controls in the Page Header section.

4. From the Edit menu, choose either Dutch Scalable or any printer

   font.

5. Print two pages of the report.

   On the first page, the page header controls will be within the

   lines; on the second page, the controls will be below and to the

   right of the lines.

The IBM4029 printer driver is manufactured by Lexmark and the other

printer drivers by other vendors independent of Microsoft; we make no

warranty, implied or otherwise, regarding these products' performance

or reliability.

Additional reference words: 1.00 1.10 2.00


PRB: "Invalid Use of Null" or "#Error" in Defined Function

 Article Number: Q103432

 CREATED: 24-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A user-defined function may return either of these error messages: "Invalid

Use of Null!" or "#Error."

CAUSE

If a field's data type is explicitly defined as any type other than

Variant, Microsoft Access is unable to compare the variable to null.

RESOLUTION

Define the variable as Variant, which includes date/time, floating-point

number, and string data types.

More Information

================

If the following function is used to evaluate a field that may return a

null value, the function will return the error "Invalid Use of Null!" or

"#Error" if the field is null:

   Function IsFieldNull (MyValue As String)

      If IsNull(MyValue) Then

         IsFieldNull = "The field is null!"

      Else

         IsFieldNull = "The field is not null!"

      End If

   End Function

Defining the variable MyValue as Variant by using the method in the

following function will prevent the error "Invalid Use of Null!" or

"#Error" even if the field is null:

   Function IsFieldNull (MyValue As Variant)

      If IsNull(MyValue) Then

         IsFieldNull = "The field is null!"

      Else

         IsFieldNull = "The field is not null!"

      End If

   End Function

REFERENCES

==========

Microsoft Access "Introduction to Programming," Chapter 5

Additional reference words: 1.00 1.10 2.00 pounderror


INF: Creating Mailing Labels for Dot-Matrix Printers

 Article Number: Q103433

 CREATED: 24-AUG-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Creating labels that print on dot-matrix or tractor-feed printers

usually requires you to adjust the page size. Before you create a

mailing label report for these printers, you must first set the

default printer and paper size in Microsoft Windows Control Panel.

MORE INFORMATION

Setting Default Printer/Paper Size in Control Panel

---------------------------------------------------

To set the default printer and paper size, do the following:

1. In the Printers dialog box in Control Panel, select a dot-matrix

   printer, then choose the Set As Default Printer button. (If you do

   not already have a dot matrix printer driver installed, you must

   first install one.)

2. Choose the Setup button to display the dialog box for that printer.

3. In the Paper Size box, select User-Defined Size.

4. In the User-Defined Size dialog box, select the unit of measurement

   and then type the width and the length of the mailing label page.

   To determine the width, measure from the left edge of the leftmost

   label to the right edge of the rightmost label. To determine the

   length, measure from the top of the first label to the top of the

   second label.

   For example, if you use two-up labels that measure 3 inches by 5

   inches (with .25 inches between), set Unit to 0.01 inches, Width to

   625, and Length to 525.

5. Choose OK twice, then choose Close.

   Once you set the printer and paper size, you can create a mailing

   label report for a dot-matrix printer using the Mailing Label

   ReportWizard, or using tools provided in the Design view of the

   report.

Creating a Mailing Label Report Not Using ReportWizard

------------------------------------------------------

1. Open your report in Design view and remove the page header and

   footer. (You need only the Detail section for this report.)

2. Adjust the size of the Detail section as follows:

   a. Make the width the same as the width of one label.

   b. Make the height the same as the height of one label.

3. Add controls to the Detail section, making sure that the controls

   do not overlap. To create margins for the labels, place the text

   boxes at least 0.2 inches from all edges of the Detail section.

4. From the File menu, choose Print Setup and verify or set the

   following values in the Print Setup dialog box:

   a. In the Paper group, set Size to User-Defined Size and Source to

      Tractor.

   b. Set all margins to 0.0 inches.

   c. In the Item Size group, make sure the Same as Detail check box is

      selected. (Choose the More button to display the Item Size group.)

   d. If there is more than one label across the page, you must also set

      the following items:

      1) In the Items Across box, enter the number of labels across.

      2) In the Row Spacing box, enter the amount of space between the

         bottom of one label and the top of the next.

      3) In the Column Spacing box, enter the amount of space between

         the right edge of one label and the left edge of the next.

   NOTE: When a dot-matrix printer is the default in Control Panel and

   you have Paper Size set to User-Defined Size, Microsoft Access uses

   only that paper size. If you want to create or print a label or

   report on a page of a different size, remember to change the

   user-defined page size in Control Panel before you create or print

   your label or report.

Additional reference words: 1.00 1.10 2.00


INF: Microsoft Access Data in a Word for Windows Print Merge

 Article Number: Q103629

 CREATED: 26-AUG-1993

 MODIFIED: 30-NOV-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

 - Microsoft Word for Windows Versions 1.1 1.1a 2.0 2.0a 2.0b 2.0c

---------------------------------------------------------------------

SUMMARY

There is no Microsoft Word for Windows file converter capable of reading

Microsoft Access database files. In order to use data from a Microsoft

Access database in a Microsoft Word for Windows print merge, the data must

first be exported from Microsoft Access in a format that Microsoft Word for

Windows recognizes. In Microsoft Access version 1.1, you can export the

data using the "Word for Windows Merge" format. In Microsoft Access version

1.0, you can use the "dBASE IV" format.

NOTE: It is not recommended that you use the "Text (Delimited)" format for

exporting data to Word for Windows. Problems with this method are discussed

below.

The following topics are discussed below (in order):

 - Exporting data from Microsoft Access for use in a print merge

 - Using the exported data in Microsoft Word for Windows

 - Problems exporting data using the "Text (Delimited)" format

 - Microsoft Access 1.1 field name conversion

MORE INFORMATION

Exporting Data from Microsoft Access for Use in a Print Merge

-------------------------------------------------------------

1. Open the Microsoft Access database table that contains the data you want

   to use in a Microsoft Word for Windows print merge.

2. From the File menu, choose Export. In Microsoft Access version 1.1

   select "Word for Windows Merge" in the Data Destination box. In

   Microsoft Access version 1.0 select "dBASE IV" as the data destination.

   Choose OK.

3. From the Table list, select the table to be exported, and choose OK.

   NOTE: Microsoft Access only shows you a list of available tables to

   export. If you want to export a subset of a table, you can create a

   query to result in the subset you want, and export the results to a

   print merge data file. For information on how to export the results of a

   query to a file, query on the following keywords here in the Microsoft

   Knowledge Base:

      access and export and query and transfer and results

4. Enter a unique filename in the File Name box. Select the appropriate

   destination directory in the Directory box and then choose OK.

   NOTE: Microsoft Access 1.1 will default the export filename to the same

   name as your table, with a .TXT extension, and will place the file in

   the Microsoft Access directory. Microsoft Access 1.0 will default the

   export filename to the same name as your table, with a .DBF extension.

   In either case, you may want to change the directory to your Microsoft

   Word for Windows directory and give the file a .DOC extension to make it

   easier to find in Word for Windows.

NOTE: In Microsoft Access 1.1, you can select custom formats in the Export

Options dialog box. These options determine how dates, times, and numbers

are formatted in the data file. Although you can select custom formats, you

do not need to make any changes in this dialog box.

Using the Exported Data in Microsoft Word for Windows

-----------------------------------------------------

1. Open or create the main document in Microsoft Word for Windows.

2. From the File menu, choose Print Merge.

3. Choose Attach Data File.

4. From the file list, select the export file, and then choose OK.

   NOTE: You may have to type "*.TXT" or "*.DBF" (without the quotation

   marks) in the File Name box to see text or dBASE files in the filename

   list.

5. Use the Insert Merge Fields tool on the print merge Toolbar to insert

   fields in your main document. Consult the Microsoft Word for Windows

   documentation for information on how to use the merge features.

Problems Exporting Data Using the "Text (Delimited)" Format

-----------------------------------------------------------

One method of exporting data to Microsoft Word for Windows is to use the

"Text (Delimited)" format. However, exporting the data in this format may

require some changes to the exported data file before it can be used for a

print merge.

The problem is that a number of restrictions are placed on field names used

in a Microsoft Word for Windows print merge, including the following:

 - Field names cannot contain spaces.

 - Field names cannot begin with a number.

 - Field names cannot be longer than 20 characters in length.

 - Field names cannot contain special characters.

Microsoft Access field names do not have these restrictions. Consequently,

you can export data from Microsoft Access that contains field names

incompatible with Microsoft Word for Windows. If you use the "Text

(Delimited)" format for exporting data, you may have to change the field

names in the exported data file so that they meet the restrictions listed

above.

If you use the "dBASE IV" or "Word for Windows Merge" formats, Microsoft

Access will perform field name conversions to ensure that the data files

will work correctly with Microsoft Word for Windows.

Microsoft Access 1.1 Field Name Conversion

------------------------------------------

As discussed previously, Microsoft Word for Windows places a number of

restrictions on the field names used in a print merge. Since Microsoft

Access is not limited by these restrictions, it must perform field name

conversions when exporting data to a print merge data file.

Microsoft Access performs field name conversions using the following

rules:

 - Any spaces or illegal characters are converted to underscores.

 - If the first character in a field name is a number or an underscore,

   Microsoft Access adds the prefix "m_". For example, 1Field becomes

   m_1Field, and _Field2 becomes m__Field2.

 - Microsoft Access truncates field names that are longer than 20

   characters.

 - If a conversion results in a duplicate field name, Microsoft Access adds

   a number to the end of each duplicate name (replacing the final

   character, if the field name contains twenty characters). For example,

   the field names Order#, Order$, and Order% become Order_, Order_1, and

   Order_2.

Additional reference words: 1.00 1.10


INF: Microsoft Access, Scanners, and Scanning Software

 Article Number: Q103631

 CREATED: 26-AUG-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article contains general information about Microsoft Access,

scanners, and scanning software.

MORE INFORMATION

To scan an image into Microsoft Access, both a scanner and scanning

software are required. The following is a list of scanners that are

currently supported by Microsoft Windows:

   Scanner        Manufacturer      Phone number

   -----------------------------------------------

   ScanJet        Hewlett-Packard   (208) 323-2551

   ScanMan        Logitech          (510) 795-0427

   Hand Scanner   Marstek           (714) 833-7740

The Hewlett-Packard (HP) ScanJet provides TWAIN compliance, the

industry's standard protocol for scanning and acquiring graphics from

software applications.

If the software that comes with the scanner saves the image in

a format that a Windows graphics program can recognize, Microsoft

Access can display the image.

The following is a list of graphics software packages and their

currently supported formats:

   Software     Graphic Formats       Phone number

   -------------------------------------------------

   Image-In     .BMP .EPS .TIF        (800) 345-3540

   CorelDRAW    .BMP .EPS .TIF .PCX   (613) 728-8200

   Paintbrush   .BMP .PCX .MSP .DIB   (206) 426-9400

Image-In is a computer-aided design (CAD) graphics software package

that ships with the Marstek Hand Scanner.

The following procedure explains how you can use Paintbrush to bring

an image into Microsoft Access from a scanner:

1. Scan the image and save it in .BMP file format using the scanner

   software.

2. Start Microsoft Access. In the sample database NWIND.MDB, open the

   Employees form.

3. From the Records menu, choose Data Entry.

4. Select the Photo field.

5. From the Edit menu, choose Insert Object.

6. In the Insert Object dialog box, choose the File button.

7. Select your file from the list.

The scanned image will display in the Photo field.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 316-339

The following products are manufactured by vendors independent of

Microsoft: CorelDRAW by Corel Systems Corp.; ScanJet by Hewlett-Packard

Company; and ScanMan by Logitech. We make no warranty, implied or

otherwise, regarding these products' performance or reliability.

Additional reference words: 1.00 1.10 2.00 WinIss ole twain picture scan


PRB: Minimizing Pop-Up and Modal Form Loses Application Focus

 Article Number: Q103988

 CREATED: 02-SEP-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you run the Minimize macro action on a form that has both the PopUp and

Modal properties set to Yes, the Microsoft Access window will cease to be

the active window, and the next application on the Microsoft Windows

desktop will become active instead.

CAUSE

When a pop-up form is minimized, Windows tries to activate another pop-up

form in the active window. Since the form is also modal, the Microsoft

Access main window is disabled and cannot be activated. Windows then makes

the next available application's window active.

RESOLUTION

Change the Modal property of the form to No. When the form is minimized,

the Microsoft Access window will be activated.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Open the Forms Switchboard form in Design view.

3. Change the form's Modal property to Yes.

4. Change the form's PopUp property to Yes.

5. Save and close the form.

6. Open the Forms Switchboard Buttons macro in Design view.

7. Add the Minimize macro action as the second command in the Categories

   macro name, after the OpenForm action.

8. Open the Forms Switchboard form, and click the Categories button.

The Categories form will be minimized and the next application on the

desktop will become the active window.

Additional reference words: 1.00 1.10 2.00 min


INF: Version 1.1 Online Help and Text Files

 Article Number: Q103989

 CREATED: 02-SEP-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.1

---------------------------------------------------------------------

SUMMARY

This article lists all the online Help and text files included with

Microsoft Access version 1.1. The information in the text files is not in

the printed documentation that ships with Microsoft Access.

MORE INFORMATION

The table below lists the filename, whether the file is installed by the

Upgrade or full package, whether the file is installed in the Access

directory or the Windows SYSTEM directory, and a description of the file.

Filename      Package   Directory     Description

-------------------------------------------------------------------------

MSA110.HLP    Upgrade   Access        What's new in 1.1?

README.TXT    Both      Access        Supplement to documentation

NOTE: Slightly different versions of the README.TXT file are installed by

the Upgrade and full Microsoft Access packages.

ANALYZER.TXT  Full      Access        Database Analyzer

ERRATA.TXT    Full      Access        Errors in documentation

ORDENTRY.TXT  Full      Access        Order entry information

ORDENTRY.HLP  Full      Access        Order entry information

PIM.HLP       Full      Access        PIM help information

MSACCESS.HLP  Full      Access        Includes 1.0 and 1.1 Help

BTRIEVE.TXT   Both      Access        Btrieve information

PERFORM.TXT   Both      Access        Enhancing performance

NOTE: the following four files are installed only when you run the ODBC

Setup program that is shipped on a separate disk with both the Upgrade and

full packages.

DRVSSRVR.HLP  Both      System        SQL Server access information

DRVORACL.HLP  Both      System        Oracle access information

ORACLE.TXT    Both      System        Oracle access information

ODBCINST.HLP  Both      System        ODBC Driver Manager install Help

Note that if the Microsoft Access Setup program detects that you are not

using the most current version of the Windows for Workgroups driver, Setup

will stop and refer you to the WFWDRV.TXT file. This file is on Disk 1, and

is not installed to your hard disk.


PRB: Update Query on More than One Table Gives Inaccurate Data

 Article Number: Q103990

 CREATED: 02-SEP-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

An update query that attempts to update more than one table may yield

inaccurate results.

RESOLUTION

This behavior is by design. You cannot update more than one table in

an update query.

MORE INFORMATION

If an update query in Microsoft Access is used to update two (or more)

tables on the "many" side of a relationship, the resulting updated

fields will be multiples of the updated value. Each value will be

updated one time for each updated record in the corresponding table.

Steps to Reproduce Behavior

---------------------------

1. Create the following three tables:

      Table: Vendors

      -----------------

      FieldName: Name

         DataType: Text

      Table: New Parts

      --------------------

      FieldName: Item

         DataType: Text

      FieldName: Vendor

         DataType: Text

      FieldName: Cost

         DataType: Number

      Table: Rebuilt Parts

      --------------------

      FieldName: Item

         DataType: Text

      FieldName: Vendor

         DataType: Text

      FieldName: Cost

         DataType: Number

2. Add the following two records to the Vendors table:

      Name

      ----

      Bob

      Jill

3. Enter the following three records to the New Parts table:

      Item      Vendor       Cost

     -----------------------------

     fender      Bob        100.00

     hood        Jill        50.00

     trunk       Bob        100.00

4. Enter the following four records in the Rebuilt Parts table:

     Item       Vendor      Cost

     ----------------------------

     Pump        Bob        10.00

     Fan         Jill       45.00

     Pulley      Bob        20.00

     Piston      Bob        30.00

5. Create the following query based on the three tables that you

   created above:

      Query:  Example Query

      ---------------------------------------------------

      Type: Update Query

      Join: [New Parts].[Vendor] <-> [Vendors].[Name]

      Join: [Rebuilt Parts].[Vendor] <-> [Vendors].[Name]

      Field: Name

         Table: Vendors

         Criteria: "Bob"

      Field: Cost

         Table: New Parts

         Update To: [New Parts].[Cost] * 2.0

      Field: Cost

         Table: Rebuilt Parts

         Update To: [Rebuilt Parts].[Cost] * 2.0

6. Run the query, then save and close it.

7. Open the Rebuilt Parts table.

   Note that the costs for items listing Bob as the vendor have been

   updated to four times their original values, rather than to two

   times, as specified in the update query. Each updated record in the

   Rebuilt Parts table has been updated once for each updated record

   in the New Parts table.

8. Open the New Parts table.

   Note that the costs for items listing Bob as the vendor have been

   updated to eight times their original values, rather than to two

   times, as specified in the update query. Each updated record in the

   New Parts table has been updated once for each updated record in

   the Rebuilt Parts table.

This effect is called a cross product, in which the values in Table B

are updated one time for each item meeting the same criteria in Table

A.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 174-178

Additional reference words: 1.00 1.10 2.00 action


PRB: Memory or Disk Space Problems Using MS-DOS 6.0

 Article Number: Q103991

 CREATED: 02-SEP-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you are working in Microsoft Access, you receive an error message

stating that you are out of memory. The message may be accompanied by other

messages stating that you have insufficient space in your TEMP directory,

or that you have insufficient disk space.

CAUSE

If you are running MS-DOS 6.0, these error messages may be due to the way

the memory on your computer is configured, or to the use of file

compression on your hard disk.

RESOLUTION

Check each of the items described below and make any necessary changes.

MORE INFORMATION

DoubleSpace

-----------

MS-DOS 6.0 includes its own disk compression program called DoubleSpace.

This program makes your hard disk seem larger than it actually is by

compressing the files on the disk. The DoubleSpace program has an option to

let you specify the compression ratio that will be used. You can increase

the default compression ratio that DoubleSpace sets up, but increasing this

ratio usually does not result in additional usable space on your hard disk.

The average file compression ratio is about 1.5 to 1. With this ratio, a 20

MB disk could actually yield about 30 MB of usable space. If you set the

DoubleSpace compression ratio to 16 to 1, the disk will show about 320 MB

of usable space, but will still only actually provide about 30 MB of space.

If you have set up a high compression ratio, the hard disk may show far

more free space than can actually be used. If you attempt to install

Microsoft Access to such a disk, you can run out of disk space during the

installation process.

If you are using DoubleSpace, you can check your compression ratio by

typing "dblspace" (without the quotation marks) at the MS-DOS prompt. From

the Drive menu, choose Info. If the compression ratio is set larger than

the estimated compression ratio, choose Ratio and set the new estimated

compression ratio to match the estimated compression ratio. This will give

you the most accurate information about the amount of actual usable free

disk space.

MemMaker

--------

MS-DOS 6.0 includes a memory-management utility called MemMaker that helps

optimize the configuration of your computer's memory. This utility may

alter two commands that can affect Microsoft Access.

The first item is the FILES=<xx> line in your CONFIG.SYS file. Microsoft

Access requires that <xx> be 50 or greater, but the MemMaker utility

sometimes sets this line to less than 50. Check your CONFIG.SYS file with

any text editor and make sure that the line reads FILES=50.

The second item is the DEVICE=EMM386.EXE line in your CONFIG.SYS file. The

MemMaker utility sometimes adds the HIGHSCAN parameter to this line, but

this parameter can cause conflicts on some computers. You may want to

remove this parameter and any i=<xxxx>-<xxxx> parameters, and make sure

that the NOEMS switch is present. For example, the line might read

DEVICE=EMM386.EXE NOEMS.

Undelete

--------

If you are running the Delete Sentry option of the Microsoft Undelete

program, your hard disk may show an incorrect amount of disk space. This is

because Delete Sentry makes a hidden copy of all deleted files. These

hidden files are stored for seven days, and are not counted when you use

the DIR command to show available disk space.

If you run out of disk space when you are installing Microsoft Access, use

the DIR /A command to show all files. This command will show you any hidden

files, including hidden files stored by the Delete Sentry. You can delete

the hidden files to free up disk space, but these files will no longer be

guaranteed to be recoverable. one

means of troubleshooting may point to the uncompressed

REFERENCES

==========

Microsoft MS-DOS 6.0 "User's Guide"

Additional reference words: 1.00 1.10 2.00 WinIss


PRB: Cannot Add Security Items to Custom Menu

 Article Number: Q103992

 CREATED: 02-SEP-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

If you add a security command to a custom menu with a DoMenuItem action,

the security command will be unavailable.

CAUSE

You can only perform DoMenuItem actions with commands available from the

current context. If you have a form open, you can only perform menu items

available to a form. Since security items are available only from the

Database window, they will not work when invoked from a form.

RESOLUTION

You can add the security command Change Password to a custom menu using

the following sample macro:

   Macro Name         Action        Defined Below

   ----------------------------------------------

   Change Password    Echo               1

                      SelectObject       2

                      DoMenuItem         3

                      DoMenuItem         4

                      SelectObject       5

   Change Password Actions

   ---------------------------------------------------------

   1. Echo

         Echo On: No

   2. SelectObject

         Object Type: Form

         Object Name: <name of the form that the menu is on>

         In Database window: Yes

   3. DoMenuItem

         Menu Bar: Database

         Menu Name: Security

         Command: Change Password

   4. DoMenuItem

         Menu Bar: Database

         Menu Name: Window

         Command: Hide

   5. SelectObject

         Object Type: Form

         Object Name: <name of the form that the menu is on>

         In Database window: No

NOTE: Actions 1 and 5 are used if you need to have the Database window

hidden while using the retail version of Microsoft Access. The Echo

action in step 1 ensures that the Database window is not visible when it

is activated in step 2. Step 4 hides the Database window again. If you

are using the Microsoft Access Distribution Kit (ADK), steps 1 and 5 can

be omitted since the Database window is always hidden.

The only side effect to this workaround is that when the Change Password

dialog box appears, you will see the Database window menu items in the

background. However, you will not be able to choose them.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create the following macro and save it as Security Menu:

      Action      Defined Below

      -------------------------

      AddMenu          1

      Security Menu Actions

      ---------------------------------------------

      1. AddMenu

            Menu Name: Security Menu

            Menu Macro Name: Security Menu Password

            Status Bar Text: Change Password

2. Create the following macro and save it as Security Menu Password:

      Macro Name        Action     Defined Below

      -----------------------------------------

      Change Password   DoMenuItem       1

      Security Menu Password Actions

      ------------------------------

      1. DoMenuItem

            Menu Bar: Database

            Menu Name: Security

            Command: Change Password

3. Create a form and set the OnMenu property to Security Menu.

4. View the form in Form view and note that Change Password is

   unavailable on the Security menu.


PRB: DDEPoke to Word for Windows Incorrectly Formatted

 Article Number: Q103993

 CREATED: 02-SEP-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - Microsoft Word for Windows versions 1.0, 1.1, 1.1a, 2.0, 2.0a,

   2.0a-CD, 2.0b, 2.0c, and 6.0

---------------------------------------------------------------------

SYMPTOMS

When you are "poking," or sending, data to a bookmarked location in a

Microsoft Word for Windows document during a DDE conversation, the

information may arrive in Word for Windows formatted with an incorrect font

and size.

RESOLUTION

The Word for Windows product support group has described a workaround for

any application that tries to poke data into Word for Windows. To review

the article that lists the workaround, query on the following words here in

the Microsoft Knowledge Base:

   ddepoke and bookmark and format and character

STATUS

Microsoft has confirmed this to be a problem in the versions of Microsoft

Word for Windows listed above. We are researching this problem and will

post more information here in the Microsoft Knowledge Base as it becomes

available.

Additional reference words: 1.00 1.10 2.00


PRA: Setup Ignores $(AppPath); Puts Files in MS-SETUP.T

 Article Number: Q103995

 CREATED: 02-SEP-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

When you run the Microsoft Access Distribution Kit (ADK) Setup program

and specify that you want to install the files to a particular

directory, all files except SYSTEM.MDA and MSACCESS.REG are copied to

the MS-SETUP.T subdirectory instead.

CAUSE

This problem occurs because the Setup program is case-sensitive. If

the $(AppPath) information file token is either misspelled or

capitalized incorrectly [for example, $(APPPath) instead of

$(AppPath)], Setup does not recognize the misspelled or wrongly

capitalized token. By default, it copies all files to the current

directory, which is MS-SETUP.T.

RESOLUTION

Be sure that the $(AppPath) information file token is spelled

correctly and capitalized as shown.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft Access

Distribution Kit version 1.1. This problem no longer occurs in the

Microsoft Access Developer's Toolkit version 2.0.

REFERENCES

==========

Microsoft Access "Distribution Kit Guide," version 1.1, pages 42-43

Additional reference words: 1.10 ADK


INF: Imported Microsoft Excel Date Fields Are Off by 4 Years

 Article Number: Q103996

 CREATED: 02-SEP-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - Microsoft Excel versions 2.0, 3.0, 4.0, and 5.0

---------------------------------------------------------------------

SUMMARY

If date fields imported from a Microsoft Excel spreadsheet are off by four

years, the 1904 date system was used on the original spreadsheet. This

setting can be verified in Microsoft Excel by choosing Calculation from the

Options menu. In the Sheet Options group, there is a check box labeled

"1904 Date System." If the box is selected, the spreadsheet is based on the

1904 date system. If the box is not selected, the spreadsheet is based on

the 1900 date system.

MORE INFORMATION

The date systems used by Microsoft Excel can be based on one of two

different dates. By default, Microsoft Excel for Windows starts its

dates at January 1, 1900. A serial number of 1 in Microsoft Excel

represents January 1,1900. Microsoft Excel can also be set to start on

January 1, 1904. This option was included in Microsoft Excel for

Windows to make it compatible with Excel for the Macintosh, which

starts on January 1, 1904. The starting serial numbers are also

different. A serial number of zero (0) in Excel for the Macintosh

represents January 1, 1904.

If the spreadsheet you want to import into Microsoft Access was based

on the 1904 date system, complete the following steps before importing

the spreadsheet into Microsoft Access:

1. Open the spreadsheet in Microsoft Excel.

2. From the Options menu (or from the Tools menu in version 5.0), choose

   Calculation.

3. In the Sheet Options group, clear the box labeled "1904 Date

   System."

4. Save and close the spreadsheet.

The spreadsheet is now ready to be imported into Microsoft Access.

If you do not have Microsoft Excel available to switch the date system

before importing the spreadsheet, you can use the following steps to

perform an Update Query to correct the dates after the spreadsheet has

been imported into Microsoft Access:

1. Create a new query based on the table that was created when you

   imported the spreadsheet.

2. Drag the DateField name to the Field row in the query grid. For this

   example, the date field's name is "DateField."

3. From the Query menu, choose Update.

4. In the Update To field, enter the following:

      [DateField] + 1462

5. From the Query menu, choose Run.

A message box appears and tells you how many records were updated.

Your dates should now appear correctly.

Additional reference words: 1.00 1.10 2.00


PRB: "Error Writing to File 'MSAIN100.DLL'" During 1.1 Install

 Article Number: Q103997

 CREATED: 02-SEP-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.1

---------------------------------------------------------------------

SYMPTOMS

The error message

   Error writing to file "MSAIN100.DLL"

is displayed when you are upgrading a network installation of Microsoft

Access from version 1.0 to version 1.1.

CAUSE

Make sure that no users are running Microsoft Access on the network.

During the version 1.1 installation process, the MSAIN100.DLL file is

deleted and replaced with the MSAIN110.DLL file. This file provides

the international support for Microsoft Access.

If someone is using Microsoft Access when you start the installation

process, the error message

   Error writing to file "MSAIN100.DLL"

is received when the Setup program tries to delete that file. Once all

users have closed Microsoft Access, you can restart Setup.

MORE INFORMATION

The following files are deleted during Microsoft Access 1.1

installation:

   BTRVISAM.DLL

   DBSIASM.DLL

   MSABC100.DLL

   MSAES100.DLL

   MSAIN100.DLL

   MSAJU100.DLL

   MSAJT100.DLL

   PDXISAM.DLL

REFERENCES

==========

For more information, see the README.TXT file provided with Microsoft

Access 1.1.

Additional reference words: 1.00 1.10


PRA: Formatted Memo Truncates Data at 255 Characters

 Article Number: Q103998

 CREATED: 02-SEP-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you apply formatting, such as a closing or opening angle bracket

(> or <),  to a field with the Memo data type, the data in the field

appears truncated after the 255th character.

CAUSE

When you apply formatting to a Memo field, it is treated as a Text

field, which has a 255-character limit. The data is not physically

truncated, but only 255 characters are viewable.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10 Tables


PRA: GP Fault Referencing Column Property of Combo Box

 Article Number: Q103999

 CREATED: 02-SEP-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.1

---------------------------------------------------------------------

SYMPTOMS

The following messages will appear when you are trying to reference the

Column property of a combo box in Datasheet view:

 - An error has occurred in your application. If you choose Ignore,

   you should save your work in a new file. If you choose Close, your

   application will terminate

 - Application Error: Microsoft Access caused a General Protection

   Fault in module MSAIN110.DLL

CAUSE

The general protection (GP) fault will occur under the following

conditions:

 -  The combo box has a query or table as the RowSource.

 -  The form must be opened directly into Datasheet view.

 -  A selection has been made in the combo box.

 -  The Column property of the combo box is referenced in an

    expression.

RESOLUTION

The following methods can be used to work around the problem:

Method 1

--------

If the form will only be used in Datasheet view, use a list box

instead of a combo box. A list box is functionally equivalent to a

combo box in Datasheet view.

Method 2

--------

If the form will be used in both Datasheet view and Form view, make

sure the form is opened in Form view first. The following macro can be

used to open the form in Form view, then in Datasheet view:

   Action    Described Below

   -------------------------

   Echo            1

   OpenForm        2

   OpenForm        3

   Echo            4

   Macro Actions

   -------------

   1. Echo

         Echo On: No

   2. OpenForm

         Form Name: MyForm

         View: Form

   3. OpenForm

         Form Name: <your form name here>

         View: Datasheet

   4. Echo

         Echo On: Yes

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version

1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB in Microsoft Access version 1.1.

2. Create a blank, unbound, form with the following form properties:

      DefaultView: Datasheet

3. Create a combo box on the form with the following properties:

      ControlName: MyCombo

      RowSourceType: Table/Query

      RowSource: Employees

      ColumnCount: 2

4. Close and save the form with the name "MyForm".

5. Open the form from the Database window and make a selection in the

   combo box.

6. With the form left open, create a new module.

7. From the View menu, choose Immediate window.

8. Type the following, and then press ENTER:

      ? Forms!MyForm!MyCombo.Column(1)

Additional reference words: 1.10 combo box list box GPF


INF: Comparison of Visual Basic 3.0 and Microsoft Access 1.1
INF: Comparison of Visual Basic 3.0 and Microsoft Access 1.1 [B_WAccADK]

 Article Number: Q104065

 CREATED: 05-SEP-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.1

 - Microsoft Access Distribution Kit version 1.1

 - Microsoft Visual Basic Professional version 3.0

------------------------------------------------------------

---------

SUMMARY

Microsoft is committed to continually enhancing its entire

desktop database

tool family. The two main forces that guide future product

development

plans are: responding to your needs through innovation and

solid execution,

and sharing these innovations among products.

The innovations continue with the release of Microsoft

Visual Basic

Professional Edition version 3.0 and its ability to directly

manipulate

Microsoft Access databases. However, due to this enhanced

functionality,

you may have questions about which product will best meet

your database

needs. This article will try to help you make that decision

by outlining

the important features of Microsoft Access version 1.1 and

Visual Basic

Professional Edition version 3.0.

MORE INFORMATION

Microsoft Access Version 1.1

----------------------------

Microsoft Access is an interactive end-user tool optimized

for

customizability and the creation of database solutions. It

is designed

exclusively for database work, with simple, yet powerful,

integrated

database tools. These tools, such as data-aware forms and

reports, are

designed for manipulating data in the Microsoft Access user

interface.

Manipulating form and report objects is easy with the use of

macros and the

macro builder. Microsoft Access also contains the full-

featured Access

Basic language, which is very similar to Visual Basic.

Microsoft Access does not provide the ability to create an

executable

database file. This means that customers who receive your

Microsoft Access-

developed applications must have either:

 - The retail version of Microsoft Access (note that any

user who has a

   retail version of Microsoft Access can modify your

applications unless

   you implement security on the database or its objects).

   -or-

 - The run-time version of Microsoft Access that is provided

with the

   Microsoft Access Distribution Kit. The run-time package

lets users run

   your application without having to own a full retail copy

of Microsoft

   Access, and can be distributed with your applications

royalty-free.

Microsoft Access Distribution Kit Version 1.1

---------------------------------------------

The Microsoft Access Distribution Kit (ADK) contains a set

of tools and a

run-time package for Microsoft Access. This run-time package

allows you to

ship your Microsoft Access-designed applications to users

who may not have

Microsoft Access installed on their computers. Note that

modifications to

your application cannot be made when the application is

running in the run-

time package.

The ADK comes with advanced developer tools, including:

   - Setup toolkit (includes .DLL file version check)

   - Help compiler

   - Documentation on how to create your own AccessWizards

Microsoft Visual Basic Professional Edition Version 3.0

-------------------------------------------------------

Microsoft Visual Basic is optimized for programmer

versatility and

extensibility. It is a tool not only for creating database

applications,

but other applications as well. It can be used to create

multi-function

applications with complete custom control over the user

interface. Visual

Basic creates executable (.EXE) files, which contain

precompiled code tuned

to load and execute, and are processed through a dynamic

link library

(.DLL) called VBRUN300.DLL. The Visual Basic compiler is not

needed to run

applications you develop.

Starting with Visual Basic Professional Edition version 3.0,

the Microsoft

Access database engine is also included, giving you complete

access to

Microsoft Access-created databases (which can include

foreign database

format tables such as Paradox and Btrieve that can be

attached to the .MDB

file). However, it does not give you access to other objects

in the .MDB

file, such as reports and forms. There is no graphical means

of defining

database queries, so you must construct them in code. Visual

Basic also

does not provide the ability to modify the security of an

.MDB file.

Instead, you must implement security through the Microsoft

Access security

interface.

To distribute your Visual Basic applications, you need only

distribute the

.EXE file that you developed, the VBRUN300.DLL file, the

.MDB file, and any

other miscellaneous files your application requires. Users

of your

applications are not required to have Microsoft Access or

Visual Basic to

run your applications.

The only way that users can modify your application's

objects is if you

implement the ability for them to do so in your code, or if

you supply the

source code to your users.

Essentially, Microsoft Visual Basic gives you greater

control and freedom

over creation of your applications, but also requires

greater

responsibility on your part for managing the code, objects,

and so on.

Features Comparison

-------------------

============================================================

===========

      Microsoft Access           |    Microsoft Visual Basic

============================================================

===========

   Is an interactive, end-user   | Contains a full

programmatic

   tool designed exclusively     | object layer for creating

a

   for database development and  | run-time database

solution.

   work.                         |

------------------------------------------------------------

-----------

   Contains a full-featured      | Contains a full-featured

   report-writing tool allowing  | report writer with the

   flexible report writing       | ability to execute

   for a custom database         | predefined reports.

   solution.                     |

------------------------------------------------------------

-----------

   Provides both macros and      | Includes the complete

Visual

   Access Basic for driving      | Basic language set, plus

a

   your applications.            | subset of Access Basic to

                                 | fully manipulate data.

                                 | NOTE: Microsoft Access

macro

                                 | actions are not available

to

                                 | Visual Basic

executable(.EXE)

                                 | files.

------------------------------------------------------------

-----------

   Supports attachment (either   | Can attach to the same

   programatically or through    | database formats

supported

   the user interface) of        | in Microsoft Access

through

   multiple external database    | attached tables in the

.MDB

   tables of other formats,      | file.

   such as dBASE, Paradox,       |

   Btrieve, SYBASE, and so on.   |

------------------------------------------------------------

-----------

   Has data-aware controls       | Has data-aware controls

   bound to data controls on     | bound to fields in the

   forms or reports.             | tables.

------------------------------------------------------------

-----------

   Supports multiple subforms    | Can create multiple

   on forms. The data in the     | instances of MDI child

   subforms can be linked to     | forms. (However, you must

   fields on the parent form     | programmatically link the

   so that updates made to the   | data on the subform with

the

   parent form are               | parent form.)

   automatically reflected in    |

   the subforms. This can be     |

   done by setting properties    |

   in the subforms without       |

   using code or macros.         |

------------------------------------------------------------

-----------

   Is easy for new users to      | Includes full developer

   become immediately            | usability -- full

debugging

   productive with. Cue Cards    | tools including watch

   -- automated task             | statements and call

threads.

   teaching aids -- walk         |

   inexperienced users through   |

   such tasks as writing a       |

   macro, designing a query, or  |

   creating mailing labels.      |

------------------------------------------------------------

-----------

   Is connectable. All project   | Code is in ASCII, in

distinct

   code is stored in the         | modules, and works with

CASE

   database file and is managed  | and SLM tools.

   through the easy-to-use       |

   Microsoft Access user         |

   interface. Code in other      |

   databases is accessible       |

   through the use of Microsoft  |

   Access libraries.             |

------------------------------------------------------------

-----------

   Contains graphical, easy-to-  | Includes additional

   use tools for interactive     | developer tools for

   users:                        | commercial development:

                                 |

    - Report, form, and graph    |  - Setup toolkit for

      wizards (automated task    |    creating your own Help

      coordinators that make     |    files (includes .DLL

file

      creation of reports,       |    version check)

      forms, and graphs easy)    |

                                 |  - Win API reference

    - Macros (for easy, fill-in- |

      the-blank programming )    |  - Help compiler (allows

you

                                 |    to create your own

Help

    - Graphical Query-by-        |    files)

      Example (for creating      |

      custom queries)            |

                                 |

    - Cue Cards                  |

------------------------------------------------------------

-----------

   Uses user-friendly            | Has no object-creation

user

   objects (such as macros,      | interface for

constructing

   forms, reports and queries),  | queries. You either hard-

code

   that are easy to implement    | a SQL string or construct

the

   and modify.                   | query with code. Cannot

read

                                 | any of the macros,

modules,

                                 | forms, reports, or

queries in an

                                 | .MDB file.

------------------------------------------------------------

-----------

   Offers full-featured          | Cannot modify the

security

   security on all objects.      | implemented in .MDB

files, but

                                 | instead must obey the

security

                                 | previously established on

the

                                 | database objects. All

security

                                 | must be established

through the

                                 | Microsoft Access

interface.

------------------------------------------------------------

-----------

   Currently does not support    | Supports .VBX files for

   custom controls (.VBX         | additional add-on custom

   files).                       | controls.

------------------------------------------------------------

-----------

   Efficiently uses system       | Uses true Windows

controls

   resources, even displaying    | that you create on your

   large amounts of data in      | forms (not Microsoft

Access-

   grid-like presentations.      | owned windows). As a

result,

   However, in many instances,   | you have much more

control

   Microsoft Access will use the | over them using standard

   same control to display       | Windows API function

calls.

   several pieces of data in     | NOTE: Incorrect use of

API

   the same window or form.      | function calls can lead

to

   Because of this, you may find | resource inefficiency.

   that you do not have the same |

   fine control of objects that  |

   you have using standard       |

   Microsoft Windows API         |

   functions.                    |

============================================================

===========

Additional reference words: 1.10 differences


PRA: Incorrect Error Message Using OpenTable Method

 Article Number: Q104066

 CREATED: 05-SEP-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

------------------------------------------------------------

---------

SYMPTOMS

When you use the OpenTable method in Access Basic on tables

with

certain table names that do not exist, you get the following

error

message

   Syntax error in <xxxxx> statement

instead of the expected error message

   Object does not exist

For example, if you try open a nonexistent table called

"Delete This

Table," you would receive a "Syntax error in DELETE

statement" error

message, rather than an "Object does not exist" error

message.

CAUSE

If the table referenced in the OpenTable method does not

exist,

Microsoft Access tries to interpret the table name as a SQL

statement.

Since the statement is not valid, you receive the SQL

parsing error

"Syntax error in DELETE statement."

Because of this, other SQL statements used as valid but

nonexistent

table names can cause other SQL parsing error messages. Some

of the

other possible error messages are listed in the table below:

If Table Name Is...        Microsoft Access Error Message

Is...

------------------------------------------------------------

--------

Select                     Syntax error in Select statement

Select * from authors      Missing semicolon at end of SQL

                           statement (when Authors table

does not exist)

Select * from authors;     Couldn't find input table or

query

                           "Authors" (when Authors table

does exist)

Select * from authors;     Couldn't find object "Select *

from

                           authors;"

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access

versions 1.0 and 1.1. Microsoft is researching this problem

and will

post new information here in the Microsoft Knowledge Base as

it

becomes available.

Additional reference words: 1.00 1.10 Tables Programming


INF: Access Distribution Kit Questions & Answers

 Article Number: Q104385

 CREATED: 14-SEP-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

======================================================================

  Microsoft(R) Product Support Services Application Note (Text File)

        WX0867: ACCESS(R) DISTRIBUTION KIT QUESTIONS & ANSWERS

======================================================================

                                                   Revision Date: 9/93

                                                      No Disk Included

The following information applies to Microsoft Access, version 1.1.

----------------------------------------------------------------------

| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY     |

| ACCOMPANY THIS DOCUMENT (collectively referred to as an Application |

| Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER      |

| EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED      |

| WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR       |

| PURPOSE. The user assumes the entire risk as to the accuracy and    |

| the use of this Application Note. This Application Note may be      |

| copied and distributed subject to the following conditions:  1) All |

| text must be copied without modification and all pages must be      |

| included;  2) If software is included, all files on the disk(s)     |

| must be copied without modification (the MS-DOS(R)  utility         |

| diskcopy is appropriate for this purpose);  3) All components of    |

| this Application Note must be distributed together;  and  4) This   |

| Application Note may not be distributed for profit.                 |

|                                                                     |

| Copyright (C) 1993 Microsoft Corporation.  All Rights Reserved.     |

| Microsoft, Microsoft Access, and MS-DOS are registered trademarks   |

| and Windows is a trademark of Microsoft Corporation.                |

| --------------------------------------------------------------------|

1.  Q. My machine appears to hang when I first run the SUFILES utility

       (SUFILES.EXE), whether I start the SUFILES utility by double-

       clicking the SUFILES icon or by selecting SUFILES from the

       first dialog box after starting the Microsoft Access

       SetupWizard. My mouse pointer does not switch from pointer to

       hourglass to indicate that the program is still processing. The

       progress meter remains at 0% and I do not see any hard disk

       activity. Why does this occur?

    A. The program is not hung; it just does not update the screen

       regularly. The screen eventually updates, allowing you to see

       the program's progress. This behavior is by design so that you

       can choose the Cancel button at any time.

       The amount of time the SUFILES.EXE file takes to run varies,

       depending on the machine type and the amount of memory. Average

       completion time is approximately 20 minutes. For example, using

       a 486/50 machine with 16 megabytes (MB) of memory, the process

       takes approximately 10 minutes to complete; using a 386/16

       machine with 4 MB of memory, the process takes approximately 45

       minutes.

       You need to run SUFILE.EXE only once. SUFILE.EXE compresses

       files from the various directories, including the Windows and

       Access program directories, into a subdirectory called SUFILES.

       When you build your distribution disks, the SetupWizard needs

       only to copy the compressed files to the disk directories and

       does not have to recompress all the files each time

       distribution disks are built.

2.  Q. At the end of the Microsoft Access installation process, why

       does Custom Setup hang immediately after the SETUP.EXE file

       creates the program group?

    A. This problem occurs only when you choose to have the Change

       Workgroups icon installed but have not specified an icon for

       the application.

       To correct this problem, run the SetupWizard again. When the

       "Where are your application's initialization, icon, and Help

       files located?" dialog box appears, select an icon file from

       the .ICO File (Optional) list box.

       You can also manually modify the STFSETUP.IN_ file. For

       information on modifying the STFSETUP.IN_ file, please refer to

       the "Microsoft Access Distribution Kit Guide," Chapter 3,

       "Creating Your Custom Setup Program."

 3. Q. How can I prevent other users from seeing my code?

    A. You can control what users of your application see by taking

       the following precautions:

        - Using forms and macros to control a user's movements within your

          database

        - Securing the objects in your database

        - Encrypting your database

4.  Q. What is the best way to distribute updates of my application to

       other users?

    A. The best way to distribute updates of your application is by

       creating two databases: one database (DATA.MDB) to store the

       application's data, the other database (PROGRAM.MDB) to store

       the application's forms and other objects. This method

       simplifies your application updates, since you can redistribute

       an updated PROGRAM.MDB file (containing updated queries, forms,

       reports, macros, and modules) without destroying your user's

       data.

       All objects in the PROGRAM.MDB file should be based on attached

       tables from the DATA.MDB file. When you create a database with

       attached tables, the specific path to these tables is stored in

       the database. If the path to these tables changes, you receive

       the "Couldn't find table <table name>" error message. To avoid

       this problem, have your AutoExec macro, which the Access

       Distribution Kit (ADK) requires, call an Access Basic function

       to verify that the attached tables are indeed attached. If the

       tables for some reason are not attached, your function attaches

       them automatically.

       When you start your application, make sure that the

       application's working directory property is set to be the same

       directory in which the .MDB file is located. The SetupWizard

       automatically sets this property in Program Manager. Use the

       CurDir() function to determine the directory from which the

       application is being executed, then attach the files from that

       directory.

5.  Q. Why do I get a general protection (GP) fault when I run my

       application's Custom Setup program?

    A. Running Setup in Windows standard mode causes a GP fault. You

       should run Setup in 386 enhanced mode. To start Windows in 386

       enhanced mode, type the following command at the MS-DOS prompt:

          win /3

       Once Setup is complete, your application will run correctly in

       Windows standard mode.

6.  Q. When I start the run-time version of my application, the

       following error message is displayed:

          A run-time error occurred in module: <module name>. You

          don't have permission to view this module.

       Why do I get this error message?

    A. This error message appears when a run-time error occurs in one

       of your modules. When this problem occurs in the retail package

       of Microsoft Access, the module is opened and the line of code

       that caused the error is selected. Because the run-time version

       of the application cannot open the module nor display the line

       causing the error, the previous error message is displayed.

       To correct this problem, open your application in the full

       retail package of Microsoft Access and correct the error in

       your code from there.

 7. Q. I split my database into two files using the COMPRESS.EXE

       utility. After running Custom Setup, I am unable to open my

       database file. How do I put the two .MDB files back together?

    A. Once a database file has been split into two files, you must

       use entries in the Custom Setup Information file, STFSETUP.IN_,

       to rejoin the files. The following steps give an example of how

       to combine two fictitious files, called MYAPP.MD$ and

       MYAPP2.MD$, into one file, called MYAPP.MDB:

       1. Open the STFSETUP.IN_ file in NOTEPAD.EXE or other text

          editor.

       2. In the [Standard Setup Files] section of the STFSETUP.IN_

          file, change the following line

              3 , MYAPP2.MD$, RENAME=MYAPP2.MDB, DEST=$(AppPath)

          to

              3 , MYAPP2.MD$, APPEND=MYAPP.MDB, DEST=$(AppPath)

           NOTE: If your database file was split into more than two

           files, make similar changes for each entry in the

           STFSETUP.IN_ file.

       3. Make similar changes to the [Network Setup Files] and/or the

          [Multiuser Files] sections for any server installations of

          your application.


INF: Interoperability Questions & Answers

 Article Number: Q104386

 CREATED: 14-SEP-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

======================================================================

  Microsoft(R) Product Support Services Application Note (Text File)

 WX0811: INTEROPERABILITY WITH OTHER APPLICATIONS QUESTIONS & ANSWERS

======================================================================

                                                   Revision Date: 9/93

                                                      No Disk Included

The following information applies to Microsoft Access, version 1.0,

1.1.

----------------------------------------------------------------------

| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY     |

| ACCOMPANY THIS DOCUMENT (collectively referred to as an Application |

| Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER      |

| EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED      |

| WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR       |

| PURPOSE. The user assumes the entire risk as to the accuracy and    |

| the use of this Application Note. This Application Note may be      |

| copied and distributed subject to the following conditions:  1) All |

| text must be copied without modification and all pages must be      |

| included;  2) If software is included, all files on the disk(s)     |

| must be copied without modification (the MS-DOS(R)  utility         |

| diskcopy is appropriate for this purpose);  3) All components of    |

| this Application Note must be distributed together;  and  4) This   |

| Application Note may not be distributed for profit.                 |

|                                                                     |

| Copyright (C) 1993 Microsoft Corporation.  All Rights Reserved.     |

| Microsoft, FoxPro, Microsoft Access, and MS-DOS are registered      |

| trademarks and Visual Basic and Windows are trademarks of Microsoft |

| Corporation.                                                        |

| Paradox is a registered trademark of Ansa Software, a Borland       |

| company.                                                            |

| dBASE is a registered trademark of Borland International, Inc.      |

| Sybase is a registered trademark of Sybase, Inc.                    |

|  -------------------------------------------------------------------|

1.  Q. When I export a Microsoft Access table to Microsoft SQL Server

       or Sybase SQL Server and then reattach it to Microsoft Access,

       I cannot edit the data. Why does this problem occur?

    A. Microsoft Access can update an attached SQL Server table only

       if the table has a unique index. However, Microsoft Access does

       not build SQL Server table indexes, unique or otherwise, when

       you export data; Microsoft Access allows you only to export

       data to SQL Server back ends. For example, if you attach the

       table immediately after exporting data to it from Microsoft

       Access, the data is displayed in Datasheet or Form view as read-

       only; therefore, updates to the exported table's data are not

       allowed.

       To work around this problem, you must create the SQL Server

       table indexes manually after you export the data from Microsoft

       Access to SQL Server. After the SQL Server indexes are created,

       you can create forms based on the attached SQL Server tables

       and update the data.

       For information on creating indexes based on SQL Server

       database tables, see the "Microsoft SQL Server System

       Administrator's Guide," or pages 67-72 in the "Microsoft SQL

       Server Language Reference."


INF: Forms Questions & Answers

 Article Number: Q104387

 CREATED: 14-SEP-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

======================================================================

  Microsoft(R) Product Support Services Application Note (Text File)

                   WX0637: FORMS QUESTIONS & ANSWERS

======================================================================

                                                   Revision Date: 9/93

                                                      No Disk Included

The following information applies to Microsoft Access(R), versions

1.0, and 1.1.

----------------------------------------------------------------------

| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY     |

| ACCOMPANY THIS DOCUMENT (collectively referred to as an Application |

| Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER      |

| EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED      |

| WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR       |

| PURPOSE. The user assumes the entire risk as to the accuracy and    |

| the use of this Application Note. This Application Note may be      |

| copied and distributed subject to the following conditions:  1) All |

| text must be copied without modification and all pages must be      |

| included;  2) If software is included, all files on the disk(s)     |

| must be copied without modification (the MS-DOS(R)  utility         |

| diskcopy is appropriate for this purpose);  3) All components of    |

| this Application Note must be distributed together;  and  4) This   |

| Application Note may not be distributed for profit.                 |

|                                                                     |

| Copyright (C) 1992-1993 Microsoft Corporation.  All Rights Reserved |

| Microsoft, Microsoft Access, and MS-DOS are registered trademarks   |

| and Windows is a trademark of Microsoft Corporation.                |

|-------------------------------------------------------------------- |

1.  Q. How do I invoke my Access Basic code from within a form?

    A. To call a function from a property, type the following:

          =<functionname>()

       The equal sign and parentheses are required. You can call an

       Access Basic function from form or control properties, such as

       AfterUpdate or DefaultValue. Search for the name of a specific

       property in Help for examples. Subroutines cannot be called

       from properties. For more information, please refer to "An

       Introduction to Programming," Chapter 7, page 1.

2.  Q. Do form rules override table rules?

    A. Yes, form rules do override table rules. When you position

       fields on a form by dragging them from the Field list, the

       validation property for the field inherits the validation rule

       that was defined for the field in the table design.

3.  Q. When is it appropriate to use the exclamation point versus the

       period when identifying objects and properties in an

       expression?

    A. A good rule of thumb is to use the exclamation point before

       anything you specifically name (such as the name of your form

       or a control on the form) and to use a period before anything

       Microsoft Access names (such as a property).

4.  Q. Why doesn't the header I created show in Form view?

    A. The header you created was most likely a page header. There are

       two different types of headers available on forms: form headers

       and page headers. A form header is displayed on-screen and when

       printed; a page header is displayed only when printed.

5.  Q. How do I reference a control on a subform?

    A. To reference the subform control itself, you must use the form


INF: Reports Questions & Answers

 Article Number: Q104388

 CREATED: 14-SEP-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

======================================================================

  Microsoft(R) Product Support Services Application Note (Text File)

                  WX0640: REPORTS QUESTIONS & ANSWERS

======================================================================

                                                   Revision Date: 9/93

                                                      No Disk Included

The following information applies to Microsoft Access(R), versions 1.0,

and 1.1.

-----------------------------------------------------------------------

| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY     |

| ACCOMPANY THIS DOCUMENT (collectively referred to as an Application |

| Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER      |

| EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED      |

| WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR       |

| PURPOSE. The user assumes the entire risk as to the accuracy and    |

| the use of this Application Note. This Application Note may be      |

| copied and distributed subject to the following conditions:  1) All |

| text must be copied without modification and all pages must be      |

| included;  2) If software is included, all files on the disk(s)     |

| must be copied without modification (the MS-DOS(R)  utility         |

| diskcopy is appropriate for this purpose);  3) All components of    |

| this Application Note must be distributed together;  and  4) This   |

| Application Note may not be distributed for profit.                 |

|                                                                     |

| Copyright (C) 1992-1993 Microsoft Corporation.  All Rights Reserved |

| Microsoft, Microsoft Access, and MS-DOS are registered trademarks   |

| and Windows is a trademark of Microsoft Corporation.                |

|---------------------------------------------------------------------|

1.  Q. Why is every other page of my report blank? How can I correct

       this problem?

    A. This problem commonly occurs when the width of your report

       combined with the left and right margins is greater than the

       width of your paper. Adjust the width of your report and the

       margins so that your report fits on the page.

       For additional information on preventing blank pages, please

       obtain Technical Note #95920. You can order this technical note

       by selecting the FastTips Technical Library option from the

       FastTips Main Menu.

2.  Q. How can I convert a form to a report?

    A. To convert a form to a report, open the form in Design view and

       choose Save As Report from the File menu.

3.  Q. How can I sort the data in a report by a field not displayed on

       the report?

    A. To sort report data by a field in a separate table, create a

       query that includes the field from the other table, then base

       the report on the query. If you have already created the

       report, verify that the query includes all the fields used in

       the report and change the RecordSource property of the report

       to refer to the new query. Now you can adjust the Sorting and

       Grouping properties of the report to sort on the new field.

4.  Q. How can I prevent a page break from occurring in the middle of

       a group?

    A. The KeepTogether property keeps all the controls for one record

       together within a particular section of a report. However, it

       does not keep multiple records together, nor does it keep a

       group header and its detail records together.

       The following methods can prevent page breaks from occurring in

       the middle of groups:

        - Set the ForceNewPage property of the report's Group Header

          section to Before Section. This ensures that each group will

          start on a new page and that as many detail records as possible

          will fit on one page.

        - Repeat the group name, or place a "Continued" label at the top

          of each consecutive page.

          For additional information on how to create these labels

          for consecutive pages of a group, please obtain Technical

          Notes #88156 and #93927. You can order these technical notes

          by selecting the FastTips Technical Library option from the

          FastTips Main Menu.

        - Before placing the group header on the current page, create an

          Access Basic function that calculates how much space is left on

          the page.


INF: Access Basic and Macros Questions & Answers

 Article Number: Q104389

 CREATED: 14-SEP-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

======================================================================

  Microsoft(R) Product Support Services Application Note (Text File)

        WX0636: ACCESS(R) BASIC AND MACROS QUESTIONS & ANSWERS

======================================================================

                                                   Revision Date: 9/93

                                                      No Disk Included

The following information applies to Microsoft Access, versions 1.0,

and 1.1.

-----------------------------------------------------------------------

| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY     |

| ACCOMPANY THIS DOCUMENT (collectively referred to as an Application |

| Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER      |

| EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED      |

| WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR       |

| PURPOSE. The user assumes the entire risk as to the accuracy and    |

| the use of this Application Note. This Application Note may be      |

| copied and distributed subject to the following conditions:  1) All |

| text must be copied without modification and all pages must be      |

| included;  2) If software is included, all files on the disk(s)     |

| must be copied without modification (the MS-DOS(R)  utility         |

| diskcopy is appropriate for this purpose);  3) All components of    |

| this Application Note must be distributed together;  and  4) This   |

| Application Note may not be distributed for profit.                 |

|                                                                     |

| Copyright (C) 1992-1993 Microsoft Corporation.  All Rights Reserved |

| Microsoft, Microsoft Access, and MS-DOS are registered trademarks   |

| and Windows is a trademark of Microsoft Corporation.                |

-----------------------------------------------------------------------

1.  Q. How can I run macros from Access Basic?

    A. The following are three suggested ways to run macros from

       Access Basic:

       - Create the macro using the macro editor and then call it from

         your Access Basic procedure. For example, if you create a macro

         called Macro1, you can call the macro from a procedure with the

         following command:

            DoCmd RunMacro "macro1"

       - Call the macro from the Immediate window using the same syntax

         as you would in Access Basic. Again, the syntax is as follows:

            DoCmd RunMacro "macro1"

       - Use DoCmd to run a macro action, rather than creating a macro

         specifically for that action. The basic format of DoCmd is as

         follows:

            DoCmd <Action> <Argument1>, <Argument2>

         For more information on DoCmd, RunMacro, and macro actions,

         please refer to the "User's Guide" and "An Introduction to

         Programming;" or, search Help on the keywords DOCMD and

         Expressions in Macros and Actions.

2.  Q. When should I use the Variant data type?

    A. Use the Variant data type if you are unsure what type of data

       you are working with. When you use the Variant data type,

       Microsoft Access evaluates the data and then handles it

       appropriately. Using variants avoids the step of assigning data

       types to variables and manually converting data types in your

       programs. Further, when you store table data in variables,

       using variants eliminates complications with NULL data values.

3.  Q. How do I comment out a macro action?

    A. With the macro in Design view, choose Conditions from the View

       menu. This adds the Condition column to the macro design. Type

       "false" (without the quotation marks) on the condition line for

       the macro action you want to comment out.

4.  Q. How do I bypass the AutoExec startup macro when I open a

       database?

    A. Hold down the SHIFT key when you open the database to prevent

       Microsoft Access from executing that database's AutoExec macro.

5.  Q. How do I include a variable or form reference in the WHERE

       clause of my SQL statement?

    A. The syntax for including a variable or form reference in the


INF: Querying Questions & Answers

 Article Number: Q104390

 CREATED: 14-SEP-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

======================================================================

  Microsoft(R) Product Support Services Application Note (Text File)

                 WX0639: QUERYING QUESTIONS & ANSWERS

======================================================================

                                                                  9/93

                                                      No Disk Included

The following information applies to Microsoft Access(R), versions

1.0, and 1.1.

-----------------------------------------------------------------------

| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY     |

| ACCOMPANY THIS DOCUMENT (collectively referred to as an Application |

| Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER      |

| EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED      |

| WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR       |

| PURPOSE. The user assumes the entire risk as to the accuracy and    |

| the use of this Application Note. This Application Note may be      |

| copied and distributed subject to the following conditions:  1) All |

| text must be copied without modification and all pages must be      |

| included;  2) If software is included, all files on the disk(s)     |

| must be copied without modification (the MS-DOS(R)  utility         |

| diskcopy is appropriate for this purpose);  3) All components of    |

| this Application Note must be distributed together;  and  4) This   |

| Application Note may not be distributed for profit.                 |

|                                                                     |

| Copyright (C) 1992-1993 Microsoft Corporation.  All Rights Reserved |

| Microsoft, FoxPro, Microsoft Access, and MS-DOS are registered      |

| trademarks                                                          |

| and Windows is a trademark of Microsoft Corporation.                |

| Paradox is a registered trademark of Ansa Software, a Borland       |

| company                                                             |

| dBASE III PLUS and dBASE IV are registered trademarks of Borland    |

| International, Inc.                                                 |

| Btrieve is a registered trademark of Novell, Inc.                   |

| Sybase is a registered trademark of Sybase, Inc.                    |

-----------------------------------------------------------------------

1.  Q. How can I export the results of a query?

    A. To export the results of a query, you can either create a table

       that contains the results or create a macro to export the query

       itself.

       METHOD 1: To create a table that contains the results of the

       query, change the select query to a make-table query by opening

       it in Design view and choosing Make Table from the Query menu.

       The resulting table will contain the data to be exported. Then

       choose Export from the File menu to export the data in the

       format you want. For more information, please refer to Chapter

       4 of the "Microsoft Access User's Guide."

       METHOD 2: To create a macro to export the query, use the

       TransferText macro action to export the data in text file

       format or use the TransferSpreadsheet macro action to export

       the data in spreadsheet format. Using the name of a query in

       the TableName parameter of these macro actions allows you to

       export the query in either file format.

        NOTE: This feature is undocumented. To export a parameter

        query, you must use Method 1. For specific instructions on

        using the TransferText or TransferSpreadsheet macro actions,

        search for "TransferText" or "TransferSpreadsheet" using the

        Help menu.

2.  Q. Can I join tables from different databases into one query?

    A. Yes, you can join tables from different databases into one

       query by choosing Attach Table from the File menu. Using these

       remotely-attached tables, you can generate queries from any

       supported data source (for example, Btrieve(R), dBASE III

       PLUS(R), dBASE IV(R), FoxPro(R), or Paradox(R)).

3.  Q. Is data in tables stored in a sorted order? How can I view my

       data in sorted order?

    A. Data in tables is not stored in sorted order. Data is stored in

       the order in which it was entered. To view data in sorted

       order, create either a query or a form based on a query that

       uses the Sort field on the query grid. By default, if the table

       includes a primary key, the Datasheet view of the table will

       display the data sorted by the primary key. To view the data

       sorted by something other than the primary key alone, use a

       query, as previously described.

4.  Q. How can I create computed columns in tables?

    A. You can create computed columns or expressions with queries.

       Within the query, create a column that is defined as an

       expression. In general, it is helpful to think of queries as

       virtual tables; you can use a query wherever you can use a

       table. If you're familiar with SQL terminology, this is very

       similar to creating a view. Unlike most implementations of

       views, however, Microsoft Access views can be updated even if

       they involve joins from different data sources, such as

       Paradox, Btrieve, or separate Microsoft Access data sources.

5.  Q. What is the difference between the keywords DISTINCT and

       DISTINCTROW?

    A. DISTINCT is part of the SQL standard and causes a query to

       return unique data, rather than unique records. For example,

       even if there are 10 customers named Jones, the query "SELECT

       DISTINCT Name FROM Customer" returns only one row containing

       Jones. With Microsoft Access queries, you specify DISTINCT by

       choosing Query Properties from the View menu and then selecting

       the Unique Values Only check box.

       DISTINCTROW is unique to Microsoft Access and is not part of

       the SQL standard. It causes a query to return unique records,

       rather than unique data values. For example, if there are 10

       customers named Jones, the query "SELECT DISTINCTROW Name FROM

       Customer" returns all 10 rows containing Jones.

       The main reason for adding the DISTINCTROW keyword to Microsoft

       Access SQL is to support semi-joins that can be updated (for

       example, one-to-many joins in which the output columns all come

       from the one-sided table). DISTINCTROW is specified by default

       in Microsoft Access queries and is ignored in queries for which

       it has no effect.

6.  Q. Why do queries change the order of my columns?

    A. When you close a query, Microsoft Access moves the sorted

       fields to the leftmost columns in the Query-By-Example

       (QBE) grid. For example, if you open an existing query in

       Design view, revise it, and save your changes, Microsoft Access

       displays the sorted fields to the left of the datasheet. You

       can rearrange the fields if necessary.

7.  Q. I am sending a query to Microsoft SQL Server or Sybase(R) SQL

       Server through Microsoft Access, but the query runs very

       slowly. Why does this occur, and how can I increase the query

       speed?

    A. The query speed most often decreases when you send implicit,

       instead of explicit, parameters to the remote server.

       Query parameters can be either implicit or explicit. A

       parameter entry made only in the Query-By-Example (QBE) grid is

       called an implicit parameter. A parameter entry made in both

       the QBE grid and the Query Parameters dialog box is called an

       explicit parameter.

       When you use implicit parameters in your query, Microsoft

       Access does not send the query to the remote server, because

       Microsoft Access cannot verify what implicit conversions the

       remote server provides. As a result, Microsoft Access processes

       the query locally, which can noticeably reduce the query speed.

       However, when you use explicit parameters in your query,

       Microsoft Access knows the data types of the parameters.

       Subsequently, Microsoft Access sends the query to the remote

       server for processing, which speeds up the query.

       Note also that Microsoft Access automatically treats

       unrecognized or misspelled names and expressions as implicit

       parameters, rather than as errors. Microsoft Access then makes

       a "best guess" about the implicit parameter's data type. If

       Microsoft Access guesses the wrong data type, a query can

       return unexpected results or values, either when you enter a

       parameter value or when you execute queries on a remote server.

       For additional optimization tips for attached SQL Server

       tables, please obtain Technical Note #99321. You can order this

       technical note by selecting the FastTips Technical Library

       option from the Fast Tips Main Menu.


INF: Setup Questions & Answers

 Article Number: Q104391

 CREATED: 14-SEP-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

======================================================================

  Microsoft(R) Product Support Services Application Note (Text File)

                   WX0812: SETUP QUESTIONS & ANSWERS

======================================================================

                                                   Revision Date: 9/93

                                                      No Disk Included

The following information applies to Microsoft Access(R), versions

1.0 and 1.1.

----------------------------------------------------------------------

| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY     |

| ACCOMPANY THIS DOCUMENT (collectively referred to as an Application |

| Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER      |

| EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED      |

| WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR       |

| PURPOSE. The user assumes the entire risk as to the accuracy and    |

| the use of this Application Note. This Application Note may be      |

| copied and distributed subject to the following conditions:  1) All |

| text must be copied without modification and all pages must be      |

| included;  2) If software is included, all files on the disk(s)     |

| must be copied without modification (the MS-DOS(R)  utility         |

| diskcopy is appropriate for this purpose);  3) All components of    |

| this Application Note must be distributed together;  and  4) This   |

| Application Note may not be distributed for profit.                 |

|                                                                     |

| Copyright (C) 1993 Microsoft Corporation.  All Rights Reserved.     |

| Microsoft, Microsoft Access, and MS-DOS are registered trademarks   |

| and Windows is a trademark of Microsoft Corporation.                |

| Quicken is a registered trademark of Intuit.                        |

|---------------------------------------------------------------------|

1.  Q. Why does Microsoft recommend that I remove SHARE.EXE from my

       AUTOEXEC.BAT file if I run Microsoft Windows for Workgroups?

    A. We recommend that you remove SHARE.EXE from your AUTOEXEC.BAT

       file only if you run Microsoft Windows for Workgroups in 386

       enhanced mode. When Windows for Workgroups is run in 386

       enhanced mode loads and uses a file-sharing program called

       VSHARE.386, which replaces SHARE.EXE. There is an entry for

       VSHARE.386 in the SYSTEM.INI file.

       If you plan to run Windows for Workgroups exclusively in 386

       enhanced mode and not run other applications that require

       SHARE.EXE, you can save approximately 5 kilobytes (K) of

       conventional memory by not loading VSHARE.386 at all. If you

       have already loaded SHARE.EXE, delete it from your AUTOEXEC.BAT

       file and restart your computer.

       You are likely to find SHARE.EXE in your AUTOEXEC.BAT file

       because SETUP.EXE automatically inserts the following MS-DOS

       command in your AUTOEXEC.BAT file when you install Microsoft

       Access

          <directory>\share.exe /l:500

       where <directory> is the name of your MS-DOS directory.

       If you load VSHARE.386 and SHARE.EXE is already present,

       VSHARE.386 temporarily disables it. VSHARE.386 takes over file-

       sharing tasks until you exit Windows for Workgroups. VSHARE.386

       then transfers the tasks back to SHARE.EXE, so file sharing is

       available to your MS-DOS-based applications.

       Microsoft Access runs correctly with either SHARE.EXE or

       VSHARE.386, but SHARE.EXE limits the number of available locks

       to the number you specified when you loaded the file

       originally. The /L parameter specifies the number of locks; the

       default is 20. VSHARE.386, on the other hand, dynamically

       allocates the number of locks available, based on demand. The

       number of locks available is especially important if you are

       running Windows for Workgroups in a client-server environment.

       For additional information on the SHARE.EXE file, please obtain

       Technical Note #95047. You can order this technical note by

       selecting the FastTips Technical Library option from the

       FastTips Main Menu.

 2. Q. Why do I get the error message "Outdated 'COMMDLG.DLL' found.

       Please reinstall Microsoft Access" when I install Microsoft

       Access?

    A. This error can occur for a number of reasons. To isolate the

       cause, check the following:

        NOTE: This example uses the COMMDLG.DLL file. The same problem

        can occur with other .DLL files. These steps can be used to

        resolve any problems with outdated .DLL files.

        - Make sure that you have no more than one COMMDLG.DLL file on your

          hard disk. If you have several earlier versions of this file,

          either delete or rename the earlier COMMDLG.DLL files and keep

only

          the latest one.

          If you are running MS-DOS version 5.0 or later, use the

          following two steps to search for all occurrences of the

          COMMDLG.DLL file:

          1. Quit Windows.

          2. At the MS-DOS prompt, type the following command for all

             logical drives

                dir <drive>:\commdlg.dll /s

             where <drive> is the drive on which your Windows

             directory is located, the drive on which you installed

             Microsoft Access, and each drive located in the PATH

             statement in your AUTOEXEC.BAT file.

          For versions of MS-DOS earlier than 5.0, you must either go

          into each directory and execute the above DIR command

          without the /S parameter, or use a utility to search for all

          occurrences of the COMMDLG.DLL file.

        - Make sure that the COMMDLG.DLL file is located in your Windows

          SYSTEM subdirectory only.

        - Make sure that the COMMDLG.DLL file is up to date. The file

should

          have one of the three dates below, or later:

             03/10/92    (for Microsoft Windows 3.1)

             10/01/92    (for Microsoft Windows for Workgroups)

             10/25/92    (for Microsoft Access)

        - Make sure that you are not using a third-party, incompatible

          COMMDLG.DLL file.

        - Make sure that no other applications are running with Windows

          before you run Microsoft Access Setup.

          You cannot update the COMMDLG.DLL file during installation

          if another application is currently using the file. To

          ensure that all other Windows-based applications are closed,

          use the following five steps:

          1. Create a temporary Program Manager group.

          2. Move all the icons from the Startup group into the

             temporary group.

          3. Back up your WIN.INI file. In the original copy, delete

             all the items from both the run= and the load= lines to

             read:

                [windows]

                run=

                load=

          4. Restart Windows.

          5. After installing Microsoft Access, move the icons from

             the temporary group back into the Startup group and

             restore the WIN.INI file from your backup. Quit and

             restart Windows.

       If you follow all the previous instructions and you still get

       an "Outdated DLL" error message, your copy of the COMMDLG.DLL

       file may be corrupt or damaged. To solve this problem,

       reinstall a new copy of this file from your Microsoft Access

       package using the following three steps:

       1. Copy the COMMDLG.DL_ file from Disk 1 of your Microsoft

          Access package to a directory on your hard disk.

           NOTE: Be sure to copy the COMMDLG.DL_ file, not the

           COMMDLG.DL$ file.

       2. Copy the EXPAND.EXE file from the appropriate Windows setup

          disk to the same directory you used in step 1.

       3. Use EXPAND.EXE to unpack the COMMDLG.DL_ file and place it

          in your Windows SYSTEM subdirectory. The syntax to complete

          this action is as follows

             <drive>:\<directory>\expand commdlg.dl_

             <destination>\commdlg.dll

          where <drive> and <directory> correspond to the location of

          EXPAND.EXE and <destination> is the drive and location of

          your Windows SYSTEM subdirectory.

       For additional information about outdated DLLs, please obtain

       Technical Notes #93694 and #90863. You can order these

       technical notes by selecting the FastTips Technical Library

       option from the Fast Tips Main Menu.

3.  Q. When I try to install Microsoft Access, Setup fails. What

       should I do?

    A. Setup problems are often caused by terminate-and-stay-resident

       (TSR) programs that are loaded at the

       MS-DOS level and/or at the Microsoft Windows level.

       To determine if TSRs are causing Setup to fail, remove all

       unnecessary TSRs and device drivers from the CONFIG.SYS and the

       AUTOEXEC.BAT files, remove all icons from the Startup group in

       Program Manager, and delete all entries under the load= and

       run= lines in your WIN.INI file.

        NOTE: Be sure to back up your CONFIG.SYS, AUTOEXEC.BAT, and

        WIN.INI files before modifying them.

       The table below describes some TSRs that are known to cause

       problems with the Microsoft Access Setup program:

          Filename       Description

       -----------------------------------------------------------------

          APPEND.EXE     An MS-DOS TSR loaded in the AUTOEXEC.BAT file

          SUBST.EXE      An MS-DOS TSR loaded in the AUTOEXEC.BAT file

          BILLMNDR.EXE   An automated bill reminder loaded with Quicken(R)

                         that can reside on the load= line of the

                         WIN.INI file

       For additional troubleshooting steps to resolve Setup problems,

       please obtain Technical Note #96109. You can order this

       technical note by selecting the FastTips Technical Library

       option from the FastTips Main Menu.

 4. Q. A directory called MS-SETUP.T is left on my hard disk after I

       install Microsoft Access. Can I safely delete this directory?

    A. Yes. After Microsoft Access installation is complete, it is

       okay to delete the MS-SETUP.T directory and all the files in

       it.

       This directory is not deleted automatically because of a known

       problem that occurs in Microsoft Access Setup when you choose

       the Reboot Your System After Completing Setup option. If you

       choose the Return To Windows After Setup option instead,

       Microsoft Access automatically deletes the

       MS-SETUP.T directory and its contents.

5.  Q. Why do I get a general protection (GP) fault when I run Setup?

    A. Running the Microsoft Access version 1.1 Setup program in

       Windows standard mode results in a GP fault. To run Setup

       correctly, run it in Windows 386 enhanced mode instead. To

       start Windows in 386 enhanced mode, type the following at the

       MS-DOS prompt:

          win /3

6.  Q. The AccessWizards are unavailable after I upgrade to Microsoft

       Access version 1.1. How do I get the AccessWizards to work?

    A. If the AccessWizards button is unavailable when you create a

       new form or report, it is likely that the MSACCESS.INI file was

       not properly updated. To solve this problem, use the following

       three steps:

       1. Rename your current MSACCESS.INI file to a different name,

          such as MSACCESS.BAK. The MSACCESS.INI file is located in

          your Windows program directory.

       2. Back up any database (.MDB) files that you have created.

       3. Run the Microsoft Access Setup program again.

       The MSACCESS.INI file should now be correctly updated.


INF: Database Structure Questions & Answers

 Article Number: Q104392

 CREATED: 14-SEP-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

======================================================================

  Microsoft(R) Product Support Services Application Note (Text File)

            WX0635: DATABASE STRUCTURE QUESTIONS & ANSWERS

======================================================================

                                                   Revision Date: 9/93

                                                      No Disk Included

The following information applies to Microsoft Access(R), versions

1.0, and 1.1.

-----------------------------------------------------------------------

| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY     |

| ACCOMPANY THIS DOCUMENT (collectively referred to as an Application |

| Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER      |

| EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED      |

| WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR       |

| PURPOSE. The user assumes the entire risk as to the accuracy and    |

| the use of this Application Note. This Application Note may be      |

| copied and distributed subject to the following conditions:  1) All |

| text must be copied without modification and all pages must be      |

| included;  2) If software is included, all files on the disk(s)     |

| must be copied without modification (the MS-DOS(R)  utility         |

| diskcopy is appropriate for this purpose);  3) All components of    |

| this Application Note must be distributed together;  and  4) This   |

| Application Note may not be distributed for profit.                 |

|                                                                     |

| Copyright (C) 1992-1993 Microsoft Corporation.  All Rights Reserved |

| Microsoft, FoxPro, Microsoft Access, and MS-DOS are registered      |

| trademarks                                                          |

| and Windows is a trademark of Microsoft Corporation.                |

| Paradox is a registered trademark of Ansa Software, a Borland       |

| company.                                                            |

| dBASE III PLUS and dBASE IV are registered trademarks of            |

| Borland International, Inc.                                         |

| 1-2-3 and Lotus are registered trademarks of Lotus Development      |

| Corporation.                                                        |

| Btrieve is a registered trademark of Novell, Inc.                   |

| Oracle is a registered trademark of Oracle Corporation.             |

| Sybase is a registered trademark of Sybase, Inc.                    |

-----------------------------------------------------------------------

1.  Q. What foreign data formats does Microsoft Access support?

    A. Microsoft Access can link to Btrieve(R), dBASE III PLUS(R),

       dBASE IV(R), FoxPro(R) versions 2.x, and Paradox(R) versions

       3.x data, including indexes.

       Microsoft Access can import data from Btrieve, dBASE III PLUS,

       dBASE IV, FoxPro versions 2.x, Lotus(R) 1-2-3(R) versions 2.x

       and 3.x, Lotus 1-2-3/W, Microsoft Excel versions 2.x and later

       for Windows, Paradox 3.x, and fixed-length and delimited ASCII

       text.

       Microsoft Access can connect to Microsoft SQL Server, Sybase(R)

       SQL Server, and Oracle(R) RDBMS Server using the Open Database

       Connectivity (ODBC) specification. These ODBC drivers are the

       only drivers currently certified for Microsoft Access version

       1.1.

2.  Q. What are primary and foreign keys in a relational database?

    A. Primary keys uniquely identify a specific row in a table. They

       are usually composed of a single field or column whose data is

       unique to each row of information (for example, a customer

       identification number, employee social security number, or

       order identification number). Primary keys also can be composed

       of more than one field. For example, the fields Company

       Identification and Contact Name could be combined to form a

       primary key for a table that contains information about

       companies that have more than one contact.

       Foreign keys identify rows in one table that match the primary

       key of another table. For example, if the field Employee ID is

       the primary key in the Employee table, in the Orders table,

       Employee ID is the foreign key. The relationship between

       primary and foreign keys enables you to access related data in

       multiple tables.

3.  Q. Which FieldSize setting should I select for the Number data

       type in order to use a Counter field of another table as the

       foreign key in the current table?

    A. To use a Counter field of another table as the foreign key in

       the current table, select the Long Integer setting.

4.  Q. How do you change the starting value of a Counter column to a

       number other than 1?

    A. To set the starting value of a Counter column to a number other

       than 1, use the following four steps:

       1. Create an additional single-column temporary table. Give the

          Number column the same name as the Counter column in the

          original table.

       2. Create a new row in the temporary table by inserting a value

          in the Number column. This value should be 1 less than the

          desired starting value for the original table.

       3. Create an append query to append the single row from the

          temporary table to the original table.

       4. Delete the temporary table. You can then delete the dummy

          row from the original table.

        NOTE: Do not compact the database before you add the first row

        to the original table. If you do this, the counter value

        resets to begin at 1.

       For additional information and an example of how to set the

       initial value of a counter, please obtain Technical Note

       #94821. You can order this technical note by selecting the

       FastTips Technical Library option from the FastTips Main Menu.

5.  Q. Is data in tables stored in a sorted order? How can I view my

       data in sorted order?

    A. Data in tables is not stored in sorted order. Data is stored in

       the order in which it was entered. To view data in sorted

       order, create a query, or a form based on a query, that uses

       the Sort field on the query grid. By default, if the table

       includes a primary key, the Datasheet view of the table will

       display the data sorted by the primary key. To view the data

       sorted by something other than the primary key alone, use a

       query, as previously described.

6.  Q. How can I delete the primary key from a table?

    A. You can delete the primary key for a table by opening the Table

       Properties dialog box and deleting the entry for the Primary

       Key field. Please note that the primary key cannot be deleted

       from a table that is the primary table in a relationship.

7.  Q. How can I create computed columns in tables?

    A. You can create computed columns or expressions with queries.

       Within the query, create a column that is defined as an

       expression. In general, it is helpful to think of queries as

       virtual tables; you can use a query wherever you can use a

       table. If you're familiar with SQL terminology, this is very

       similar to creating a view. Unlike most implementations of

       views, however, Microsoft Access views can be updated even if

       they involve joins from different data sources, such as

       Paradox, Btrieve, or separate Microsoft Access data sources.

8.  Q. Two of my tables have Counter data type columns in common. Why

       can't I define a relationship between the two tables based on

       these columns?

    A. You can define only one-to-one relationships between Counter

       data type columns. If the linking column on the "one" side is a

       counter, define the linking column on the "many" side as a long

       integer.

       For more information on table relationships, see the "Microsoft

       Access User's Guide," Chapter 1, "Designing a Database," pages

       13-18.

9.  Q. How many databases can I open at a time in Microsoft Access?

    A. Through the user interface menus in Microsoft Access, you can

       open only one database at a time; therefore, you can view only

       one database window in each session of Microsoft Access.

       Through Access Basic, however, you can use the OpenDatabase()

       function to open several databases at once. The number of

       databases you can have open simultaneously through Access Basic

       is limited only by your computer's memory.

       Also, by choosing Attach Table from the File menu, you can

       attach to as many databases as your computer's memory allows.

10. Q. Can Microsoft Access version 1.0 use databases created in

       version 1.1?

    A. Microsoft Access 1.0 cannot read from or write to databases

       created in Microsoft Access 1.1. However, Microsoft Access 1.1

       can read from and write to databases created in version 1.0 and

       still allow version 1.0 to read from and write to the same

       database without conversion.

       If you want to upgrade your version 1.0 database to version 1.1

       format, use the following four steps:

       1. From the version 1.1 File menu, choose Compact Database. The

          Database To Compact From dialog box is displayed.

       2. In the File Name box, select the database that you want to

          convert. In the List Files Of Type box, select Databases

          (*.mdb).

       3. Choose OK. The Database To Compact To dialog box is

          displayed.

       4. In the List Files Of Type box, select Access V1.1 (*.MDB).

           NOTE: If you want to convert your version 1.1 database back

           to version 1.0 format, select Access V1.0 (*.MDB) instead.


PRA: SQORA.DLL Does Not Allow Lengthy SQL Statements

 Article Number: Q104452

 CREATED: 16-SEP-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.1 and 2.0

---------------------------------------------------------------------

SYMPTOMS

When executing a query against an Oracle table, or updating a record

in an Oracle table, the error message

   Statement was longer then allowable maximum 2000+ chars

is displayed if the table and field names are very long or the query is

very complex.

CAUSE

This is a problem with SQORA.DLL, the Oracle ODBC Driver.

RESOLUTION

Obtain and install the updated driver, or use queries to do updates,

rather than updating records while the Oracle table is in Datasheet

view. The query should yield only the columns to be updated.

For complex queries, reduce the number of tables or joins in the query

and reduce the number of fields used or shown in the query.

These workarounds reduce the length of the SQL statements.

STATUS

Microsoft has confirmed this to be a problem in the Oracle ODBC driver

shipped with Microsoft Access versions 1.1 and 2.0 and Visual Basic for

Windows version 3.0 - Professional Edition. An updated driver that corrects

this specific problem is available from Microsoft.

MORE INFORMATION

Obtaining the Updated Driver

----------------------------

ORA110.EXE, a self-extracting zipped file, can be downloaded from

Library 11, ODBC Connectivity, in the MSACCESS forum on CompuServe, or

from the Microsoft Download Service (MSDL).

If the user is unable to download the file, Microsoft Product Support

Services (PSS) can provide the data on disk, which also includes an

updated Btrieve driver.

NOTE: This driver is for use only by registered owners of Microsoft

Access versions 1.1 and 2.0 and Visual Basic for Windows version 3.0 -

Professional Edition. By installing these files, you are indicating

that you own one of these products.

Disk Contents

-------------

The following files are found on the disk:

   README.TXT

   BTRV110.DLL

   ORACLE.TXT

   SQORA.DL_

   SQORASTP.DL_

   ODBC.INF

   SETUP.EXE

NOTE: The SETUP.EXE file is called by the ODBC Control Panel facility.

It will not run as a standalone file.

The following two files will actually be updated:

                          Old                     New

                -----------------------------------------------

SQORA.DLL       Version:  1.00.2816     Version:  1.00.3112

                   Size:  143,600 bytes    Size:  144,096 bytes

                   Date:  4/16/93          Date:  7/12/93

SQORASTP.DLL    Version:  1.00.2403     Version:  1.00.3106

                   Size:  9,328 bytes      Size:  9,632 bytes

                   Date:  5/7/93           Date:  7/6/93

The README.TXT file on the disk documents both the changes to the

Btrieve and Oracle drivers and the installation procedures for each.

Oracle and Btrieve drivers are manufactured by Oracle Corporation and

Novell, Inc. respectively and CompuServe by CompuServe, Inc., all

vendors independent of Microsoft; we make no warranty, implied or

otherwise, regarding these products' performance or reliability.

Additional reference words: 1.10 2.00


PRB: Make-Table Query Does Not Copy Field Descriptions

 Article Number: Q104487

 CREATED: 19-SEP-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A table created with a make-table query will not contain any field

descriptions from the table on which the query is based.

RESOLUTION

If you want to create a new table that contains the field descriptions from

another table, you can use the Copy and Paste commands to create the new

table. The following steps demonstrate this method:

1. In the Tables list, select the table you want to copy.

2. From the Edit menu, choose Copy.

3. From the Edit menu, choose Paste.

4. Enter a name for the new table. Select either Structures Only or

   Structures And Data in the Paste Options box.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB. Create a new query based on the

   Categories table:

      Query: Copy Category Table

      --------------------------

      Type:     MakeTable

      Field:    Category ID

      Field:    Category Name

      Field:    Description

      Field:    Picture

      Type "Categories (MkTbl)" (without the quotation marks) as the new

      table name.

2. Run the query.

3. Open the Categories table in Design view and note the field

   descriptions. Then open the Categories (MkTbl) table in Design view and

   note that the field descriptions are absent.

Additional reference words: 1.00 1.10 2.00 maketable


PRB: Query Results in "Overflow" Error Message

 Article Number: Q104488

 CREATED: 19-SEP-1993

 MODIFIED: 01-DEC-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

When you run a query that contains a criterion, an "Overflow" error message

is returned. If you remove the criterion from the query grid, the query

runs correctly.

CAUSE

Causes for the "Overflow" error message include:

 - Dividing one number by another number such that the result is larger

   than the data type can hold. For example,

      Dim MyVal As Integer

      MyVal = 32767 / 0.1

   would result in setting MyVal to 327,670, which exceeds the maximum

   integer size of 32,767.

 - Multiplying two numbers such that the result is larger than the data

   type can hold.

 - Criteria that are less than 1. For example, the following expression and

   criteria can result in the "Overflow" message:

      Expression: "Test: ([Quantity] * [Unit Cost])/SumOfAmount"

      Criteria: ">.1"

RESOLUTION

One solution is to change the way the data is represented. Using the sample

expression above, you can change the expression and criteria to the

following:

   Expression: "Test: (([Quantity] * [Unit Cost])/SumOfAmount)*100"

   Criteria: ">10"

Note that both samples query for cases over 10 percent, but the second

sample does not generate the error message. Multiplying both the expression

and the criteria by 100 can be useful for correcting "Overflow" errors

generated by criteria less than 1.

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10


PRB: Formatted Colors Do Not Appear in Text

 Article Number: Q104566

 CREATED: 22-SEP-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A text box control does not display text in the color you specified.

Instead, the text is displayed as if you did not specify any color.

CAUSE

If you specify a color without a format in the Format property for a text

box, no color will be displayed.

RESOLUTION

Specify both a format and a color in the Format property for the text box.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB. Open the Orders Subform form in

   Design view.

2. Change the Format property of the Discount text box to:

      Text Box Properties

      -----------------------

      ControlName: Discount

      Format: [Red];;[Yellow]

3. Save and close the form.

4. Open the Orders form in Form view. Note that the Discount field displays

   in the same color regardless of the value in the field.

5. Close the Orders form. Open the Orders Subform form in Design view.

6. Change the Format property of the Discount field to:

      Text Box Properties

      ---------------------------------

      ControlName: Discount

      Format: 0.00%[Red];;0.00%[Yellow]

7. Save and close the form.

8. Open the Orders form in Form view. Note that the values in the Discount

   field display in red or yellow.

REFERENCES

==========

For more information on formatting fields, search for "Format" then "Format

Property" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


INF: How to Limit Page Movement in a Form

 Article Number: Q104568

 CREATED: 22-SEP-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

When a form is opened with a Dialog window mode, the form will not respond

to the PAGE UP and the PAGE DOWN keys. This behavior is useful for

controlling how a multiple-page form will respond to user input. For

example, you might cause a form to open with a Dialog window mode if you do

not want the multiple-page form to move to a new page when the user presses

PAGE UP or PAGE DOWN. When a form is opened with a Dialog window mode, the

page break control has no effect.

The following sample command demonstrates how to open a form with a Dialog

window mode:

   DoCmd OpenForm "Form1", A_NORMAL, , , , A_DIALOG

Note that many of the wizards that ship with Microsoft Access use this

technique to limit navigation in multiple-page forms.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.1, pages 348-349

Additional reference words: 1.00 1.10 2.00


INF: How to Run Wizards or Open the WIZARD.MDA File

 Article Number: Q104569

 CREATED: 22-SEP-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

You can cause the Microsoft Access Wizards to run by calling

the

zwWizMain() function that is defined in the zwUI module of

the WIZARD.MDA

file.

MORE INFORMATION

The zwWizMain() function is declared as

   Function zwWizMain (<szTable> As String, ByVal <fReport>

As Integer)

where <szTable> is a string value that is the name of an

existing table or

query in the open database, and <fReport> is a Boolean

value. The value for

<fReport> is either 0 or 1. Zero will open the FormsWizard,

and 1 will open

the ReportWizard.

You can also open the WIZARD.MDA file in Microsoft Access in

order to view

the code used by the FormsWizard and ReportWizard. To open

the WIZARD.MDA

file, do the following:

1. While Microsoft Access is not running, open the

MSACCESS.INI file

   located in your Windows directory. You can use any text

editor (for

   example, the Microsoft Windows Notepad editor) to open

the MSACCESS.INI

   file.

2. Locate the [Libraries] section in the file. It should

look like:

      [Libraries]

      wizard.mda=ro

3. Comment out the "wizard.mda=ro" line by putting a

semicolon at the

   beginning of the line. The section should now look like:

      [Libraries]

      ;wizard.mda=ro

4. Save and close the MSACCESS.INI file.

5. Start Microsoft Access.

6. From the File menu, choose Open Database.

7. Select the WIZARD.MDA file in the Open Database dialog

box.

With the WIZARD.MDA file open, you can view the code used by

the Wizards.

The following example demonstrates how to call the

zwWizMain() function

from an Immediate window:

   ?zwWizMain ("My Table", False)

NOTE: You will not be able to run the Wizards as you would

normally while

the WIZARD.MDA file is open. To run the Wizards normally,

you need to

remove the change made to the MSACCESS.INI file in step 3

above, and then

restart Microsoft Access.

Additional reference words: 1.00 1.10


INF: Using the INSTCAT.SQL Script with an ODBC Application

 Article Number: Q104601

 CREATED: 22-SEP-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.1 and 2.0

---------------------------------------------------------------------

SUMMARY

The INSTCAT.SQL script should be run on SQL Server for products that

use the SQL Server driver. Because different versions of the

INSTCAT.SQL script ship with different versions of the products and of

the SQL Server driver, this article discusses compatibility issues.

MORE INFORMATION

The INSTCAT.SQL script, when run on SQL Server, installs several

stored procedures that are later used by the ODBC SQL Server driver to

query the system catalog. Products such as Microsoft Visual Basic and

Microsoft Access, which use the SQL Server driver for ODBC access to

SQL Server, cannot be fully functional unless this script is run on

the server.

The INSTCAT.SQL script may have been run on SQL Server during the

installation of SQL Server itself. As a rule of thumb, we recommend

that the INSTCAT.SQL script that ships with Microsoft Access or Visual

Basic be used instead. (Note that this is an uncompressed file on the

driver disk.) To verify which version of the INSTCAT.SQL script is

running on the server, the following command can be issued from any

client utility (ISQL, SAF, and so forth):

   sp_server_info 500

This command returns a version string, such as 01.02.3015, in the

attribute_value column.

The table below lists the sizes, dates, and versions of the two

INSTCAT.SQL scripts that are shipping with Microsoft Access version

1.1, version 2.0 and Visual Basic version 3.0:

NOTE: These INSTCAT.SQL scripts must also be run on Sybase SQL Server

machines across all platforms and versions when using Microsoft Access

1.1 and greater or Visual Basic 3.0.

   Product                 Size         Version

   -------                 ----         -------

   Visual Basic 3.0        93834        01.01.2806

   Microsoft Access 1.1    93834        01.01.2807

   Microsoft Access 2.0   100363        01.02.3015

However, the above versions of the INSTCAT.SQL script are incompatible

with Microsoft Access version 1.0. As documented in the README.TXT

included with the Visual Basic 3.0 and Microsoft Access 1.1 products,

if you are also using Microsoft Access 1.0 as a client for SQL Server,

you should use the INSTCAT.SQL script that was included with Microsoft

Access 1.0.

NOTE: Visual Basic 3.0 and Microsoft Access 1.1 will work correctly

with the INSTCAT.SQL script from Microsoft Access 1.0, except that

Visual Basic 3.0 will be unable to delete indexes from tables.

Sybase SQL Server is manufactured by Sybase, Inc., a vendor

independent of Microsoft; we make no warranty, implied or otherwise,

regarding this product's performance or reliability.

Additional reference words: 1.10 2.00 ADK


PRA: Cannot Paste Data from Clipboard Using DDE

 Article Number: Q104682

 CREATED: 27-SEP-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you attempt to paste data into a dynamic data exchange (DDE) server

application from Microsoft Access, the process does not complete correctly

and the following error message is generated:

   The other application won't perform the DDE method or operation you

   attempted.

If you are using Microsoft Word for Windows as your DDE server application,

the error message "WordBASIC Err=102 Command failed" will appear in Word

for Windows.

If you are using Microsoft Excel as your DDE server application, the error

message "Cannot paste data" will appear in Microsoft Excel.

CAUSE

Microsoft Access does not "render," or place, the data on the Clipboard

until an application requests the data for pasting. (This technique

provides improved performance with large pieces of data.) When Microsoft

Access issues the DDEExecute command to tell the DDE server application to

paste the data, it waits for that command to finish before allowing any

other operation to take place. When the DDE server application receives the

paste command, it requests that Microsoft Access place the data on the

Clipboard. However, Microsoft Access will not do this because it is

waiting for the DDEExecute command to finish.

RESOLUTION

The following sample Access Basic function called RenderClipboard() can be

called to force Microsoft Access to render the data to the Clipboard before

issuing the DDEExecute command:

NOTE: This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual.

NOTE: You may have some Microsoft Windows API functions defined in an

existing Microsoft Access library; therefore, your declarations may be

duplicates. If you receive a duplicate procedure name error message, remove

or comment out the declarations statement in your code.

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   '*********************************************************

   ' MODULE DECLARATION SECTION

   '*********************************************************

   Declare Function OpenClipboard% Lib "User" (ByVal hWnd%)

   Declare Function GetClipboardData% Lib "User" (ByVal wFormat%)

   Declare Function CloseClipboard% Lib "User" ()

   Global Const CF_TEXT = 1

   Function RenderClipboard ()

       Dim RetVal As Integer

       RetVal = OpenClipboard(0)

       RetVal = GetClipboardData(CF_TEXT)

       RetVal = CloseClipboard()

   End Function

The following example demonstrates how to use the RenderClipboard()

function:

1. Start Microsoft Word for Windows. The default document Document1 should

   be open.

2. Start Microsoft Access. Open the sample database NWIND.MDB.

3. Create a new module, and enter the following Access Basic function:

      Function CopyRecordToWinword ()

         Dim RetVal, Chan

         ' Copy the current record to the clipboard

         DoCmd DoMenuItem A_FORMBAR, A_EDITMENU, A_SELECTRECORD

         DoCmd DoMenuItem A_FORMBAR, A_EDITMENU, A_COPY

         RetVal = RenderClipboard()

         Chan = DDEInitiate("winword", "Document1")

         DDEExecute Chan, "[EditPaste]"

         DDETerminate Chan

      End Function

4. Open the Customers form in Design view and add a command button with the

   following properties:

      Caption: Copy to Record

      OnPush: =CopyRecordToWinword()

5. Change to Form view, and choose the Copy To Winword button. The record

   will be pasted into the Word for Windows document.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Word for Windows. The default document Document1 should

   be open.

2. Start Microsoft Access. Open the sample database NWIND.MDB.

3. Create a new module, and enter the following Access Basic function:

      Option Explicit

      Function CopyRecordToWinword ()

         Dim RetVal, Chan

         ' Copy the current record to the clipboard

         DoCmd DoMenuItem A_FORMBAR, A_EDITMENU, A_SELECTRECORD

         DoCmd DoMenuItem A_FORMBAR, A_EDITMENU, A_COPY

         Chan = DDEInitiate("winword", "Document1")

         DDEExecute Chan, "[EditPaste]"

         DDETerminate Chan

      End Function

4. Open the Customers form in Design view and add a command button with the

   following properties:

      Caption: Copy to Record

      OnPush: =CopyRecordToWinword()

5. Change to Form view, and choose the Copy To Winword button. Word for

   Windows will generate the error message: "WordBASIC Err=102 Command

   failed."

NOTE: To reproduce the problem with Microsoft Excel, use the following

Access Basic function instead of the function listed above:

   Option Explicit

   Function CopyRecordToExcel ()

      Dim RetVal, Chan

      ' Copy the current record to the clipboard

      DoCmd DoMenuItem A_FORMBAR, A_EDITMENU, A_SELECTRECORD

      DoCmd DoMenuItem A_FORMBAR, A_EDITMENU, A_COPY

      Chan = DDEInitiate("Excel", "Sheet1")

      DDEExecute Chan, "[Paste()]"

      DDETerminate Chan

   End Function

Additional reference words: 1.00 1.10


INF: How to Create Custom Navigation (VCR) Buttons on a Form

 Article Number: Q104683

 CREATED: 27-SEP-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The navigation (VCR) buttons that appear on a form's horizontal

scroll bar provide a convenient way of navigating among records.

The following information describes how to create custom navigation

buttons on your own forms.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

MORE INFORMATION

The following sample module demonstrates Access Basic functions that

can be used to create custom buttons for navigating among first, last,

previous, and next records on a form. Functions are provided to

navigate through forms as well as subforms.

To create custom navigation buttons on a form, create a new module

with the following Access Basic code:

   '*******************************************

   ' MODULE DECLARATION SECTION

   '*******************************************

   Option Explicit

   Dim RetVal As Variant

   '*******************************************

   ' MODULE FUNCTIONS

   '*******************************************

   Function GotoFirstRecord ()

      RetVal = GotoRecord(A_FIRST)

   End Function

   Function GotoLastRecord ()

      RetVal = GotoRecord(A_LAST)

   End Function

   Function GotoNextRecord ()

      RetVal = GotoRecord(A_NEXT)

   End Function

   Function GotoPrevRecord ()

      RetVal = GotoRecord(A_PREVIOUS)

   End Function

   Function GotoFirstSubRecord (SubControlName As String)

      DoCmd GoToControl SubControlName

      RetVal = GotoFirstRecord()

   End Function

   Function GotoLastSubRecord (SubControlName As String)

      DoCmd GoToControl SubControlName

      RetVal = GotoLastRecord()

   End Function

   Function GotoNextSubRecord (SubControlName As String)

      DoCmd GoToControl SubControlName

      RetVal = GotoNextRecord()

   End Function

   Function GotoPrevSubRecord (SubControlName As String)

      DoCmd GoToControl SubControlName

      RetVal = GotoPrevRecord()

   End Function

   Function GotoRecord (Direction)

      On Error Resume Next

      DoCmd GoToRecord , , Direction

   End Function

How to Use the Custom Navigation Functions on a Form

----------------------------------------------------

The steps listed below demonstrate how to use the Access Basic functions

detailed above to add custom navigation buttons to the Orders and the

Orders Subform forms in the sample database NWIND.MDB included with

Microsoft Access:

1. Open the Orders form in Design view.

2. Create four buttons on the form to facilitate navigation among the

   Orders records. Place these buttons side by side, with the

   following properties:

      Command Button : btnGotoFirstRecord

         Caption: <<

         OnClick: =GotoFirstRecord()

         (OnPush in version 1.x)

      Command Button : btnGotoPrevRecord

         Caption: <

         OnClick: =GotoPrevRecord()

         (OnPush in version 1.x)

      Command Button : btnGotoNextRecord

         Caption: >

         OnClick: =GotoNextRecord()

         (OnPush in version 1.x)

      Command Button : btnGotoLastRecord

         Caption: >>

         OnClick: =GotoLastRecord()

         (OnPush in version 1.x)

3. Create four buttons on the Orders Subform form to facilitate navigation

   among the records. Place these buttons side by side, with the following

   properties:

      Command Button : btnGotoFirstSubRecord

         Caption: <<

         OnClick: =GotoFirstSubRecord("Orders Subform")

         (OnPush in version 1.x)

      Command Button : btnGotoPrevSubRecord

         Caption: <

         OnClick: =GotoPrevSubRecord("Orders Subform")

         (OnPush in version 1.x)

      Command Button : btnGotoNextSubRecord

         Caption: >

         OnClick: =GotoNextSubRecord("Orders Subform")

         (OnPush in version 1.x)

      Command Button : btnGotoLastSubRecord

         Caption: >>

         OnClick: =GotoLastSubRecord("Orders Subform")

         (OnPush in version 1.x)

NOTE: These buttons can be placed on the main form or on the subform.

The argument being passed to the function ("Orders Subform") is the name

of the subform control.

checkpage record selector vcr

Additional reference words: 1.00 1.10 2.00 scrollbar navigate goto


PRA: Machine Hangs When Relationships Box is Displayed

 Article Number: Q104709

 CREATED: 27-SEP-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Your computer hangs when you attempt to maximize a previously minimized

application if Microsoft Access has the focus and its Relationships box is

displayed.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Start Windows File Manager, then minimize it.

2. Start Microsoft Access and size the window so that you can see the

   File Manager icon at the bottom of your screen.

3. Open any database. From the Edit menu, choose Relationships to

   display the Relationships box.

4. Maximize File Manager by double-clicking the icon.

   Result: The control menu of the Relationship box opens and your

   computer hangs. To regain control, you must reboot.

Additional reference words: 1.00 1.10 WinIss ui stops frozen


INF: How to Activate an Application with Class Name

 Article Number: Q104710

 CREATED: 27-SEP-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The function AppActivate() can be used to activate an application using

the title bar text of the application. The exact title bar text must

be used, or the function fails. For example, the title bar text of

Microsoft Access is "Microsoft Access" unless an object (a form or

report, for example) is maximized. If an object is maximized, the

title bar text is "Microsoft Access - <Object Name>." Since knowing

the exact title bar text ahead of time can be challenging, the

following function demonstrates how to activate an application using

the application's Class Name and Microsoft Windows API calls.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access.

MORE INFORMATION

When an application is started from the Program Manager it registers

the class name of the form. The window class provides information

about the name, attributes, and resources required by your form. The

Microsoft Access window has the class name "OMain."

You can determine the class name of an application by using WinView

(WV.EXE), which is supplied with the Microsoft Windows Software

Development Kit (SDK) version 3.1.

To use the application's Class Name to activate the application,

create a new module with the following Declaration section and

function:

NOTE: In the following sample code, an underscore (_) is used as a

line-continuation character to improve readability. Remove the

underscore when re-creating this code in Access Basic.

NOTE: You may have some Microsoft Windows API functions defined in an

existing Microsoft Access library or module; therefore, your declarations

may be duplicates. If you receive a duplicate procedure name error message,

remove or comment out the declarations statement in your code.

'**************************************************************

' MODULE DECLARATION SECTION

'**************************************************************

Option Compare Database   'Use database order for string comparisons

Option Explicit

'Windows API Declarations

Declare Function ShowWindow% Lib "User" (ByVal hWnd%, ByVal nCmdShow%)

Declare Function FindWindow% Lib "user" (ByVal lpclassname As Any, _

                    ByVal lpCaption As Any)

Declare Function SetActiveWindow% Lib "User" (ByVal hWnd%)

Const SW_SHOW = 9

'******************************************************************

' FUNCTION: AppActivateClass()

'

' PURPOSE: Used to activate another application by using its

'    class name instead of the title bar text as AppActivate does.

'

' ARGUMENTS:

'    lpClassName$   - The Class Name of the application.

'

' RETURNS:

'     0   - The application was not found - it either was not running

'           or the class name is incorrect

'    -1   - The application was activated

'******************************************************************

Function AppActivateClass (lpclassname$)

   Dim hWnd%       'the application's window handle

   Dim dummy       'Dummy variable

   'Get the Window Handle

   hWnd% = FindWindow%(lpclassname$, 0&)

   'Activate the Application

   dummy = SetActiveWindow%(hWnd%)

   dummy = ShowWindow%(hWnd%, SW_SHOW)

   'Return True if Application Running, or False if not.

   AppActivateClass = hWnd%

End Function

To use this function, call the function and supply the class name

of the application to activate. The following example shows how to

activate Microsoft Word for Windows:

   x=AppActivateClass("opusapp")

Below are some class names of common applications that are shipped

with Windows:

   Class Name         Application

   ------------------------------

   OMain              ACCESS.EXE

   SciCalc            CALC.EXE

   CalWndMain         CALENDAR.EXE

   Cardfile           CARDFILE.EXE

   Clipboard          CLIPBOARD.EXE

   Clock              CLOCK.EXE

   CtlPanelClass      CONTROL.EXE

   XLMain             EXCEL.EXE

   Session            MS-DOS.EXE

   Notepad            NOTEPAD.EXE

   pbParent           PBRUSH.EXE

   Pif                PIFEDIT.EXE

   PrintManager       PRINTMAN.EXE

   Progman            PROGMAN.EXE   (Windows Program Manager)

   Recorder           RECORDER.EXE

   Reversi            REVERSI.EXE

   #32770             SETUP.EXE

   Solitaire          SOL.EXE

   Terminal           TERMINAL.EXE

   WFS_Frame          WINFILE.EXE

   MW_WINHELP         WINHELP.EXE

   #32770             WINVER.EXE

   OpusApp            WINWORD.EXE

   MSWRITE_MENU       WRITE.EXE

Additional reference words: 1.00 1.10 2.00 WinIss ab caption


PRA: Creating Unbound Object Frame with CreateControl()

 Article Number: Q104711

 CREATED: 27-SEP-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you use the CreateControl() function with a controltype argument of

114 to create an unbound object frame, Microsoft Access causes a general

protection (GP) fault when you view the form in Form view.

CAUSE

The CreateControl() function does not provide any method for specifying the

object to embed in the new control. Instead, an empty, unbound object frame

is created. Note that you cannot create an empty, unbound object frame when

you create the frame manually, since Microsoft Access displays an Insert

Object dialog box in which you must select the object to embed.

RESOLUTION

The GP fault occurs because Microsoft Access does not expect to run with an

empty, unbound object frame. The CreateControl() function does not provide

any method of specifying the object to embed.

The following example demonstrates how to use the sample function

CreateUnboundObjectFrame() to create an unbound object frame using a

DoMenuItem action:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

1. Create a new module, and enter the following:

      Function CreateUnboundObjectFrame (ByVal sFormName$, _

                                         ByVal sObjectPath$)

         A_FORMDESIGNBAR = 3

         A_INSERTOBJECT = 10

         DoCmd SelectObject A_FORM, sFormName

         SendKeys "%f" & sObjectPath & "{ENTER}"

         DoCmd DoMenuItem A_FORMDESIGNBAR, A_EDIT, A_INSERTOBJECT

      End Function

2. Create a new, unbound form. Save the form as Chess.

3. With the form open, select the Database window.

4. Create a new module.

5. In the module's Immediate window, type the following, and then press

   ENTER:

      ? CreateUnboundOjbectFrame("Chess", "c:\windows\chess.bmp")

NOTE: This example assumes that the CHESS.BMP file supplied with Microsoft

Windows is located in the C:\WINDOWS directory.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Create a new, unbound form. Save the form as CreateControlTest.

2. With the form open, select the Database window.

3. Create a new module. Enter the following sample function:

      Function CreateUnboundObjectFrame ()

         Dim C As Control

         Set C = CreateControl("CreateControlTest", 114)

      End Function

4. In the module's Immediate window, type the following, and then press

   ENTER:

      ? CreateUnboundObjectFrame()

5. View the CreateControlTest form in Form view. The following error

   message will occur:

      An error has occurred in your application. If you choose Ignore, you

      should save your work in a new file. If you choose Close, your

      application will terminate.

If you choose Close or Ignore several times, the following error message

will occur:

   MSACCESS caused a General Protection Fault in module MSACCESS.EXE at

   0096:50B6.

REFERENCES

==========

Microsoft Access "The Secrets of AccessWizards," pages 12-14

Microsoft Access "Language Reference," pages 151-152 and 433-434

Additional reference words: 1.00 1.10 ADK GPF


PRB: CanGrow or CanShrink Problems in Report Header or Footer

 Article Number: Q104756

 CREATED: 28-SEP-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

If you paste an existing text box control that has its CanGrow or

CanShrink property set to Yes to a report header or footer, the header or

footer will not change as needed.

RESOLUTION

Instead of cutting or copying and then pasting the control into the

report header or footer, drag the existing control to the header or

footer.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new bound or unbound report.

2. Place a text box in the report's detail section.

3. Select the text box, and then set its CanGrow property to Yes.

4. From the Layout menu, choose Report Hdr/Ftr.

5. Select the text box, and then choose Copy from the Edit menu.

6. Select the report header or footer.

7. From the Edit menu, choose Paste.

8. Select the text box in the header or footer. Note that the CanGrow

   property is set to No.

Note that this situation applies to group headers and group footers as

well.


PRA: Reserved Error -1001 with Linked Crosstab Subreport

 Article Number: Q104758

 CREATED: 28-SEP-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.1 and 2.0

---------------------------------------------------------------------

SYMPTOMS

You receive the following error message when you are printing or previewing

a report:

   The crosstab query underlying a subform or subreport must have fixed

   column headings (Microsoft Access version 2.0)

   -or-

   Reserved error (-1001); there is no message for this error (Microsoft

   Access version 1.1)

CAUSE

A main report with a bound subreport that is based on a crosstab query

cannot be previewed or printed unless the crosstab query uses fixed column

headings.

RESOLUTION

Add fixed column headings to the crosstab query's properties:

In Microsoft Access version 2.0, with the crosstab query in Design view,

choose Query Properties from the View menu. In the ColumnHeadings property,

type the column headings for your query.

In Microsoft Access version 1.1, with the crosstab query in Design view,

choose Query Properties from the View menu. In the FixedColumnHeadings

property, type the column headings for your query.

Another workaround is to delete the LinkChildFields and LinkMasterFields

properties of the subreport. You will then be able to run your report, but

the report will show every record in the subreport.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB.

2. Create a crosstab query based on the Employees table. Save the

   query as Employee Crosstab.

      Query: Employee Crosstab

      ------------------------

      Type: Crosstab Query

      Field: Last Name

         Total: Group By

         Crosstab: Row Heading

      Field: Birth Date

         Total: Group By

         Crosstab: Column Heading

      Field: Reports To

         Total: Sum

         Crosstab: Value

3. Using the Single-Column ReportWizard, create a new report based on

   the Employee Crosstab query. Include all the query fields in your

   report, and sort by the Last Name field. Save the report as

   Employee Crosstab SubReport.

4. Using the Single-Column ReportWizard, create another new report

   based on the Employee Crosstab query. Include only the Last Name

   field in this report, and sort by the Last Name field. Save this

   report as Employee Main Report.

5. Embed the Employee Crosstab SubReport in the detail section of the

   Employee Main Report. You can do this by dragging the subreport

   from the Database window to the detail section of the main report

   (which must be in Design view).

6. In Design view of the main report, view the Properties sheet for

   the Employee Crosstab SubReport. Verify that the LinkChildFields

   and LinkMasterFields properties are set to Last Name.

7. Try to preview or print the Employee main report. You will receive

   the error message stated above.

Additional reference words: 1.10 2.00


PRA: Report Prompts Twice for Same Parameter Value

 Article Number: Q104759

 CREATED: 28-SEP-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You are prompted twice for the same parameter value when you run a report

that contains a subreport that is based on a parameter query.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

If a subreport that is based on a parameter query that takes one parameter

from the user is placed in the detail section of an unbound main report,

the report will prompt the user twice for the same parameter value. Note

that the same problem occurs with forms and subforms.

Steps to Reproduce Problem

--------------------------

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. Create a parameter query based on the Categories table. Save the query

   as CategoryQuery:

      Query:  CategoryQuery

      ---------------------

      Field: Category ID

         Criteria: [Enter Category Id]

      Field: Category Name

3. Use the ReportWizard to create a report based on the CategoryQuery

   query. Save this report as MySubReport.

4. Create a new unbound report. Drag the MySubReport report to the detail

   section of the new report.

5. From the File menu, choose Print Preview.

Note that the report asks for the same parameter value twice.

Additional reference words: 1.00 1.10


INF: Sample Macro to Reset Page Number on Group Level Report

 Article Number: Q104760

 CREATED: 28-SEP-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

It is possible, using macro and report section properties, to design a

report that breaks the page for each new entry in a group and resets

the report page number. For example, the "List of Products by Category"

report in the sample database NWIND.MDB could be redesigned to break

the page for each new category and reset the page number to 1.

MORE INFORMATION

1. Create the following macro:

      Macro Name   Action

      ---------------------------------

      Pager        SetValue

      Macro Action Arguments

      ---------------------------------

      SetValue

         Item: Page

         Expression: 1

2. In the sample database NWIND.MDB, open the "List of Products by

   Category" report in Design view.

3. Select the Category Name header section and assign the Pager macro

   to the OnFormat property.

4. Select the Category Name header section and set the ForceNewPage

   property to Before Section.

Each category will now begin on a new page and the numbering of these

new pages will all begin with the number 1. In the Products table,

there currently are not enough records in each category to require

more than one page. However, if the Detail section of the "List of

Products by Category" report was enlarged to 1 inch, several of the

categories would require two pages and their page numbers would

continue to increase until the next category occurs.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 23, "Using Macros to

Print Reports or Transfer Data," pages 571-572

Microsoft Access "User's Guide," version 2.0, Chapter 26, "Using Macros to

Print Reports or Transfer Data"

Additional reference words: 1.00 1.10 2.00


PRA: Text Not Replaced in All Modules with Replace All

 Article Number: Q104822

 CREATED: 29-SEP-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you use the Replace All command to replace a text string in all

modules of the open database, the text strings in some modules are not

replaced. The text strings are replaced only in modules that were opened

before you chose the Replace All command.

RESOLUTION

Open all the modules in which you want to replace text strings before

choosing the Replace All command.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Start Microsoft Access and create a new module.

2. Type the following in the Declarations section:

      'REPLACETEXT

3. Save the Module as Module1, and then close it.

4. Create another new module. Repeat step 2.

5. From the Edit menu, choose Replace.

6. Type REPLACETEXT in the Find What field. Type TEST in the Replace With

   field. Select All Modules in the Search box, and then choose Replace

   All.

7. Close the database. Save Module2 when prompted to by Microsoft Access.

8. Reopen the database and open Module1. Note that 'REPLACETEXT was not

   changed to 'TEST.

Additional reference words: 1.00 1.10 UI changing


INF: Using Find Method to Find a Quotation Mark or Apostrophe

 Article Number: Q104823

 CREATED: 29-SEP-1993

 MODIFIED: 02-DEC-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SUMMARY

This article demonstrates how to use the Find method to search for text

strings containing a quotation mark (") or an apostrophe ('). Searching for

text strings containing these characters requires special syntax because

the quotation mark and the apostrophe are used as delimiters in Access

Basic.

MORE INFORMATION

NOTE: This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual.

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating these code

examples in Access Basic.

How to Find an Apostrophe

-------------------------

The following example uses the Customers table in the sample database

NWIND.MDB. Several company names in this table include apostrophes (for

example, Babu Ji's Exports).

To find a specific company, you would normally use the following syntax:

   Function FindaPost1 ()

      Dim MyDB As Database, MyDynaset As Dynaset

      Set MyDB = CurrentDB()

      Set MyDynaset = MyDB.CreateDynaset("customers")

      'Find this company

      MyDynaset.FindFirst "[company name]='Around the Horn'"

      If Not MyDynaset.nomatch Then

         MsgBox MyDynaset.[company name]

      Else

         MsgBox "No Match"

      End If

      MyDynaset.Close

   End Function

However, the following syntax will generate a syntax error because of the

apostrophe in the company name:

   Function FindaPost2 ()

      Dim MyDB As Database, MyDynaset As Dynaset

      Set MyDB = CurrentDB()

      Set MyDynaset = MyDB.CreateDynaset("customers")

      'The following line will generate an error

      MyDynaset.FindFirst "[company name]='Babu Ji's Exports'"

      If Not MyDynaset.nomatch Then

         MsgBox MyDynaset.[company name]

      Else

         MsgBox "No Match"

      End If

      MyDynaset.Close

   End Function

To search for a company name that includes an apostrophe, replace the

single quotation marks around the company name with two sets of double

quotation marks, as in the following example:

   Function FindaPost3 ()

      Dim MyDB As Database, MyDynaset As Dynaset

      Set MyDB = CurrentDB()

      Set MyDynaset = MyDB.CreateDynaset("customers")

      'Find this company (with an apostrophe in the name)

      MyDynaset.FindFirst "[company name]=""Babu Ji's Exports"""

      If Not MyDynaset.nomatch Then

         MsgBox MyDynaset.[company name]

      Else

         MsgBox "No Match"

      End If

      MyDynaset.Close

   End Function

How to Find a Quotation Mark

----------------------------

The following example uses the Employees table in the sample database

NWIND.MDB. The Notes field for some employees contains quotation marks.

If you use the following syntax to find a string containing quotation

marks, a compile error will be generated:

   Function FindQuote1 ()

      Dim MyDB As Database, MyDynaset As Dynaset

      Set MyDB = CurrentDB()

      Set MyDynaset = MyDB.CreateDynaset("employees")

      'the following line generates a compile error

      MyDynaset.FindFirst "[notes] like '*"The art of the cold_

              call."*'"

      If Not MyDynaset.nomatch Then

          MsgBox MyDynaset.[Last Name]

      Else

          MsgBox "No Match"

      End If

      MyDynaset.Close

   End Function

To search for an item containing quotation marks, concatenate Chr(34) with

the quotation marks, as in the following example:

   Function FindQuote2 ()

      Dim MyDB As Database, MyDynaset As Dynaset

      Set MyDB = CurrentDB()

      Set MyDynaset = MyDB.CreateDynaset("employees")

      'find this note that contains a quote

      MyDynaset.FindFirst "[notes] like '*" & Chr(34) & "The art of_

              the cold call." & Chr(34) & "*'"

      If Not MyDynaset.nomatch Then

          MsgBox MyDynaset.[Last Name]

      Else

          MsgBox "No Match"

      End If

      MyDynaset.Close

   End Function

For more information on the Find method, search for "find method" then

"find method" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10


PRA: Control Still Appears on Page After GotoPage Action

 Article Number: Q104825

 CREATED: 29-SEP-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

After the GotoPage macro action runs and a new page is displayed, the

contents of the last control on the source page still appear on the new

page.

CAUSE

The GotoPage macro action was run from a macro that is attached to the

AfterUpdate property of a control.

RESOLUTION

Do not include a GotoPage macro action in a macro attached to the

AfterUpdate property of a control. Instead, use the GotoPage action in

a macro attached to the control's OnExit property.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Create a new macro with the following action, and then save it with the

   name GotoPage2:

      GotoPage

         PageNumber: 2

2. Create a new, unbound form.

3. Size the detail section of the form to be 4 inches tall.

4. Place a page break control in the form's detail section at the vertical

   2-inch mark.

5. Place a combo box with the following properties in the upper half of the

   detail section, above the page break control:

      RowSourceType: Value list

      RowSource: 1;2;3;4

      AfterUpdate: GotoPage2

6. Place a text box in the lower half of the form's detail section, below

   the page break control.

7. Size the Form window so that only the upper half of the detail section

   is visible.

8. View the form in Form view.

9. Make a selection in the combo box.

The form will advance to page 2, and the text box will be selected, as it

should be. However, the combo box will still be visible on the page and may

overlap the text box.

Additional reference words: 1.00 1.10 gotocontrol ghost


PRB: Error Message "Can't Group on Fields Selected with '*'"

 Article Number: Q104826

 CREATED: 29-SEP-1993

 MODIFIED: 02-DEC-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

When you run a crosstab query you receive the error message

   Can't group on fields selected with '*'

even though there is no asterisk in the SQL code or the query grid.

CAUSE

This problem is caused when you run a crosstab query and the Restrict

Available Fields option has been cleared in the Query Properties box. This

option is not allowed in a crosstab query.

RESOLUTION

The following steps describe how to correct a crosstab query that generates

the error message stated above:

1. Open the query in Design view.

2. From the Query menu, choose Select.

3. From the View menu, choose Query Properties.

4. Select the Restrict Available Fields option, and then choose OK.

5. From the Query menu, choose Crosstab.

6. Save the query.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB.

2. Create a new query based on the Order Review query, as follows:

      Query: Crosstab with Row Totals

      -------------------------------

      Field: Company Name

         Total: Group By

      Field: Ship Via

         Total: Group By

      Field: Order Amount

         Total: Sum

3. From the View menu, choose Query Properties.

4. Clear the Restrict Available Fields check box, and then choose OK.

5. From the Query menu, select Crosstab.

6. In the query grid, set the crosstab property for each field:

      Field: Company Name

         Crosstab: Row Heading

      Field: Ship Via

         Crosstab: Column Heading

      Field: Order Amount

         Crosstab: Value

7. Run the query. The error message stated above will appear.

Additional reference words: 1.00 1.10


PRA: Database Corruption Message After Large Append

 Article Number: Q104827

 CREATED: 29-SEP-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

------------------------------------------------------------

---------

SYMPTOMS

Running a large append query or importing a large number of

records into an

existing table results in the error message:

   '|' is corrupt or isn't a Microsoft Access database

CAUSE

This error occurs if, while you are inserting keys into an

index, Microsoft

Access runs out of the memory it has allocated to keep track

of a table's

indexes.

When this memory space is completely filled, Microsoft

Access cannot

proceed with the append, and it cannot discard the new

information that has

been temporarily stored. Microsoft Access knows that the

task has not been

completed successfully, and assumes that the database is

corrupt. However,

because nothing was actually written to the database, the

data is not

damaged. You can compact the database to make the data

usable again.

RESOLUTION

To carry out a large append, remove the table's indexes,

complete the

append, and then add the indexes again. Be sure not to

remove the primary

key if it is a Counter, because you could encounter the 4-MB

transaction

limit when you attempt to add the Counter key back to the

table.

STATUS

Microsoft has confirmed this to be a problem in Microsoft

Access versions

1.0 and 1.1. We are researching this problem and will post

new information

here in the Microsoft Knowledge Base as it becomes

available.

Additional reference words: 1.00 1.10 pagedescriptors


INF: Using Indexes in Microsoft Access

 Article Number: Q104828

 CREATED: 29-SEP-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article discusses how and when Microsoft Access uses indexes. This

information is provided to assist you in designing tables, indexes, and

queries that can be executed quickly.

MORE INFORMATION

This article is divided into three parts, as follows:

1. General Information (storage of Microsoft Access tables and indexes)

2. Rules and Limitations (when indexes can be used)

3. Examples (example queries and their associated indexes)

GENERAL INFORMATION

===================

Table Storage

-------------

Microsoft Access stores information in 2K pages. Each table is made up

of a 2K header page and as many 2K data pages as are needed to store

the data in the table. Records are placed in a table in the order in

which they are entered.

Index Storage

-------------

Indexes are also stored in 2K pages. Each index consists of a header

page and leaf pages. Leaf pages contain a key generated from the value

of the field that is indexed and a pointer to the 2K page on which

that record resides.

Table Statistics

----------------

Microsoft Access maintains information on the approximate number of

records in each table and the number of data pages on which that table

resides. This information is used to determine the most effective

way to locate or retrieve data in a table.

Query Optimization

------------------

The process of determining the fastest method to access data is called

query optimization. Records in a single table can be retrieved using a

base table scan or an indexed search, as described below:

Base Table Scan:

A base table scan involves reading each record in the table and

determining whether or not it matches the criteria.

The drawback to this method is that each 2K data page must be loaded

into memory and then each record examined. However, when the query

includes most of the data in the table, or at least one record each

from a majority of the data pages, a base table scan can be faster

than an indexed search.

Indexed Search:

When an index is used, Microsoft Access searches the index for the

first occurrence of the specified data and then loads into memory the

2K data page that contains the record to which the index points.

The drawback to this method is that both index pages and data pages

must be loaded and read. In addition, an entire 2K page must be loaded

into memory for each record reference by the index. However, when the


PRA: Crosstab Query with DLL Reference Fails VERSION(S):


PRA: Use Shift+F4 Not Edit Find Next to Refresh Display

 Article Number: Q104915

 CREATED: 03-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

You cannot see the text that was found when you chose either the Find Next

or Replace Next command.

CAUSE

The control that holds the text is not large enough to display all the

found text. The prior found text is scrolled out of view by Microsoft

Access without scrolling the next found text into view.

RESOLUTION

Instead of choosing the Find Next or Replace Next command, close the dialog

box and use the SHIFT+F4 key combination to find the next occurrence of the

text.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Create a new form.

2. Create a new, unbound text box with the default width and height on the

   form.

3. Set the ControlSource property of the text box to:

      ="This is a test. This is a test. This is a test."

4. From the View menu, choose Form.

5. From the Edit menu, choose Find.

6. Type "test" (without the quotation marks) in the Find What box.

7. Select Any Part Of Field in the Where box.

8. Choose Find Next. Note that the first instance of the text "test" is

   correctly found and selected.

9. Choose Find Next. The next occurrence is found, but you cannot see it

   because it is scrolled out of view.

Additional reference words: 1.00 1.10


INF: Using Data from MS Access in a WordPerfect Mail Merge

 Article Number: Q104916

 CREATED: 03-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - WordPerfect for DOS, versions 5.1 and 6.0

 - WordPerfect for Windows, versions 5.1 and 5.2

---------------------------------------------------------------------

SUMMARY

The following information describes how to use data contained in a

Microsoft Access database to perform a mail merge in WordPerfect for

DOS and WordPerfect for Windows.

MORE INFORMATION

WordPerfect for Windows and WordPerfect for DOS cannot read data from

Microsoft Access in its native format. To use data from a Microsoft

Access database in a WordPerfect mail merge, the data must first be

exported from Microsoft Access in a format that WordPerfect recognizes

as a valid mail merge data file (also called a "secondary file").

The following information discusses how to export data from Microsoft

Access for use in a WordPerfect mail merge. Further, information is

provided to demonstrate how to perform a simple mail merge with the

exported data in WordPerfect for DOS and WordPerfect for Windows.

Exporting Data from Microsoft Access for Use in WordPerfect

-----------------------------------------------------------

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. From the File menu, choose Export.

3. From the Data Destination list, select Text (Delimited), dBASE III or

   dBASE IV and then choose OK.

4. Select Customers and then choose OK.

   TIP: If you are not using Microsoft Access version 2.0, you can export

   data from a query to a delimited text file directly. For more

   information about this method, query on the following words here in the

   Microsoft Knowledge Base:

      export and query and text and file

5. In the File Name box, type the name that you want for the exported file.

   In the Directories box, select the directory that you want the file

   to be placed in. You may want to place the file in your WordPerfect

   directory.

6. If you selected the Text (Delimited) data destination, the Export Text

   Options will appear. Choose Options to see an expanded list of

   export options.

7. In the Text Delimiter box, select {none}.

8. In the Field Separator box, select {tab}.

   TIP: If you plan to regularly export data to WordPerfect, consider

   saving these Export Text Options with a specification name to prevent

   having to manually specify these options each time. A specification can

   be used with the TransferText macro action to automate the export

   process further. See the Microsoft Access "User's Guide" for more

   information on using export specifications and the TransferText macro

   action.

9. Choose the OK button. Microsoft Access begins the export process,

   placing the data in the file specified in step 5.

Performing a WordPerfect Mail Merge with Microsoft Access Data

--------------------------------------------------------------

A WordPerfect merge is the process of combining information from two

documents: a "primary file" (or form file) and a "secondary file" (or

data file) to create a single document.

The primary file, which is typically a form letter, is used to direct

the merging process. The secondary file contains records of

information, typically names and addresses, used to fill in places in

the primary file. The primary file contains placeholders (fields) that

indicate where specific information, such as a first name or an

address, from the secondary file should be merged in.

The placeholders appear in the primary file starting with {FIELD}

followed by a number indicating which field in the secondary file to

use. The placeholder ends with a tilde character (~). For example,

{FIELD}2~ would be the placeholder for the second field in the

secondary data file. In the CUSTOMER.TXT file exported earlier, this

is the Company Name field.

NOTE: In WordPerfect version 6.0 for DOS the field looks like FIELD(2).

The fields appear in the secondary file in the same order as they

appear in Microsoft Access. The fields in the Customers table in the

NWIND database are ordered as follows:

   1. Customer ID

   2. Company Name

   3. Contact Name

   4. Contact Title

   5. Address

   6. City

   7. Region

   8. Postal Code

   9. Country

  10. Phone

  11. Fax

Creating the WordPerfect Primary Form File

------------------------------------------

WordPerfect 5.1 for DOS:

1. Press F7, No, and then No again to create a new WordPerfect

   document.

2. Press SHIFT+F9, then press 1 (or F) for Field.

3. At the Enter Field: prompt, type the number indicating the field

   you want to reference from the secondary data file, then press ENTER.

4. Repeat steps 2 and 3 to create the following primary file:

      {FIELD}2~

      {FIELD}3~

      {FIELD}5~

      {FIELD}6~, {FIELD}7~ {FIELD}8~

      Dear {FIELD}3~,

      Thank you for your inquiry regarding Northwind Trader products...

      Sincerely,

      Andrew Fuller

      Vice President, Sales

5. Press F10. At the Document To Be Saved: prompt, type "PRIMARY.DOC"

   (without the quotation marks) and press ENTER.

WordPerfect 6.0 for DOS:

1. From the File menu, choose New to create a new WordPerfect

   document.

2. From the Tools menu, choose Merge, then choose Define.

3. Press 1 (or F) to choose Form and press OK.

4. The Merge Codes (Form File) dialog box is now displayed. Choose OK.

5. At the Field: prompt, type the number indicating the field you want

   to reference from the secondary data file, then press ENTER.

6. Repeat steps 2 and 3 to create the following primary form file:

      FIELD(2)

      FIELD(3)

      FIELD(5)

      FIELD(6), FIELD(7) FIELD(8)

      Dear FIELD(3),

      Thank you for your inquiry regarding Northwind Trader products...

      Sincerely,

      Andrew Fuller

      Vice President, Sales

7. From the File menu, choose Save As, type "PRIMARY.DOC" (without the

   quotation marks) in the Filename: box and then press ENTER.

WordPerfect 5.x for Windows:

1. From the File menu, choose New to create a new WordPerfect

   document.

2. From the Tools menu, choose Merge (CTRL+F12), then choose Field.

3. In the Insert Merge Code dialog box, type the number indicating the

   field you want to reference in the secondary file, then choose the OK

   button.

4. Repeat steps 2 and 3 to create the following primary file:

      {FIELD}2~

      {FIELD}3~

      {FIELD}5~

      {FIELD}6~, {FIELD}7~ {FIELD}8~

      Dear {FIELD}3~,

      Thank you for your inquiry regarding Northwind Trader products...

      Sincerely,

      Andrew Fuller

      Vice President, Sales

5. From the File menu, choose Save As, type "PRIMARY.DOC" (without the

   quotation marks) in the Save As box, and choose the Save button.

Merging the Primary and Secondary Files in WordPerfect

------------------------------------------------------

WordPerfect 5.1 for DOS:

 1. Press F7, No, then No again.

 2. Press CTRL+F9, then press 1 (or M) for Merge.

 3. Type "PRIMARY.DOC" (without the quotation marks) at the Primary

    file: prompt and press ENTER.

 4. When the prompt for the secondary file appears, press CTRL+F5 to

    activate the DOS Text Delimited File: prompt.

 5. Type "CUSTOMER.TXT" (without the quotation marks) and press ENTER.

    The Merge: DOS Text File menu screen is activated.

 6. Choose 1 (or F) for Field delimiters.

 7. At the Begin prompt, delete any contents that appear then press the

    DOWN ARROW key.

 8. At the End prompt, press the TAB key so that [Tab] appears, then

    press the DOWN ARROW key.

 9. Choose 2 (or R) for Record delimiters.

10. At the Begin prompt, delete any contents that appear, then press

    the DOWN ARROW key.

11. At the End prompt, press CTRL+M so that [CR] appears, then press

    the DOWN ARROW key.

12. Press ENTER to begin the merge.

WordPerfect 6.0 for DOS:

1. From the File menu, choose New.

2. From the Tools menu, choose Merge, then choose Run. The Run Merge

   dialog box appears.

3. Type "PRIMARY.DOC" (without the quotation marks) in the Form File:

   box.

4. Type "CUSTOMER.TXT" (without the quotation marks) in the Data File:

   box.

   NOTE: You may want to include the full drive and path with the file

   names in the Primary and Secondary File boxes if these files are not

   located in the WordPerfect directory.

5. Select DOS Delimited Text from the File Format list and choose the

   Select button. The Delimited Text Options dialog box appears.

6. Choose 1 (or F) for Field Delimiter:, press F5, select Tab, then

   press the DOWN ARROW key. ([Tab] should now appear in the box.)

7. In the Record Delimiter: field, make sure the selected value is

   [CR][LF]. Press F5 and select these items from the list if needed.

   Press the DOWN ARROW key.

8. In the Field Encapsulate Character: box, delete any entry and

   press the DOWN ARROW key until the OK button is selected.

   NOTE: You may want to select the Save Setup Options check box if you

   intend to merge on a regular basis to avoid having to reset these

   settings in the future.

9. Press the OK button, then press the Merge button to begin the

   merge.

WordPerfect 5.x for Windows:

1. From the File menu, choose New.

2. From the Tools menu, choose Merge, then choose Merge again. The

   Merge dialog box appears.

3. Type "PRIMARY.DOC" (without the quotation marks) in the Primary

   File: box.

4. Type "CUSTOMER.TXT" (without the quotation marks) in the Secondary

   File: box.

   NOTE: You may want to include the full drive and path with the file

   names in the Primary and Secondary File boxes if these files are not

   located in the WordPerfect directory.

5. Check the ASCII Delimited Text (DOS) check box, or press ALT+A.

6. Choose the OK button. The Text File Delimiters dialog box appears.

7. Under Field Delimiters, leave the Begin: box empty. In the End:

   box, delete the current contents and choose [TAB] from the list that

   appears pressing the "<" button located immediately to the right of

   the End: box.

8. Under Record Delimiters, leave the Begin: box empty. In the End:

   box, delete the current contents and choose [CR] from the list that

   appears pressing the "<" button located immediately to the right of

   the End: box.

9. Choose the OK button to begin the merge.

REFERENCES

==========

Microsoft Access "User's Guide," version 2.0, chapter 9

Microsoft Access "User's Guide," version 1.x, chapter 4

"WordPerfect for DOS Reference," version 5.1, pages 420-431

"WordPerfect for DOS Workbook," version 5.1, pages 237-246

"WordPerfect for DOS Reference," version 6.0, pages 412-432

"WordPerfect for DOS Workbook," version 6.0, pages 195-204

"WordPerfect for Windows Reference," version 5.1, pages 300-308

"WordPerfect for Windows Workbook," version 5.1, pages 203-210

Additional reference words: 1.00 1.10 2.00 WP51 WPWIN print merge


PRB: Validation Rules Evaluate Expressions in Unexpected Ways

 Article Number: Q104972

 CREATED: 04-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Microsoft Access evaluates expressions with logical operators differently

than you expect. For example, entering zero in a field with the validation

rule "=true and not true" produces the error message:

   The value you entered is prohibited by the validation rule set for

   this field.

CAUSE

Microsoft Access evaluates expressions in parts, and compares each part to

the value in the field being validated. The expression "=true and not true"

is evaluated as:

   Field=True AND Field<>True

This results in the error message stated above if you enter zero in the

field because the validation fails.

RESOLUTION

Use parentheses in the expression to change the way it is evaluated. The

correct syntax for the example above is:

   =(True AND NOT True)

Microsoft Access will interpret this expression as:

   Field=(True AND NOT True)

Zero is an acceptable value for a field with the above validation rule.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open a new, blank form in Design view.

2. Add a text box with the following validation rule to the form:

      Text box: Field1

         Validation rule: =True and not True

3. View the form in Form view.

4. Enter a zero in the text box and then press ENTER. An error message will

   occur.

Additional reference words: 1.00 1.10 2.00 Boolean bitwise math


PRB: DateDiff() Function Returns Incorrect Value

 Article Number: Q104973

 CREATED: 04-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you use the DateDiff() function on a large interval where the time

periods are specified in minutes or seconds, the result is not correct.

CAUSE

The DateDiff() function returns a long integer. If the result is greater

than the allowed range for long integers (-2,147,483,648 to 2,147,483,647),

Microsoft Access truncates the value and returns the truncated value.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new module. Enter the following in the module's Immediate

   window, and then press ENTER:

      ? DateDiff("n",#12-31-100#,#12-31-9999#)

   The returned value, 911,403,103 minutes, is truncated because the actual

   value exceeds 2,147,483,647.

2. Enter the following calculation, which is equivalent to the function

   above, and then press ENTER:

      x=#12-31-100#

      y=#12-31-9999#

      ? (y-x)*24*60

   The returned value, 5,206,370,400 minutes, is correct. Note that

   Microsoft Access uses double-precision real numbers when doing immediate

   calculations.

Additional reference words: 1.00 1.10 2.00 date


PRB: Size To Fit Form Command Does Not Size Form Properly

 Article Number: Q104974

 CREATED: 04-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you choose the Size To Fit Form command to size a window to fit a form

bound to a table or query, the window does not size to fit the form

correctly.

CAUSE

The form's DefaultView property is set to Continuous Forms.

RESOLUTION

Change the form's DefaultView property to Single Form, and then choose the

Size To Fit Form command again.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create a new, blank form bound to the Categories table.

3. Create a bound text box based on the Category Name field.

4. From the View menu, choose Form. The Form window shows several forms.

5. From the Window menu, choose Size To Fit Form. The window reduces in

   size, but still displays several forms.

Additional reference words: 1.00 1.10 2.00


PRB: Typing in Combo Box Does Not Select Item

 Article Number: Q104975

 CREATED: 04-OCT-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Typing a value in a combo box does not automatically select that value in

the combo box.

CAUSE

The LimitToList property of the combo box is set to No.

RESOLUTION

Change the LimitToList property of the combo box to Yes.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

The LimitToList property determines if a combo box can accept new items. If

the property is set to No, characters typed in the combo box cannot be used

to select a list item because Microsoft Access does not know if you are

entering a new value or want an existing value from the combo box.

If the LimitToList property is set to Yes, the combo box cannot accept new

values. This enables Microsoft Access to use the characters you type for

selecting a list item.

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Open the Suppliers form in Design view.

3. Select the combo box at the bottom of the form.

      Object: Combo box

      -----------------

      ControlName: Company Pick List

         RowSourceType: Table/Query

         RowSource: Supplier List

         LimitToList: Yes

4. Set the LimitToList property to No.

5. View the form in Form view.

6. Click the arrow beside the combo box to open the combo box.

7. Begin typing "Bigfoot Breweries" (without the quotation marks) and note

   that Bigfoot Breweries is not automatically selected until the last

   character is typed.

REFERENCES

==========

For more information on properties, search for "property sheet" then

"property sheet" using the Microsoft Help menu.

Microsoft Access "User's Guide," version 1.0, Chapter 9, "Designing Forms,"

pages 244-245

Additional reference words: 1.00 1.10 combobox spell limit list UI


PRB: "Change Default" Allowed with Multiple Items Selected

 Article Number: Q104976

 CREATED: 04-OCT-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The Change Default command on the Layout menu (or the Format menu, in

version 2.0) is available even though you have selected multiple controls.

CAUSE

If the controls selected are all of the same type, Microsoft Access will

use either the last control placed on the form or report, or the last

control selected for the default settings.

RESOLUTION

When you are changing the default for many controls at once, select only

one of each type of control before choosing the Change Default command.

MORE INFORMATION

NOTE: You can select multiple controls by holding down the SHIFT key and

clicking on the controls that you want to select, or by dragging the mouse

pointer over controls grouped together.

Steps to Reproduce Behavior

---------------------------

1. Create a blank, unbound form.

2. Add three text boxes to the form.

3. From the View menu, choose Palette.

4. Change the colors of the three text boxes to red, blue, and yellow using

   the fill colors on the palette.

5. Select all three text boxes.

6. From the Layout menu (Format menu if you are using Microsoft Access

   version 2.0), choose Change Default.

7. Add a fourth text box to the form.

The new text box will default to the color of the last control you selected

in step 4.

Additional reference words: 1.00 1.10 2.00


INF: Conversion of Oracle Data Types to Microsoft Access

 Article Number: Q104977

 CREATED: 04-OCT-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Column, or field, data types are different for each database management

system. This means that when you are accessing table structures from other

database management systems, a conversion, or data type mapping, must

occur. This article describes the data type mapping between Oracle and

Microsoft Access data types.

MORE INFORMATION

The following table demonstrates data type mapping between Oracle and

Microsoft Access data types:

Oracle data type      Maps to Microsoft Access data type

--------------------------------------------------------

Char(n)               Text(n)

VarChar(n)            Text(n)

Long                  Memo

Date                  Date/Time

Long Raw              Ole Object

Float                 Double

RowID                 Text(18)

Smallint              Text(255)

Note that the Smallint data type is the same as an Oracle data type of

Number(38,0).

accessible

at

In Oracle, the creator of the table can define the precision (the total

number of digits) and scale (the number of digits to the right of the

decimal point) for columns with Number data types. If a Number data type is

specified without a precision or scale, the column defaults to a data type

of Number(9,2). The scale limit is 38, and a scale without a precision is

allowed. Values with different precisions and scales are mapped as below:

Oracle number            Microsoft Access data type

---------------------------------------------------

Scale = 0 and

     precision <= 4      Integer

     precision <= 9      Long Integer

     precision <= 15     Double

Scale > 0 and  <= 4

     precision <= 15     Double

Scale > 4 and/or

     precision > 15      Text

If an Oracle data type is defined with a precision and scale that does not

map to any data type in Microsoft Access, it will be mapped to a text data

type. For example, an Oracle Smallint data type, which is actually a

Number(38,0) data type, will map into Microsoft Access as a text data type

since Microsoft Access does not have a number value of 38 precision.

Additional reference words: 1.00 1.10 2.00 ADK


PRA: Minimize MS Access with Cue Cards, System Hangs

 Article Number: Q104978

 CREATED: 04-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you are running Microsoft Access Cue Cards in Microsoft Windows

for Workgroups, your computer hangs when you attempt to minimize

Microsoft Access after starting another application.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

This problem occurs only under the following conditions:

 - Microsoft Access is running under Microsoft Windows for Workgroups.

 - You choose only the Minimize button in Microsoft Access. If you

   click anywhere else in the Microsoft Access database window, the

   problem does not occur.

Steps to Reproduce Problem

--------------------------

1. Start Microsoft Access.

2. Start a Cue Cards topic, such as "Build a database with tables,"

   by choosing Cue Cards from the Help menu and choosing the

   appropriate Cue Card topic.

3. At any gray screen in Cue Cards, switch to Program Manager by

   pressing CTRL+ESC or ALT+ESC, then start Calculator or any other

   application.

4. Minimize Microsoft Access by choosing the Minimize button.

   Result: Your computer hangs.

Additional reference words: 1.00 1.10 UI Hung Stopped Frozen Freezes


INF: How to Use a Main/Subform with Attached SQL Server Tables

 Article Number: Q104979

 CREATED: 04-OCT-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.1

---------------------------------------------------------------------

SUMMARY

When you are using a main/subform and the RecordSource properties of

both forms are attached SQL Server tables, performance is reduced. The

select syntax is sent to ODBC as a parameter query, in which the data

types of the linked fields are not known.

MORE INFORMATION

Using a main/subform with attached SQL Server tables results in a

parameter query for the subform's RecordSource property. All fields in

which the linked field of the subform is equal to the linked field in

the main form are selected for the subform. Parameter queries based on

attached ODBC tables run slowly when the data type of the field in the

WHERE clause is unknown.

To work around this problem, use the following procedure:

NOTE: The following example is based on the sample database NWIND.MDB,

in which the Employees and Orders tables are exported, attached, SQL

Server tables. The main form is called frmMain and the subform is

called frmSub. The linked field is Employee_ID. This example also

assumes that the RecordSource properties of the two forms are the

Employees and Orders tables, respectively.

1. Delete the Employee_ID field name in the LinkChildFields and

   LinkMasterFields properties of the subform control on the main

   form.

2. Create a query based on the attached Orders table. Specify

   Forms!frmMain!Employee_ID as the criteria of the linked field.

3. Switch to Design view. From the Query menu, choose Parameters.

4. Specify the query parameter as Forms!frmMain!Employee_ID and the

   data type as Long Integer.

5. Change the RecordSource property of the subform to reflect your new

   query.

   The main/subform behaves the same as before, except that the

   subform's query and the control on the main form maintain the link

   through a parameter query.

These concepts apply to any form where the subform is based on an

attached ODBC table.

REFERENCES


PRA: Group Footer Controls Calculate Twice at Page Break

 Article Number: Q104980

 CREATED: 04-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

A group footer control that references a calculated detail control

returns incorrect results if the page break and group break occur at

the same time. The group footer control is off by the value of the

last detail record.

CAUSE

Reference to a control with the RunningSum property applied from a

higher-level group footer causes the control's value to be added again

for the last cached running sum and to return incorrect data. All

cached field values are validated when you advance the page; this

occurs before the record is advanced, determining the end of the

group. Thus, the last record in a group is added twice.

RESOLUTION

From the OnPrint event of the Detail section, call a macro that uses

the SetValue action to place the detail control's value in an unbound

group footer control.

The Detail section has the following OnPrint properties and control:

   OnPrint: Macro1

   ControlName: DetailTotal

      RunningSum: OverGroup

The Group Footer section has the following unbound control:

   ControlName: FooterTotal

   ControlSource: <blank>

Macro1 is called from the OnPrint event of the Detail section and has

the following action:

    SetValue

       Item=[FooterTotal]

       Expression=[DetailTotal]

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Create a grouping report.

2. Locate an unbound text box in the Detail section.

3. Set the ControlSource property of the text box to =1 and the

   RunningSum property to OverGroups.

4. Locate a second unbound text box in the Group Footer section.

5. Set the ControlSource property for the second text box to the

   ControlName of the first text box.

   When the last detail record for a group prints on page 1 and the

   group footer prints on page 2, the group footer control adds the

   value for the last record in the group twice.

   If the totals are derived from a user-defined function, you may be

   able to test this procedure (for instance, if the FormatCount or

   PrintCount properties of the report have been set to 2 and, if

   true, return 0 to the function). Another option may be to change

   the data type from Variant to Double.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, page 568

Additional reference words: 1.00 1.10


PRB: Parameter Limit for Access Basic Functions in Validation

 Article Number: Q105127

 CREATED: 10-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You receive the error message "Expression Too Complex" when you are

creating a ValidationRule property for a table or control.

CAUSE

You can pass a maximum of 28 parameters to an Access Basic function when

you call the function from the ValidationRule property of a table or

control. Attempts to pass more than 28 parameters will result in the error

message stated above.

RESOLUTION

You can pass more than 28 parameters by concatenating parameters. Each

parameter will be separated by a character (for example, a semicolon).

After passing the individual parameters as one long parameter, you can

parse out the individual parameters by searching for the separator

character (the semicolon), using the InStr() and Mid() functions.

MORE INFORMATION

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

Steps to Reproduce Behavior

---------------------------

1. Open a new module and enter the following:

      '*************************************************************

      'Declarations section of the module.

      '*************************************************************

      Option Explicit

      '===============================================================

      ' The following function CanPass28 will be accepted when entered

      ' into a validation rule

      '===============================================================

      Function CanPass28 (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, _

            p, q, r, s, t, u, v, w, x, y, z, a27, b28)

         Dim Parm28, Parm29                          'These 3 lines

         Parm28 = Mid(b28, 1, InStr(b28, ";") - 1)   'explained in

         Parm29 = Mid(b28, InStr(b28, ";") + 1)      'step 5.

      End Function

      '===============================================================

      'The following function CannotPass29 will give an error message

      ' when used in a validation rule

      '===============================================================

      Function CannotPass29 (a, b, c, d, e, f, g, h, i, j, k, l, m, n, _

            o, p, q, r, s, t, u, v, w, x, y, z, a27, b28, c29)

      End Function

2. Open a new form. Add a text box to the form.

3. Enter the following expression for the ValidationRule property of the

   text box, and then press ENTER:

      -1 = CannotPass29 (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16, _

              17,18,19,20,21,22,23,24,25,26,27,28,29)

   The error message "Expression Too Complex" will occur.

4. Change the expression for the ValidationRule property to the following,

   and then press ENTER:

      -1 = CanPass28 (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16, _

              17,18,19,20,21,22,23,24,25,26,27,28)

   No error message will occur.

5. Enter the following expression, which concatenates the last two

   parameters to one parameter, for the ValidationRule property. Press

   ENTER:

      -1 = CanPass28(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16, _

              17,18,19,20,21,22,23,24,25,26,27,28&";"&29)

The last two parameters are separated inside the function by searching for

the semicolon with the following lines from the function created in step 1:

     Parm28 = Mid(b28, 1, InStr(b28, ";") - 1)

     Parm29 = Mid(b28, InStr(b28, ";") + 1)

Additional reference words: 1.00 1.10 2.00 ADK


INF: How to Use Command Line Switches

 Article Number: Q105128

 CREATED: 10-OCT-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you run Microsoft Access from Program Manager or File Manager,

you can use command line switches to modify the start up process. For

example, you can open a particular database, execute a macro, or

supply a password.

MORE INFORMATION

Microsoft Access recognizes the following command line switches:

Version 1.x Only

----------------

   /s                  Bypasses the Microsoft startup screen.

Versions 1.x and 2.0

--------------------

   <database>          Opens the specified database.

   /Excl               Opens the database for exclusive access.

   /Ro                 Opens the database for read-only access.

   /User <user name>   Starts Access using the specified user name.

   /Pwd <password>     Starts Access using the specified password.

   /X <macro>          Starts Access and runs specified macro.

   /Cmd                Specifies what value to pass to the Command

                       function in an Access Basic procedure that is

                       called by a RunCode action

                       in an AutoExec macro. This option must be the

                       last option on the command line.

Version 2.0 Only

----------------

/Ini <initialization file>    Starts Microsoft Access using the options in

                              the specified initialization file instead of

                              the standard MSACC20.INI file. The

                              initialization file must have the same

                              entries as the standard MSACC20.INI file.

/Compact <target database>    Compacts the database specified before the

                              /Compact option and then closes Microsoft

                              Access. To compact to a different name,

                              specify a target database.

/Repair                       Repairs the specified database and then

                              closes Microsoft Access.

/Convert <target database>    Converts a 1.x database to a 2.0 database,

                              with a new name, and then closes Microsoft

                              Access. Specify the source database before

                              the /Convert option.

For example, you could type the following command in the Run dialog box

(available by choosing Run from the Program Manager File menu):

   C:\ACCESS\MSACCESS.EXE NWIND.MDB /Excl /X Add Products

This sample syntax starts Microsoft Access, opens the NWIND sample

database for exclusive use, and runs the Add Products macro.

REFERENCES

==========

For more information, search for "command line" then "Starting

Microsoft Access with Command-line Options" using the Microsoft Access

Help menu.

Microsoft Windows "User's Guide," version 3.1, Chapter 2, "Application

Basics," pages 53-54

Additional reference words: 1.00 1.10 2.00


PRA: Record Count Incorrect with Multiuser Tables

 Article Number: Q105129

 CREATED: 10-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When multiple users access the same table and delete records from it,

the record count does not always accurately reflect the actual number

of records in the table.

For example, say two different users access the same table. User 1

prints a count of the number of records in the table, deletes the last

record, then closes the table. User 2 then opens the same table and

prints a count of the number of records in the table. The record count

may be the same for the two users, even though the record count

for User 2 should be one fewer than for User 1.

CAUSE

Pages are not removed from the page cache when a table is closed. When

a table is reopened, it is possible for out-of-date pages to be

present in the page cache, which can lead to inaccurate record counts.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1, and 2.0. Microsoft is researching this problem and will post new

information here in the Microsoft Knowledge Base as it becomes available.

Additional reference words: 1.00 1.10 2.00 MU Multiuser


WX0928: Microsoft Access KB Help File AppNote Contents

 Article Number: Q105380

 CREATED: 20-OCT-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SUMMARY

The disks included with the "Microsoft Access Knowledge Base Help File"

(WX0928) Application Note contain the Microsoft Access Knowledge Base Help

file. This Help file contains several hundred technical articles written by

Microsoft Product Support Services (PSS) Support Engineers and Knowledge

Base writers.

You can obtain this Application Note from the following sources:

- Microsoft Download Service (MSDL)

- Microsoft Product Support Services

For complete information, see the "To Obtain This Application Note"

section at the end of this article.

THE TEXT OF WX0928

==================

======================================================================

  Microsoft(R) Product Support Services Application Note (Text File)

           WX0928: MICROSOFT ACCESS KNOWLEDGE BASE HELP FILE

======================================================================

                                                   Revision Date: 1/94

                                                      3 Disks Included

The following information applies to Microsoft Access, versions 1.0,

and 1.1.

-----------------------------------------------------------------------

| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY     |

| ACCOMPANY THIS DOCUMENT (collectively referred to as an Application |

| Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER      |

| EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED      |

| WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR       |

| PURPOSE. The user assumes the entire risk as to the accuracy and    |

| the use of this Application Note. This Application Note may be      |

| copied and distributed subject to the following conditions:  1) All |

| text must be copied without modification and all pages must be      |

| included;  2) If software is included, all files on the disk(s)     |

| must be copied without modification (the MS-DOS(R)  utility         |

| diskcopy is appropriate for this purpose);  3) All components of    |

| this Application Note must be distributed together;  and  4) This   |

| Application Note may not be distributed for profit.                 |

|                                                                     |

| Copyright (C) 1993 Microsoft Corporation.  All Rights Reserved.     |

| Microsoft, Microsoft Access, and MS-DOS are registered trademarks   |

| and Windows is a trademark of Microsoft Corporation.                |

| CompuServe is a registered trademark of CompuServe, Inc.            |

| GEnie is a trademark of General Electric Corporation.               |

|---------------------------------------------------------------------|

INTRODUCTION

============

The disks provided with this Application Note contain ACC-KB.HLP, the

Microsoft Access Knowledge Base Help file. This Help file contains

several hundred technical articles written by Microsoft Product

Support Services (PSS) Support Engineers and Knowledge Base writers.

These articles contain helpful tips, programming examples (article

titles with the "INF" prefix), known problems in Microsoft Access

(article titles with "PRB" or "PRACC" prefixes), additional

references, question & answer scripts from the Microsoft Access

FastTips service, and recent product information not addressed in the

user documentation.

To search for articles containing a specific word or text string,

select the KB Help window and click the Find button on the toolbar.

You can always find the latest articles online on CompuServe and

GEnie. Information about how to access these electronic services is

located in the CompuServe Help topic on the first screen of the ACC-

KB.HLP file.

To install the ACC-KB.HLP file

------------------------------

1. Insert Disk 1 in your floppy disk drive.

2. At the MS-DOS command prompt, type the following and press ENTER

      xcopy <drive>:*.* <destination>

   where <drive> is the disk drive containing Disk 1 and <destination>

   is the drive and directory in which you want to install the Help

   file. For example, if you want to copy the files from drive A to

   the ACCESS directory on drive C, type:

      xcopy a:*.* c:\access\*.*

   When the files are successfully copied, the following message is

   displayed:

      2 file(s) copied.

    Caution: Copying files in this manner overwrites any existing

    files with the names BUILD.BAT and DISK1.DAT.

3. To copy the DISK2.DAT and DISK3.DAT files to the same destination,

   repeat steps 1 and 2 for Disks 2 and 3.

    Caution: Copying files in this manner overwrites any existing

    files with the names DISK2.DAT and DISK3.DAT.

4. Change the directory name to the destination directory as follows:

      cd <drive>:\<destination>

   For example, type:

      cd c:\access

5. At the MS-DOS prompt, type BUILD and press ENTER.  The following

   files will be expanded:

      ACC-KB.HLP

      ACC-KB.IND

      FTENGINE.DLL

      FTUI.DLL

      MVAPI.DLL

6. Create a Windows icon for the ACC-KB.HLP file as follows:

   a. In Windows, choose the program group in which you want the icon

      to appear (typically the Microsoft Access program group).

   b. In Windows Program Manager, choose New from the File menu.

   c. In the New Program Object box, choose Program Item.

   d. Add the following arguments in the Program Item Properties box

         Description: Access KB

         Command Line: WINHELP.EXE <path>\ACC-KB.HLP

         Working Directory: <path>

      where <path> is the name of the path in which you placed the

      Microsoft Access Knowledge Base Help file.  If you do not

      specify the working directory, you will receive the error

      message "Routine not found."

   An icon will appear in the program group you have specified. Double-

   click the icon to open the Help file.

   NOTE: The ACC-KB.HLP file requires the WINHELP.EXE file to run. The

   WINHELP.EXE file comes with Microsoft Windows and is originally

   installed in your WINDOWS subdirectory. If it is missing from your

   system, you can restore it from your original Microsoft Windows

   disks.

--------------------------------------------------------------------

TO OBTAIN THIS APPLICATION NOTE

===============================

 - Application Notes are available by modem from the Microsoft

   Download Service (MSDL), which you can reach by calling (206)

   936-6735. This service is available 24 hours a day, 7 days a week.

   The highest download speed available is 14,400 bits per second (bps).

   For more information about using the MSDL, call (800) 936-4100 and

   follow the prompts. To obtain WX0928, download WX0928.EXE.

   WX0928.EXE is a compressed, self-extracting file. After you

   download WX0928, run it to extract the file(s) it contains.

 - If you are unable to access the source(s) listed above, you can

   have this Application Note mailed or faxed to you by calling

   Microsoft Product Support Services Monday through Friday, 6:00 A.M.

   to 6:00 P.M. Pacific time at <product #>. If you are outside the

   United States, contact the Microsoft subsidiary for your area. To

   locate your subsidiary, call Microsoft International Customer

   Service at (206) 936-8661.

Additional reference words: 1.00 1.10


PRB: Sorting a Query on a Nested Expression Does Not Work

 Article Number: Q105510

 CREATED: 20-OCT-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A query that sorts on a nested expression in the query will prompt you for

a parameter value, and may not sort correctly.

CAUSE

By design, this type of query operation will not run correctly.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create a new query based on the Employees table, as follows:

      Query: MySort

      -----------------------

      Type: Select Query

      Table: Employees

      Field: c: [Employee ID]

      Field: d: [c]

         Sort: Ascending

3. Run the query.

You will be prompted to enter a parameter value. If you remove the sorting,

the query will run correctly.

REFERENCES

==========

Microsoft Access "User's Guide," pages 97-98

Additional reference words: 1.00 1.10 2.00 ADK


INF: How to Change the Status Bar Text Using SysCmd()

 Article Number: Q105511

 CREATED: 20-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article demonstrates how to use the SysCmd() function to display

custom messages in the Microsoft Access status bar.

NOTE: For information on how to use the status bar progress meter, query on

the following words here in the Microsoft Knowledge Base:

   progress and meter and updating

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

The SysCmd() function is documented in the manual "The Secrets of

AccessWizards," which is included with the Microsoft Access Distribution

Kit (ADK) version 1.1. You can use this function to change the text that

appears in the status bar. For example, you might want to change the status

bar to read "Sorting..." while a sort operation is taking place, and then

remove it when the operation is complete.

The SysCmd() function syntax is as follows:

   SysCmd(<action> [, <text>])

Replace <action> with a numeric expression identifying the action to take.

Valid entries are as follows:

   4 - Set the status bar text to the text argument

   5 - Reset the status bar text

Replace <text> with a string expression that will appear left aligned in

the status bar.

The SysCmd() function returns null, which is not used.

Setting Status Bar Text

-----------------------

When the action argument is 4, the string expression in the text argument

will appear in the status bar. For example, type the following expression

in the Immediate window and the message "Sorting..." will appear in the

status bar:

   ? SysCmd(4, "Sorting...")

Removing or Resetting the Status Bar Text

-----------------------------------------

When the action argument is 5, the status bar text set by the previous

SysCmd() function is removed. For example, type the following in the

Immediate window and the "Sorting..." message will be removed:

   ? SysCmd(5)

The text argument can contain about 80 characters. Since the text in the

status bar uses a proportional font, the actual number of characters you

can display is determined by the total width of all the characters in the

text argument.

You cannot set the status bar text to an empty string. If you want to

remove the existing text in the status bar, set the text argument to a

single space.

How to Use SysCmd() in an Access Basic Function

-----------------------------------------------

The following sample function will place a message in the status bar,

display a message box, and then remove the status bar text:

1. Create a new module called Status Bar Test.

2. Enter the following statement in the Declarations section:

      Option Explicit

3. Enter the following function:

      Function StatusBar ()

         Dim RetVal As Variant

         RetVal = SysCmd(4, "The rain in Spain falls mainly ...")

         MsgBox "Press OK when you are ready to finish!"

         RetVal = SysCmd(5)

      End Function

4. To run the function, type the following in the Immediate window, and

   then press ENTER:

      ? StatusBar()

REFERENCES

==========

Microsoft Access Distribution Kit "The Secrets of AccessWizards," version

1.1, page 30

Additional reference words: 1.00 1.10 2.00 StatusBar progressmeter


INF: Data Source Dialog Box Does Not List ODBC Data Sources

 Article Number: Q105512

 CREATED: 20-OCT-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.1 and 2.0

---------------------------------------------------------------------

When you are attempting to attach or import a table that is accessible

through ODBC (such as a SQL Server, Sybase SQL Server, or Oracle table),

the Data Source dialog box does not list the table as a choice.

In order to make working with ODBC data sources as transparent as possible,

there is no explicit choice for each source in the Data Source dialog box.

To select an ODBC data source, select SQL Database in the Data Source

dialog box. Another dialog box will appear displaying a list of servers

with available ODBC data sources.

REFERENCES

==========

For more information on data sources, search for "data source" using the

Help menu.

Additional reference words: 1.10 2.00


PRA: OLE Objects Seem to Be Acceptable Filter Criteria

 Article Number: Q105513

 CREATED: 20-OCT-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Microsoft Access erroneously allows you to use OLE objects as filter

criteria. If you attempt to do so, a misleading error message is

displayed:

   Record is too large.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1, and 2.0. Microsoft is researching this problem and will post new

information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Microsoft Access does not currently allow you to use OLE objects as

filter criteria.

Steps to Reproduce Problem

--------------------------

1. Using the sample database NWIND.MDB, create a new form called Form1

   that is bound to the Employees table.

2. Drag the Photo field to the form.

3. From the View menu, choose Form.

4. Leaving Form1 open, open the Employees form.

5. From the Records menu, choose Edit Filter/Sort.

6. Add the following to the filter criteria:

      Photo = Forms!Form1!Photo

7. From the Records menu, choose Apply Filter/Sort.

   The error message "Record is too large" is displayed.

Additional reference words: 1.00 1.10 2.00 Forms OLE


PRB: Invalid Path Error Message Using UNC with 10+ Characters

 Article Number: Q105514

 CREATED: 20-OCT-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you attempt to use a universal naming convention (UNC) path in

Microsoft Access in which the server name is longer than 10 characters

or contains spaces, you get the following error message

   \\<servername>\<sharename> isn't a valid path

even though valid UNC server names can be up to 15 characters and can

contain spaces.

For example, the path

   SystemDB=\\s234567890\ANYSHARE\SYSTEM.MDA

works correctly, but the following UNC paths cause the above error

message to appear:

   SystemDB=\\s2345678901\ANYSHARE\SYSTEM.MDA

   SystemDB=\\s2345 7890\ANYSHARE\SYSTEM.MDA

CAUSE

This problem is not caused directly by Microsoft Access, but rather by an

external host, such as Microsoft Windows for Workgroups, or by a network

problem. Microsoft Access does not parse UNC paths; it hands them off to

external processes.

RESOLUTION

One way to work around this problem is to connect the server to a

logical drive before using Microsoft Access and then reference the

logical drive instead of the server.

For example, you want to use a server named \\MY SERVER\MYSHARE,

and you are using Microsoft LAN Manager. To reference this server,

type:

   NET USE F: \\MY SERVER\MYSHARE

In your MSACCESS.INI file, reference it as follows:

   SystemDB=F:\SYSTEM.MDA

Additional reference words: 1.00 1.10 2.00 WinIss attaching


PRA: Microsoft Access Changes MS-DOS Screen/Text Colors

 Article Number: Q105515

 CREATED: 20-OCT-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you set your screen and text colors in MS-DOS using ANSI.SYS

or a similar utility (such as the Norton Screen Attribute, SA.EXE) the

colors are changed after you run Microsoft Access.

CAUSE

This problem occurs for two reasons:

1. Microsoft Access uses all available palette entries for its colors.

2. Microsoft Windows does not differentiate between MS-DOS and Windows

   colors.

Because this problem occurs as a result of an application's

interaction with Microsoft Windows, it is not limited to Microsoft

Access. It also may occur with other products, such as Microsoft

PowerPoint, ShowDIB, or Windows Paintbrush, that use 256-color bitmaps

under Microsoft Windows.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1, and 2.0. Microsoft is researching this problem and will post new

information here in the Microsoft Knowledge Base as it becomes available.

Screen Attribute is manufactured by Peter Norton Computing, a vendor

independent of Microsoft; we make no warranty, implied or otherwise,

regarding this product's performance or reliability.

Additional reference words: 1.00 1.10 2.00 WinIss ui


INF: How to Print a Conditional Page Header in a Report

 Article Number: Q105516

 CREATED: 20-OCT-1993

 MODIFIED: 09-NOV-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SUMMARY

A common request for reports is to print a conditional page header (in

this case, a page header that prints if the group spans more than one

page). This article contains steps to force the page header, which

contains the column header labels, to print on the consecutive pages

of a group.

MORE INFORMATION

Reports print group header information once per group, even if the

group of data spans more than one page. In reports, a common layout is

to place the grouping value in the group header along with the column

labels. However, since this data is not repeated when a group spans

more than one page, the column header labels are not repeated on the

subsequent page(s).

To create conditional headers, you must create a new page before each

group of data and set a flag from the group header to determine when

the page header should print. Then, from the group footer, set the

flag back so that the page header does not print at the beginning of

the next group.

The following steps illustrate this procedure in the sample database

NWIND.MDB:

1. Create a new form called FlagForm. This form is used to store a

   global variable.

2. Locate one unbound control and set the following property:

      ControlName: Flag

3. Create a new macro: Test

      Macro Name        Condition                       Action

      ---------------------------------------------------------------

      SetFlag                                            SetValue

      ShrinkPageH        Forms![FlagForm]![Flag]=1       CancelEvent

      FlagOn                                             SetValue

      FlagOff                                            SetValue

      Test actions

      ---------------------------------

      SetFlag

         Item:  Forms![FlagForm]![Flag]

         Expression: 1

      CancelEvent: no arguments

      FlagOn

         Item:  Forms![FlagForm]![Flag]

         Expression: 0

      FlagOff

         Item:  Forms![FlagForm]![Flag]

         Expression: 1

4. Create a new blank report called PrintHeaders based on the Products

   table:

   a. Set the following report header properties:

         OnFormat: Test.SetFlag

         Height: 0

   b. Set the page header property:

         OnFormat: Test.ShrinkPageH

   c. Locate a label in the page header section with the following

      property:

         Caption: Print Only On Second Pages of Group

   d. Create a grouping for the Category ID with following properties:

         Group Header: Yes

         Group Footer: Yes

   e. Set the following group header properties:

         OnFormat: Test.FlagOn

         ForceNewPage: BeforeSection

   f. Create a control in the group header section bound to the Category

      Id field.

   g. Create a text box control bound to the Product Name field in the

      detail section.

   h. Set the height property for the detail section to 2 inches.

      (This is to create groups of data that span more than one page.)

   i. Set the group footer property to:

         OnFormat: Test.FlagOff

5. To try this report layout:

   a. Open the form in Datasheet view.

   b. Open the report in Print Preview.

   c. Move to the various pages to see the page header turn on and off.

Additional reference words: 1.00 1.10 groupings


INF: How to Use Q+E to View SQL Server Tables

 Article Number: Q105517

 CREATED: 20-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - Microsoft Excel versions 3.0 and 4.0

---------------------------------------------------------------------

SUMMARY

This article describes how to use the release of Q+E that is included with

Microsoft Excel versions 3.0 and 4.0 to view data from the sample Pubs

database that is supplied with Microsoft SQL Server.

You can use Q+E to troubleshoot ODBC problems with connecting to SQL Server

data sources. Since Q+E does not use ODBC to connect to SQL Server, it can

be used to help diagnose connection problems.

If you are unable to connect to a SQL Server data source using either ODBC

or Q+E, there may be a problem with the network (NETAPI.DLL) or with the

server itself.

MORE INFORMATION

Q+E is a database application that you can use to manipulate and update

database files from a variety of database systems, including Microsoft SQL

Server. An abbreviated version of Q+E is included with Microsoft Excel

versions 3.0 and 4.0.

The following example demonstrates how to view the contents of the Authors

table in the sample Pubs database that is supplied with SQL Server:

1. Start Q+E and choose Logon from the File menu.

2. In the Sources list, select SQL Server and then choose OK.

3. In the Server Name box, type the name of the server that contains

   the tables you want to use.

4. In the Login ID box, type your SQL Server login name.

   NOTE: The system administrator is typically "sa".

5. In the Password box, type the password for the user entered in the

   Login ID box.

6. Choose OK.

7. From the File menu, choose Open.

8. In the Owner List box, select Pubs and then choose OK.

9. In the Table List box, select Authors and then choose OK.

The Authors table will be displayed in a window similar to the Microsoft

Access Datasheet view.

Q+E is manufactured by Pioneer Software Systems, a vendor independent of

Microsoft; we make no warranty, implied or otherwise, regarding this

product's performance or reliability.

REFERENCES

==========

Microsoft Excel "Q+E for Microsoft Excel User's Guide," version 3.0,

Appendix C

Microsoft Excel "Q+E for Microsoft Excel User's Guide," version 4.0,

Appendix D

Additional reference words: 1.00 1.10 2.00


PRA: DoMenuItem Run Macro Causes GP Fault

 Article Number: Q105518

 CREATED: 20-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

When you run a macro that has a DoMenuItem that contains the Macro Run

commands, a general protection (GP) fault or "Out Of Stack Space" error

will occur.

RESOLUTION

Use the RunMacro action instead of the DoMenuItem action to run a macro.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Create the following macro:

      Macro Name    Action

      ------------------------

      RunMe         DoMenuItem

      RunMe Actions

      -------------

      DoMenuItem

         Menu Bar: Macro

         Menu Name: Macro

         Command: Run

2. Save and then close the macro.

3. Run the macro.

A GP fault will occur. If the macro is still open in Design view when you

run it, an "Out Of Stack Space" error will occur.

Additional reference words: 1.00 1.10 GPF ADK


INF: How to Make a Combo Box Default to First Item in List

 Article Number: Q105519

 CREATED: 20-OCT-1993

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you move to a new record on a form that has a combo box or a list box,

the combo box will be blank or the list box will not have any value

selected. The combo box or list box may have a table or query defined in

its RowSource property that provides the list of items to display in the

box. Since the data in the underlying RowSource property will vary with the

addition or deletion of records, it is difficult to know what item will

appear at the top of the list when the form is used.

This article describes how to force a list box or combo box to default to

the first row in the underlying list.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

Microsoft Access Version 2.0

----------------------------

In Microsoft Access version 2.0, you can use the ItemData method to cause a

list box or combo box to default to any row. To have the first row selected

automatically, set the box's DefaultValue property to the following:

   =[<MyCombo>].ItemData(0)

Microsoft Access Version 1.x

----------------------------

The first method below uses a user-defined Access Basic function, and the

second method uses the built-in DLookUp() function, to display the first

value in the list automatically.

Method 1:

The following example demonstrates a sample Access Basic function called

GetFirst() that can be used to find the first item in the underlying

table or query. The function's result can be used by the DefaultValue

property to automatically select the first item in the list.

To create the GetFirst() function, add the following to a new or existing

module:

   Option Explicit

   Function GetFirst (BoundColName As String, RowSource As String)

      Dim DB As Database

      Dim DS As Dynaset

      Set DB = CurrentDB()

      Set DS = DB.CreateDynaset(RowSource)

      On Error Resume Next

      DS.MoveFirst

      If Err = 0 Then GetFirst = DS(BoundColName)

   End Function

Note that the first argument of the GetFirst() function is the name of

the field that is used as the BoundColumn property for the combo box. The

second argument is the name of the table or query specified in the

RowSource property of the combo box.

The following example demonstrates how to use GetFirst() to automatically

select the first employee in the Salesperson combo box on the Orders form

in the sample database NWIND.MDB:

1. Open the Orders form in Design view.

2. Select the Salesperson combo box. Display the property sheet by

   choosing Properties from the View menu.

3. Set the DefaultValue property to the following:

      =GetFirst("Employee ID", "Employee List")

4. View the form in Form view.

5. From the Records menu, choose Data Entry.

Note that the combo box automatically displays "Buchanan, B.L."

Differences Between GetFirst() and DFirst():

The GetFirst() function is similar to the built-in DFirst() aggregate

function. However, DFirst() may return unexpected results when used to find

the first item in a list.

If the underlying table or query is indexed, the value returned by DFirst()

will be the first indexed record. Otherwise, DFirst() will return items in

the actual order in which they were entered in the database. Therefore, if

the RowSource property of a combo box is a query that sorts the data by a

non-indexed field, DFirst() may not return the expected value.

For example, if you change the DefaultValue property of the Salesperson

combo box on the Orders form to

   =DFirst("[Employee ID]", "Employee List")

the item returned will be "Davolio, Nancy," which is not the first item in

the combo box, but the first indexed item in the Employees table.

Method 2:

This method uses the DLookUp() function to look up the first record in the

list. The expression will be the field referred to in the BoundColumn

property (or the ControlSource property) of the combo box or list box. The

domain will be the same table or query that the combo box or list box uses

as its RowSource property. The optional criteria will not be used so that

the DLookUp() function will return the first record.

The following example demonstrates how to use DLookUp() to automatically

select the first employee in the Salesperson combo box on the Orders form

in the sample database NWIND.MDB:

1. Open the Orders form in Design view.

2. Select the Sales Person combo box. View the property sheet by choosing

   Properties from the View menu.

3. Set the DefaultValue property to the following expression:

      =DLookUp("[Employee ID]","Employee List")

4. View the form in Form view.

5. From the Records menu, choose Data Entry.

Note that the combo box automatically displays "Buchanan, B.L."

REFERENCES

==========

For more information about the ItemData method, search for "ItemData" then

"ItemData Method" using the Microsoft Access version 2.0 Help menu.

Microsoft Access "User's Guide," version 1.0, Chapter 9, "Designing Forms,"

pages 233-242

Microsoft Access "User's Guide," version 1.1, Chapter 9, "Designing Forms,"

pages 237-246

Microsoft Access "Language Reference," versions 1.0 and 1.1, pages 131-132,

139-140, and 144-146

Additional reference words: 1.00 1.10 2.00 listbox combobox


PRA: GP Fault with PostMessage() to an ADK Application

 Article Number: Q105520

 CREATED: 20-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

If you attempt to close a Microsoft Access Distribution Kit application by

sending a WM_CLOSE message from another application using the PostMessage()

Windows API function call, a general protection (GP) fault will occur.

The sample code

   x = PostMessage(hWnd, WM_CLOSE, 0, 0)

will result in a GP fault when run in languages such as Microsoft Visual

Basic, Microsoft Windows C, or Access Basic.

RESOLUTION

Use the WM_DESTROY window message instead of the WM_CLOSE message to close

a run-time application. The following sample code demonstrates how to use

the WM_DESTROY message:

   x = PostMessage(hWnd, WM_DESTROY, 0, 0)

STATUS

Microsoft has confirmed this to be a problem in the Microsoft Access

Distribution Kit version 1.1. This problem no longer occurs in the

Microsoft Access Developer's Toolkit version 2.0.

REFERENCES

==========

Microsoft Windows version 3.1 "Programmer's Reference," Volume 2

Additional reference words: 1.10 GPF ADK


PRA: Show All Records Does Not Work in Subforms

 Article Number: Q105521

 CREATED: 20-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If you choose Show All Records while entering data in a subform, records in

the main form will be shown instead of records in the subform.

CAUSE

Microsoft Access applies the Show All Records command to the main form

instead of the subform.

RESOLUTION

Close and then reopen the main form to show the records in the subform.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB.

2. Open the Orders form.

3. Click the Prod ID field on the subform.

4. From the Records menu, choose Data Entry. The existing subform records

   will disappear as they should, and a blank new subform record will be

   selected.

5. From the Records menu, choose Show All Records.

The Bill To box on the main form will be selected, and the subform records

will not be displayed as they should.

Additional reference words: 1.00 1.10


INF: Using a Form Reference Parameter Query in Access Basic

 Article Number: Q105522

 CREATED: 20-OCT-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Before you can run a parameter query in Access Basic, you must set the

values of all the parameters. If the parameters are not set, you will

receive the error message:

   # parameters were expected, but only 0 were supplied.

Below is a description of the syntax for setting the value of a

parameter that is a form reference. An example is also included.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

MORE INFORMATION

To set the value of a parameter that is a form reference, use the

following syntax:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   Dim MyDB As Database

   Dim MyQDef As QueryDef

   Set MyDB = CurrentDB()

   Set MyQDef = MyDB.OpenQueryDef("Parameter Query")

   MyQDef![Forms!Form Name!ControlName] = Forms![Form _

      Name]![ControlName]

In the example above, the definition variable, the exclamation point,

and the parameter, which is enclosed in brackets, are to the left of

the equal sign. Note that if the form name or control name in a form

reference contains spaces, it is usually enclosed in brackets. Do

not include the brackets if you are setting the value of the form

reference parameter. However, do include the brackets if you are

referencing the form listed to the right of the equal sign.

The next example demonstrates how to create a query that will prompt

you to enter the date when you run the query:

   Dim MyDB As Database

   Dim MyQDef As QueryDef

   Set MyDB = CurrentDB()

   Set MyQDef = MyDB.OpenQueryDef("Parameter Query")

   MyQDef![Please enter date:] = "#12/12/93#"

The following example uses the Orders table from the sample database

NWIND.MDB:

1. Create the following query in the NWIND.MDB database:

      Query: Customer Orders Parameter Query

      -----------------------------------------------------

      Type: Select Query

      Field: Customer ID

         Table: Orders

         Criteria: [Forms]![Search Form]![Customer To Find]

      Field: Order ID

         Table: Orders

      Field: Order Date

         Table: Orders

2. Create the following form bound to the Orders table:

      Form: Search Form

      -----------------------------------

      Text box:

         ControlName: Customer To Find

         ControlSource: Customer ID

      Command button:

         ControlName: Button0

         Caption: ParamQD

         OnPush (or On Click): =ParamQD()

3. Create a new module and add the following code:

   NOTE: In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

      '****************************************************************

      ' Declarations Section

      '****************************************************************

      Option Compare Database

      Option Explicit

      '****************************************************************

      ' Function ParamQD()

      '

      ' Purpose: To demonstrate how to set the value of a parameter that

      '            is a form reference.

      '****************************************************************

      Function ParamQD()

         Dim MyDB As Database

         Dim MyQDef As QueryDef

         Dim MyDyna As Dynaset

         Set MyDB = CurrentDB()

         Set MyQDef = MyDB.OpenQueryDef("Customer Orders Parameter _

            Query")

         'Set the Value of the Parameter.

         MyQDef![Forms!Search Form!Customer To Find] = Forms![Search _

            Form]![Customer To Find]

         'Create the dynaset.

         Set MyDyna = MyQDef.CreateDynaset()

         MyDyna.MoveLast

         MsgBox MyDyna.RecordCount

         MyDyna.Close

         MyQDef.Close

      End Function

When you enter a Customer ID on the Orders form and choose the ParamQD

button, the ParamQD() function will run and a message box will display

how many orders that customer has.

REFERENCES

==========

Microsoft Access "Introduction to Programming," versions 1.0 and 1.1, pages

137-138

Microsoft Access "User's Guide," version 2.0, pages 274-277

Additional reference words: 1.00 1.10 2.00


PRB: SetWarnings Action Works Only While Macro Is Running

 Article Number: Q105644

 CREATED: 22-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you turn off system messages with a SetWarnings macro action, system

messages will be off only while that macro or set of macro actions is

running.

CAUSE

Microsoft Access turns the display of system messages back on when the

macro containing the SetWarnings action is finished.

STATUS

This behavior is by design.

REFERENCES

==========

For more information on the SetWarnings action, search for "SetWarnings"

then "SetWarnings Action" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 set warning echo


INF: Creating and Converting Version 1.0 and 1.1 Databases

 Article Number: Q105645

 CREATED: 22-OCT-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article describes how to use Microsoft Access version 1.1 to convert

databases between version 1.0 and 1.1 formats, and how to create new

databases in either version 1.0 or 1.1 formats.

MORE INFORMATION

Database versions are not listed when you choose Open Database or Repair

Database from the File menu. If you try to open a version 1.1 database in

Microsoft Access version 1.0, you will receive the error message:

   Database is corrupted or is not an Access Database

If you try to repair a version 1.1 database in Microsoft Access version

1.0, you will receive the error message:

   Out-of-date database format

In Microsoft Access version 1.1, existing databases can be converted

between version 1.0 and 1.1 formats. You can use either the Compact or

Encrypt command to perform the conversion. New databases can be created in

either format.

How to Convert Between Version 1.0 and 1.1 Formats Using Compact Database

-------------------------------------------------------------------------

1. Start Microsoft Access version 1.1. Do not open a database.

2. From the File menu, choose Compact Database.

3. In the Compact From dialog box, select the database you want to

   convert.

4. In the List Files Of Type box, select the format to which you want to

   convert the database.

How to Convert Between Version 1.0 and 1.1 Formats Using Encrypt

----------------------------------------------------------------

1. Start Microsoft Access version 1.1. Do not open a database.

2. From the File menu, choose Encrypt/Decrypt.

3. In the Encrypt/Decrypt dialog box, select the database you want to

   convert.

4. In the Encrypt box, select the format to which you want to convert

   the database.

How to Create a Database in Version 1.0 or 1.1 Format

-----------------------------------------------------

1. Start Microsoft Access version 1.1.

2. From the File menu, choose New Database.

3. In the List Files Of Type box, select the format in which you want to

   create the new database.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.1, page 637

Additional reference words: 1.00 1.10


INF: How to Use Microsoft Access Database in Visual Basic

 Article Number: Q105646

 CREATED: 22-OCT-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Visual Basic for Windows, version 3.0

---------------------------------------------------------------------

SUMMARY

Microsoft Visual Basic version 3.0 for Windows incorporates the Microsoft

Access version 1.1 engine and shares dynamic-link library (DLL) files with

Microsoft Access. Therefore, Visual Basic can use Microsoft Access database

(.MDB) files.

Microsoft Access creates a system database (SYSTEM.MDA) file that stores

important security information such as user names and accounts. The system

database file can be changed only in Microsoft Access. The Visual Basic

database engine does not require a system database file unless it

interacts with an .MDB file that has the security features enabled.

MORE INFORMATION

If security for an .MDB file is enabled, the Visual Basic application must

run the SetDefaultWorkspace statement before the Visual Basic engine is

initialized. The SetDefaultWorkspace statement will set the User ID and

password. If the User ID and password are not set, the Visual Basic

application will access the .MDB file as a user in the Users group.

You can set the location and name of the system database file to be used by

the Visual Basic database engine by changing the SystemDB parameter in the

[Options] section of the VB.INI file. The sample VB.INI section below

demonstrates how to use the MYAPP.MDA system database file in the MYAPP

directory:

   [Options]

   SystemDb=C:\MYAPP\MYAPP.MDA

REFERENCES

==========

Microsoft Visual Basic, "Professional Features Book 2," Appendix A

Microsoft Visual Basic, "Language Reference," page 520

Additional reference words: 1.00 1.10


PRA: GP Fault When Passing User-Defined Type with Array

 Article Number: Q105647

 CREATED: 22-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You get the error message "MSACCESS caused a General Protection Fault

(GP Fault) in module MSABC110.DLL at 000D:1AD4" when you attempt to

pass a user-defined type to a function or Sub procedure in which one

of the components of the user-defined type is an array.

This happens only under the following conditions:

 - The user-defined type contains an array.

 - You attempt to pass an array element of the user-defined type to

   a Sub procedure or function.

RESOLUTION

A workaround for Microsoft Access version 1.1 is to explicitly cast

the data type of the array. For the example below, instead of

   Call GPFTest(Testing.StrArry())

you would explicitly cast the array as a string array by placing the

"$" character at the end of the array reference, such as:

   Call GPFTest(Testing.StrArry$())

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Start Microsoft Access and create a new database and module.

2. In the Declarations section of the module, type the following:

      Type TestType

          StrArry(10) as String

      End Type

      Dim Testing as TestType

3. Create a Sub procedure called Start as follows:

      Sub Start()

         Testing.StrArry(1) = ""

         Call GPFTest(Testing.StrArry())

      End Sub

4. Create a Sub procedure called GPFTest as follows:

      Sub GPFTest(Testing() as String)

         For x=1 to 10

            Debug.Print Testing(x)   ' This line causes a GP Fault.

         Next

      End Sub

5. Start the code by running the Sub Start() function. To do this,

   give the focus to the Immediate window, type "Start," and press

   ENTER.

   You get the following error message:

      MSACCESS caused a General Protection Fault in module

      MSABC110.DLL at 000D:1AD4

Additional reference words: 1.00 1.10 Programming GPF


PRB: Type Mismatch Error Using CLng() With Hex Value

 Article Number: Q105648

 CREATED: 22-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

--------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

--------------------------------------------------------------------

SYMPTOMS

When you use the CLng() data type conversion function on a quoted

hexadecimal string with ampersands at each end [for example,

CLng("&Hxxxx&")], you get the following error message:

   Type Mismatch

For example,

   Val("&H7777")

   Val("&H7777&")

   CLng(&H7777)

   CLng(&H7777&)

   CLng("&H7777")

all correctly return the value 30583, but

   CLng("&H7777&")

returns the error message.

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10 2.00 AB Programming


PRA: Wrong Action Query Icon with CreateQueryDef Method

 Article Number: Q105654

 CREATED: 22-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The exclamation point (!) that identifies an action query icon in the

Database window is missing from action queries that are created with the

CreateQueryDef method.

CAUSE

The query icon that is displayed is determined by flags stored separately

from the query itself. When a query is created with the CreateQueryDef

method, the flags are set for the default icon instead of for the action

query icon.

RESOLUTION

Open the query in Design view from the Database window. Then, save the

query (without making any changes to it). The correct icon will be

displayed.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual.

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB.

2. Create a new module.

3. Enter the following code in the module:

   NOTE: In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

      'Place the following Option line in the Declarations Section

      Option Explicit

      Sub WrongIcon ()

         Dim MyDB As Database, MyQuery As QueryDef

         Set MyDB = CurrentDB()

         Set MyQuery = MyDB.CreateQueryDef("Wrong Icon", "SELECT * _

            into SomeTable FROM Customers;")

         MyQuery.Close

         MyDB.Close

      End Sub

4. From the View menu, choose Immediate Window.

5. Type the following, and then press ENTER:

      WrongIcon

6. Select the Database window. Note that the icon for the newly created

   query WrongIcon displays the default icon rather than the action query

   icon.

REFERENCES

==========

Microsoft Access "Language Reference," pages 90-91

Microsoft Access "User's Guide," pages 161-163

Additional reference words: 1.00 1.10 AB ADK


PRA: Using Task List to Exit Run Time Causes GP Fault
PRA: Using Task List to Exit Run Time Causes GP Fault [B_WAccADK]

 Article Number: Q105655

 CREATED: 22-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

If you close a run-time Microsoft Access application by choosing End Task

from the Microsoft Windows Task List, you will receive an "MSARN110

application error" message. When you close the error message, you will

receive the error message "MSARN110 has caused a general protection fault

in module MSARN110.EXE at 0079:0BB4."

STATUS

Microsoft has confirmed this to be a problem in the Microsoft Access

Distribution Kit version 1.1. This problem no longer occurs in the

Microsoft Access Developer's Toolkit version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Start a run-time Microsoft Access application.

2. Open the Task List by pressing CTRL+ESC.

3. Select the run-time application.

4. Choose End Task.

Additional reference words: 1.10 ADK


PRB: Subform Column Width Changes Made in Main Form Not Saved

 Article Number: Q105656

 CREATED: 22-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If a subform is in Datasheet view on a main form, and you change the width

of the columns on the subform, the changes will not be retained when the

main form is closed and then reopened.

CAUSE

When you modify a subform while it is being viewed on a main form, you are

actually modifying a copy of the subform, not the actual subform itself.

RESOLUTION

To change column widths on the subform, open the subform independently of

the main form, make the changes, and save the subform. Then force the main

form to get a new copy of the subform by closing and then reopening the

main form, or by clicking in the subform control on the main form and then

pressing ENTER.

STATUS

This behavior is by design.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.1, page 274

Additional reference words: 1.00 1.10 2.00 sub main-form sub-form


PRA: "Invalid Reference to Field in Query" Error Message

 Article Number: Q105657

 CREATED: 22-OCT-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The message

   Invalid reference to field 'Field Name' in query

occurs when you are printing or previewing a graph from Form view, or when

you are printing a graph on a report from print preview.

CAUSE

The data source for the graph is a parameter query. The parameter query is

run one time to collect the values required to display the graph in Form

view or print preview. Once the parameters are collected through the Enter

Parameter Value box, they no longer exist. When you try to print the graph,

the graph must be regenerated from the underlying data. Since the

parameters are no longer available and are not prompted for again, the

error message stated above is generated.

RESOLUTION

Rather than enter the parameters using the Enter Parameter Value box, the

parameters for the query should come from a source that is available while

the form is active. Modify the query so that the parameters are referenced

directly from a second form.

The following example demonstrates how to use a second form to collect the

values:

1. Open the sample database NWIND.MDB. Create a blank, unbound form called

   Parameter Form with the following controls and properties:

      Form: Parameter Form

      Text box

         ControlName: Beginning Date

      Text box

         ControlName: Ending Date

      Command button

         Caption: Open Graph Form

         OnPush: Graph Form.Open

2. Create a new macro called Graph Form with the following actions:

      MacroName      Action         Defined Below

      -------------------------------------------

      Open           SetValue             1

                     OpenForm             2

      Close          Close                3

      Graph Form Actions

      ------------------------------------------

      1. SetValue

            Item: Forms![Parameter Form].Visible

            Expression: False

      2. OpenForm

            Form Name: Graph Form

            View: Form

            Filter Name: <leave empty>

            Where Condition: <leave empty>

            Data Mode: Edit

            Window Mode: Normal

      3. Close

            Object Type: Form

            Object Name: Parameter Form

3. Open the Employee Sales By Country (Parameter) query in Design view.

4. Change the criteria row for the Shipping Date column from

      Between [Beginning Date] And [Ending Date]

   to:

      NOTE: In the following example, an underscore (_) is used as a line-

      continuation character. Remove the underscore when re-creating this

      example.

      Between Forms![Parameter Form]![Beginning Date] And _

      Forms![Parameter Form]![Ending Date]

5. From the Query menu, choose Parameters. Change the parameters to be:

      Parameter                                    Data type

      ------------------------------------------------------

      Forms![Parameter Form]![Beginning Date]      Date/Time

      Forms![Parameter Form]![Ending Date]         Date/Time

   NOTE: Your query may not have parameters explicitly defined in the

   Parameters dialog box; however, it is good practice to do so.

6. Open the Graph Form and alter the OnClose property to be:

      OnClose: Graph Form.Close

7. Open the Parameter Form form and type "1/1/92" (without the quotation

   marks) in the first box, and type "12/31/92" (without the quotation

   marks) in the second box. Choose the Open Graph Form button.

   Note that when you choose the Open Graph Form button, a macro hides the

   parameter form and then opens the graph form. Although the parameter

   form is hidden, it is still open, and the values on it are still

   available for the query that the graph is based on.

8. From the File menu, choose Print Preview.

Since the parameter form remains open, and the values on it are still

available, the graph can be regenerated for printing. In contrast, the

Enter Parameter Value box values are available only at the time the

parameter is entered.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

 1. Open the sample database NWIND.MDB. Create a blank, unbound form and

    save it with the name Graph Form.

 2. Click the graphing tool in the toolbox, and then click in the blank

    form to start the GraphWizard.

 3. In the "Also, Select a Data Source for Your Graph" box, select

    Employee Sales By Country (Parameter).

 4. Choose Next to advance to the next screen.

 5. In the Available Fields box, select Sale Amount. Choose the ">" button

    to add it to the Fields For Graph box.

 6. In the Available Fields box, select Salesperson, and then choose ">".

 7. Choose Next to advance to the next screen.

 8. Choose the Design button.

 9. From the View menu, choose Form.

10. Type "1/1/92" (without the quotation marks) in the Beginning Date

    parameter value box, and then choose OK.

11. Type "12/31/92" (without the quotation marks) in the Ending Date

    parameter value box, and then choose OK. A bar graph will be displayed.

12. From the File menu, choose Print Preview.

The error message: "Invalid reference to field 'Beginning Date' in query"

will be displayed.

REFERENCES

==========

Additional reference words: 1.00 1.10


PRB: "Syntax Error in String" Error Using DDE() and DDESend()

 Article Number: Q105658

 CREATED: 22-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

docerr

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - Microsoft Access Distribution Kit version 1.1

 - Microsoft Access Developer's Toolkit version 2.0

---------------------------------------------------------------------

SYMPTOMS

You receive the error message "Syntax error in string" when you enter

either the DDE() or the DDESend() function in the ControlSource property of

a text box on a form.

CAUSE

A reference to another control is being used for the application or topic

argument in the function. Note that you can successfully include a control

reference for the item or data argument.

RESOLUTION

The following example demonstrates how to create and use the sample Access

Basic functions newDDE() and newDDESend() in place of the DDE() and

DDESend() functions:

1. Open a module and enter the following:

      Option Explicit

      Function newDDE (Application, Topic, Item)

         Dim chan As Integer

         On Error GoTo ErrnewDDE

         chan = DDEInitiate(Application, Topic)

         newDDE = DDERequest(chan, Item)

         DDETerminate chan

      ByenewDDE:

         Exit Function

      ErrnewDDE:

         newDDE = "#DDEERROR"

         Resume ByenewDDE

      End Function

      Function newDDESend (Application, Topic, Item, DataToSend)

         Dim chan As Integer

         On Error GoTo ErrnewDDESend

         chan = DDEInitiate(Application, Topic)

         newDDE = DDEPoke chan, Item, DataToSend

         DDETerminate chan

         newDDESend = True

      ByenewDDESend:

         Exit Function

      ErrnewDDESend:

         newDDESend = False

         Resume ByenewDDESend

      End Function

2. Start Microsoft Word for Windows. Save a new document as Test.

3. Type a few lines of text in the document, and then select the text.

4. If you are using Word version 2.0, choose Bookmark from the Insert menu.

   If you are using Word version 6.0, choose Bookmark from the Edit menu.

   Type "MyBookMark" (without the quotation marks) and then press ENTER.

5. Switch to Microsoft Access (leave Word for Windows running).

6. Create a new form with the following controls and properties:

      Text box:

        ControlName: Application

      Text box:

        ControlName: Topic

      Text box:

        ControlName: Item

      Text box:

        ControlName: Data

      Text box:

        ControlName: DDE

        ControlSource: =newDDE([Application],[Topic],[Item])

      Text box:

        ControlName: DDESend

        ControlSource:

           =newDDESend([Application],[Topic],[Item],[Data])

        Format: True/False

7. From the View menu, choose Form. "#DDEError" will appear in the DDE text

   box, and "False" will appear in the DDESend text box. These messages

   occur because there are not yet valid application, topic, and item

   arguments.

8. Create the following entries:

      Application: Winword

      Topic: Test

      Item: MyBookMark

      Data: Hello!

   The DDESend box will display "True," and the text "Hello!" will appear

   in the Word for Windows document.

9. With the insertion point in the DDE box, press F9 to force the function

   to refresh.

"Hello!" will appear in the DDE box in place of "#DDEError."

STATUS

This behavior is by design.

MORE INFORMATION

When the form is opened, Microsoft Access immediately establishes a DDE

channel to the other application. This link uses the application and topic

arguments in the function. The channel is kept open until the form is

closed. Since the channel is open, the arguments necessary for opening the

channel cannot be altered.

Microsoft Access does not open a new channel whenever it needs to call or

refresh the control with the DDE() or DDESend() function. Doing so would

impose significant overhead and could result in performance degradation.

Steps to Reproduce Behavior

---------------------------

1. Create a blank, unbound form.

2. Place a text box on the form.

3. Enter any of the following expressions in the text box's ControlSource

   property:

      =DDE("winword",[topic],"my item")

      =DDE([application],"MyDoc","my item")

      =DDESend("winword",[topic],"my item, "my data")

      =DDESend([application],"MyDoc","my item, "my data")

The error message stated above will occur. Any reference to another control

in the application or topic argument will generate this error.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.1, pages 115-117 and 122-

124

Additional reference words: 1.00 1.10 2.00 DocErr ADK


INF: How to Direct DDE to a Specific Instance of a Server

 Article Number: Q105659

 CREATED: 22-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - Microsoft Access Distribution Kit version 1.1

 - Microsoft Access Developer's Toolkit version 2.0

---------------------------------------------------------------------

SUMMARY

You can run multiple instances of the same application under Microsoft

Windows. When you communicate with an application using DDE, it may be

important to be able to identify which instance of an application should

respond to your DDE commands.

You can initiate a DDE conversation with a specific instance of an

application by appending the application's Task ID number to the

application name argument in the DDE initiate command.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

Each instance of each application launched in Windows is assigned a unique

number called a Task ID. This number can be used to distinguish among

multiple instances of an application.

To initiate a DDE conversation using the System topic with an instance of

Microsoft Excel that has a Task ID of 34567, you could use the following

sample command:

   Chan = DDEInitiate("excel34567", "System")

If you do not specify a Task ID number, you will initiate a conversation

with the first instance of the application that Windows finds. Note that

the order in which Windows finds instances of an application does not

always correspond to the order in which the applications were started.

How to Get the Task ID of an Application

----------------------------------------

You can get the Task ID of an application by doing one of the following:

 - Use the Access Basic shell command to launch the application. The shell

   command will return the application's Task ID if the application is

   launched successfully.

   -or-

 - Use an Access Basic function to find the Task ID. The following sample

   function can be used to find an application's Task ID:

Notes

-----

 - In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

 - You may have some Microsoft Windows API functions defined in an existing

   Microsoft Access library; therefore, your declarations may be

   duplicates. If you receive a duplicate procedure name error message,

   remove or comment out the declarations statement in your code.

   Option Explicit

   Declare Function GetActiveWindow Lib "User" () As Integer

   Declare Function GetWindowWORD Lib "User" (ByVal hWnd As Integer, _

      ByVal nIndex As Integer) As Integer

   Const GWW_HINSTANCE = (-6)

   Function GetActiveTaskID ()

      GetActiveTaskID = GetWindowWORD(GetActiveWindow(), _

         GWW_HINSTANCE)

   End Function

The following Access Basic code demonstrates the use of both of these

techniques in getting the Task ID.

   Function TestTaskID()

      Dim TaskID

      TaskID = Shell("excel", 1)

      MsgBox TaskID & " and " & GetActiveTaskID()

   End Function

How to Use an Application's Task ID in a DDE Conversation

---------------------------------------------------------

The following example demonstrates how to use Task IDs to indicate which

instance of an application should be used in a DDE conversation. This

sample code will launch two instances of Microsoft Excel, start a DDE

conversation with each instance, and poke data to Sheet1 of each instance:

   Function DDEWithTwoInstances ()

      Dim TaskID1, TaskID2

      Dim Chan1, Chan2

      ' Start 2 instances of Excel and record Task ID numbers

      TaskID1 = Shell("excel.exe", 1)

      TaskID2 = Shell("excel.exe", 1)

      ' Initiate DDE conversations with both instances using

      ' the Task ID numbers. Trap an error that may happen

      ' if we try to initiate a conversation and the copy of

      ' Excel is still trying to start from the shell command.

      On Error GoTo ExcelNotYetReady

      Chan1 = DDEInitiate("excel" & TaskID1, "Sheet1")

      On Error GoTo 0

      On Error GoTo ExcelNotYetReady

      Chan2 = DDEInitiate("excel" & TaskID2, "Sheet1")

      On Error GoTo 0

      ' Poke information into each instance of Excel

      DDEPoke Chan1, "R1C1", "This is Task1!"

      DDEPoke Chan2, "R1C1", "This is Task2!"

      DDETerminateAll

      Exit Function

   ExcelNotYetReady:

      DoEvents

      Resume

   End Function

REFERENCES

==========

Microsoft Access "Introduction to Programming," version 1.1, pages 139-147

Additional reference words: 1.00 1.10 2.00 Dynamic Data Exchange ADK


INF: How to Find a Record Using a Bound Control

 Article Number: Q105660

 CREATED: 22-OCT-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article demonstrates how to use a single bound control for both data

entry and for finding records in a form.

You can use this technique to find whether the value entered in a field

already exists in another record. If the value does exist, the record

containing that value will be displayed. If the value does not exist, you

can continue entering data for the new record.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual.

MORE INFORMATION

The Microsoft Access "User's Guide" demonstrates a method that you can use

to find records in your database by selecting a key value from a list. (See

"Finding a Record by Selecting a Value from a List".) This method is

limited in that it requires two controls. One control is an unbound control

that is used to select the value to look for, and the other control is a

bound control in which data entry for that value occurs.

The following example demonstrates how to use a single, bound control to

achieve the same functionality:

1. Open the sample database NWIND.MDB. Create a new module with the

   following declarations and functions:

   NOTE: In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

      ' *******************************************************

      ' DECLARATION SECTION

      ' *******************************************************

      Option Explicit

      Dim Found

      Function Find_BeforeUpdate ()

         Dim DS As Dynaset, C As Control

         Set C = Screen.ActiveControl

         Set DS = Screen.ActiveForm.Dynaset

         On Error Resume Next

         ' Try to find a record with a matching entry in

         ' the form's dynaset as a numeric field

         DS.FindFirst "[" & C.ControlName & "]=" & C

         ' If it was not a numeric field (error 3070) then

         ' try finding the record as a text field

         If Err = 3070 Then

            Err = 0

            DS.FindFirst "[" & C.ControlName & "]='" & C & "'"

         End If

         On Error GoTo 0

         ' If any unexpected error happened, present to user and exit

         If Err <> 0 Then

           MsgBox Error(Err), 48

           DoCmd CancelEvent

           Exit Function

         End If

         ' If we found a record, save the bookmark of the found record

         If DS.NoMatch Then

              Found = Null

         Else

              Found = DS.Bookmark

         End If

         ' If we found the record...

         ' .. Cancel the BeforeUpdate

         ' .. Undo changes made to the current record

         ' .. TAB to the next control to trigger the OnExit routine

         If Not IsNull(Found) Then

            DoCmd CancelEvent

            SendKeys "{ESC 2}{TAB}", False

         End If

      End Function

      Function Find_OnExit ()

         ' If we found the record, cancel the OnExit event to

         ' keep us in the control and go find the record

         If Not IsNull(Found) Then

            DoCmd CancelEvent

            ' Synchronize form record with found record

            Screen.ActiveForm.Bookmark = Found

            Found = Null

         End If

      End Function

2. Open the Categories form in Design view. Change the following

   properties for the Category ID field:

      BeforeUpdate: =Find_BeforeUpdate()

      OnExit: =Find_OnExit()

3. Switch to Form view. The first category that appears is the Beverages

   category. Type "COND" (without the quotation marks) in the Category ID

   field and press TAB or ENTER. Microsoft Access will automatically find

   and present the Condiments category record.

4. Type "NEW" (without the quotation marks) in the Category ID field and

   then press TAB or ENTER. Since this key value does not exist, no record

   is presented and you can continue to enter data for the new record.

How the Sample Functions Work

-----------------------------

The Find_BeforeUpdate() function uses the FindFirst method to search the

dynaset the form is based on to see if the value entered in the control

exists in the table.

If the value does not exist, the global variable Found is set to NULL and

the function exits. If the value does exist, the global variable Found is

set to the bookmark of the found record to be used by the Find_OnExit

function.

Before the FindRecord action can be run, the BeforeUpdate event must be

canceled, and a SendKeys action must send two ESC keys to undo changes to

the current record.

Next, a SendKeys action sends a TAB key to exit the field. This event

triggers the Find_OnExit() function, which checks to see if the find was

successful. If it was, the CancelEvent action is run to prevent exiting the

control, and then the form record is synchronized with the found record by

setting it's bookmark equal to the bookmark of the found record.

Found is then reset back to NULL.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 547-548

Microsoft Access "User's Guide," version 1.1, pages 551-552

Additional reference words: 1.00 1.10


PRB: Form Size Changes Not Retained

 Article Number: Q105661

 CREATED: 22-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you alter the size of a form in Design view, and then save and close the

form, when you open the form from the Database window, the size of the form

will not reflect the changes you made.

CAUSE

You sized the window that contains the form, not the form itself. A form

has its own dimensions independent of the size of the window the form is

displayed in, so that the form can be printed correctly no matter what size

the window is.

RESOLUTION

There are several methods of changing a form's size, including the

following:

 - Set the form's AutoResize property to No. This will cause the Form

   window to open to the size you set it to, rather than snapping to the

   size of the form contained within it.

 - Set the form's Width property to the width you want.

 - Set the form section's Height property to the height you want for that

   section.

 - Use the mouse to drag the right side of the form to make the form the

   width you want.

 - Use the mouse to drag the bottom of the form or section to make the form

   or section the height you want.

Note that you cannot size the width of the form narrower than the reach of

the rightmost control on the form. You cannot size the height of a section

shorter than the reach of the last control in the section.

NOTE: If you view the form in Form view directly from Design view, the Form

window will remain the same size it was in Design view. You can force the

Form window to snap to the size of the form by choosing Size To Fit Form

from the Window menu when you are viewing the form in Form view.

If you open the form in Form view from the Database window, the Form window

will snap to the size of the form automatically.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new, blank form. Note that the white area of the detail

   section is 5 inches wide and 1 inch tall.

2. Drag the Form window to make it narrower than 5 inches wide.

3. Save the form with any unique filename, and then close the form.

4. In the Database window, select the form and then choose Open.

The form will open 5 inches wide and 1 inch tall.

REFERENCES

==========

For more information on sizing forms, search for "sizing forms" using the

Microsoft Access Help menu.

Microsoft Access "Getting Started," version 1.1, pages 75 and 84

Microsoft Access "User's Guide," version 1.1, pages 261 and 263

Additional reference words: 1.00 1.10 2.00 resize


INF: How to Print Text to Default Printer with Access Basic

 Article Number: Q105662

 CREATED: 22-OCT-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

In Microsoft Access, there is no standard way of sending text to the

default printer without printing a form or report. This article

demonstrates a method of using Windows API functions to send text to the

printer.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0. This article

also assumes that you are familiar with programming in the Windows

environment. For more information on programming in the Windows environment

using API functions, please refer to the Microsoft Windows Software

Development Kit manuals.

MORE INFORMATION

Unlike Microsoft Visual Basic, Microsoft Access does not have a printer

object for sending text to the printer. The following example demonstrates

how to use Windows API functions to send text to the printer.

Notes

-----

 - This article does not describe the API function arguments. For details

   on the API functions, please refer to the Microsoft Windows Software

   Development Kit manuals.

 - You may have some Microsoft Windows API functions defined in an existing

   Microsoft Access library; therefore, your declarations may be

   duplicates. If you receive a duplicate procedure name error message,

   remove or comment out the declarations statement in your code. You

   should also alias any API function declarations. For more information on

   using aliases, search for "alias" then "declare statement" using the

   Microsoft Access Help menu.

 - In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

'-------------------------------------------------------------------

'Declaration Section

'-------------------------------------------------------------------

Option Compare Database   'Use database order for string comparisons

Option Explicit

Type DOCINFO

    cbSize As Integer

    lpszDocname As Long

    lpszOutPut As Long

End Type

Declare Function GetProfileString% Lib "Kernel" (ByVal lpAppName$, _

                    ByVal lpkeyname$, ByVal lpDefault$, _

                    ByVal lpReturnedString$, ByVal nsize%)

Declare Function CreateDC% Lib "GDI" (ByVal lpDriverName$, _

                    ByVal lpDeviceName$, ByVal lpOutput$, _

                    lpInitData As Any)

Declare Function DeleteDC% Lib "GDI" (ByVal hDC%)

Declare Function TextOut% Lib "GDI" (ByVal hDC%, ByVal X%, ByVal Y%, _

                    ByVal lpString$, ByVal nCount%)

Declare Function Mylstrcpy& Lib "Kernel" Alias "lstrcpy" ( _

                    ByVal lpString1 As Any, ByVal lpString2 As Any)

Declare Function StartDoc% Lib "GDI" (ByVal hDC%, lpdi As DOCINFO)

Declare Function StartPage% Lib "GDI" (ByVal hDC%)

Declare Function EndPage% Lib "GDI" (ByVal hDC%)

Declare Function EndDocAPI% Lib "GDI" Alias "EndDoc" (ByVal hDC%)

Declare Function Rectangle% Lib "GDI" (ByVal hDC%, ByVal X1%, _

                    ByVal Y1%, ByVal X2%, ByVal Y2%)

'-------------------------------------------------------------------

'Start of Function

'-------------------------------------------------------------------

Function Printer ()

   Dim lpReturnedString$

   Dim MyDoc As DOCINFO

   Dim MyDocumentname$

   Dim nPrinter, nDriver, nDevice

   Dim szDevice, szDriver, szOutPut

   Dim hDC%, X%, MyString$

   MyDocumentname$ = "My Document"

   '------------------------------------------

   ' Retrieve the currently selected printer as

   ' establish with the Control panel.

   ' Sample string as returned by lpReturnedString$:

   '

   '    HP LaserJet IIISi PostScript,pscript,LPT1:

   '------------------------------------------

   lpReturnedString$ = Space$(128)

   nPrinter = GetProfileString("windows", "device", ",,,", _

                 lpReturnedString$, Len(lpReturnedString$))

   '-----------------------------------------

   ' Parse the string of its three components

   '-----------------------------------------

   nDevice = InStr(lpReturnedString$, ",")

   nDriver = InStr(nDevice + 2, lpReturnedString$, ",")

   szDevice = Mid$(lpReturnedString$, 1, nDevice - 1)

   szDriver = Mid$(lpReturnedString$, nDevice + 1, nDriver - nDevice _

               - 1)

   szOutPut = Mid$(lpReturnedString$, nDriver + 1)

   '------------------------------------------

   ' Create the DOCINFO structure for StartDoc()

   '  - lpszDocname is name displayed in PRINTMAN

   '  - lpszOutPut is not used and set to NULL

   '------------------------------------------

   MyDoc.cbSize = Len(MyDoc)

   MyDoc.lpszDocname = Mylstrcpy(MyDocumentname$, MyDocumentname$)

   MyDoc.lpszOutPut = 0&

   '------------------------------------------

   ' Create the device context

   '------------------------------------------

   hDC% = CreateDC(szDriver, szDevice, szOutPut, 0&)

   X% = StartDoc(hDC%, MyDoc)

      X% = StartPage(hDC%)

      '------------------------------------------

      ' Rectangle arguments are X, Y, cX, cY

      '------------------------------------------

      X% = Rectangle(hDC%, 10, 10, 1000, 150)

      MyString$ = "Derek and Robyn are brother and sister!"

      '------------------------------------------

      ' Second and third arguments are the X and Y

      ' coordinates on paper.

      '------------------------------------------

      X% = TextOut(hDC%, 30, 20, MyString$, Len(MyString$))

      X% = EndPage(hDC%)

   X% = EndDocAPI(hDC%)

   '------------------------------------------

   ' Release the device context when done

   '------------------------------------------

   hDC% = DeleteDC(hDC%)

End Function

'-------------------------------------------------------------------

'End of Function

'-------------------------------------------------------------------

REFERENCES

==========

Microsoft Windows Software Development Kit "Guide to Programming,"

version 3.1, page 254-255

Microsoft Windows Software Development Kit "Programmer's Reference

Volume 2: Functions," version 3.1

Additional reference words: 1.00 1.10 2.00 ADK


INF: How to Use the CreateIniKeyValue Command in STFSETUP.IN_
INF: How to Use the CreateIniKeyValue Command in STFSETUP.IN_ [B_WAccADK]

 Article Number: Q105665

 CREATED: 22-OCT-1993

 VERSION(S):  MODIFIED: 09-DEC-1993

ENDUSER |

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SUMMARY

The STFSETUP.IN_ file is created by the SetupWizard and is used while your

application is being installed on a user's computer. This file includes a

command called CreateIniKeyValue that you can use to specify custom entries

in the application's .INI file.

MORE INFORMATION

You can use the CreateIniKeyValue command to add or modify entries in the

application's .INI file. For example, you may want to modify the ISAM

section in your application's .INI file. You can use the CreateIniKeyValue

command to modify the ISAM section of the application's .INI file to

reflect the location specified by the user during the installation process.

The following is a sample entry that will modify the location of the

PDX110.DLL file that might be installed for the Paradox ISAM dynamic link

library. Note that this is the [INI File] section of the STFSETUP.IN_ file:

NOTE: In the following example, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this

example.

[INI File]

CreateIniKeyValue, $(WindowsPath)$(IniFileName), "Installable ISAMs",_

               "Paradox 3.X", $(SystemPath)"PDX110.DLL", O

Exit

Note that there are several locations in the STFSETUP.IN_ file that already

use the CreateIniKeyValue command.

REFERENCES

==========

Microsoft Access "Distribution Kit Guide," page 52

Additional reference words: 1.10


INF: How to Find Access Basic Error Codes

 Article Number: Q105666

 CREATED: 22-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The Microsoft Access manuals do not contain a listing of all the error

codes and messages you can receive when you are running custom Access Basic

functions. To obtain the error codes and messages, you can run a custom

Access Basic function and use the Microsoft Access Help system.

MORE INFORMATION

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

There are approximately 700 error messages that can result from running

Access Basic code. To print a list of the error values and descriptions to

the Immediate window, add the sample function below to a module:

   Function PrintErrorStrings ()

      For i = 1 To 32767

         E$ = Error$(i)

         If E$ <> "User-defined error" And E$ <> "Reserved Error" Then

            Debug.Print i; Error$(i)

         End If

      Next i

   End Function

The following example demonstrates how to save the error code list in a

table:

1. Create a new table with the following fields. Save the table as Error

   Codes:

      Table Name: Error Codes

      -----------------------

      FieldName: Err

         DataType: Number

         FieldSize: Integer

      FieldName: Error

         DataType: Text

         FieldSize: 255

2. Revise the PrintErrorStrings() function as follows:

   Function PrintErrorStrings ()

      Dim MyDB As Database, MyTable As Table

      Set MyDB = CurrentDB()

      Set MyTable = MyDB.OpenTable("Error Codes")

      For i = 1 To 32767

         E$ = Error$(i)

         If E$ <> "User-defined Error" And E$ <> "Reserved Error" Then

            MyTable.AddNew

            MyTable![Err] = i

            MyTable![Error] = E$

            MyTable.Update

          End If

      Next i

      MyTable.Close

      MyDB.Close

   End Function

3. Type the following in the Immediate window, and then press ENTER:

   ? PrintErrorStrings()

The error codes and descriptions will be written to the Error Codes table.

The Microsoft Access Help system contains descriptions of the errors.

However, the error values are not in the Help system. To determine the

error value, match the description to the values returned by the

PrintErrorStrings() function.

REFERENCES

==========

For more information on error messages, search for "error messages:

reference" then "Error Messages Reference" using the Microsoft Access Help

menu.

Additional reference words: 1.00 1.10 2.00


PRB: RecordCount Property Returns Incorrect Number of Records

 Article Number: Q105976

 CREATED: 28-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The RecordCount property, when used with a dynaset or snapshot,

returns a recordset containing an incorrect number of records.

CAUSE

For dynasets and snapshots, Microsoft Access does not automatically

return the number of records that exist in the recordset. It returns

the number of records accessed.

RESOLUTION

To determine the exact number of records in a dynaset or snapshot, use

the MoveLast method before checking the RecordCount property.

MORE INFORMATION

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access.

The following Access Basic function, MyWrongRecordCount(), returns the

number 1 for the Customers table in the sample database NWIND.MDB

because only one record has been accessed. The MyRightRecordCount()

function uses the MoveLast method first to access all records in the

dynaset and then to return the RecordCount value.

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create a new module.

3. Add the following line of code to the Declarations section:

      Option Explicit

4. Create the following functions:

      '===========================================================

      ' The following function, MyWrongRecordCount(), demonstrates

      ' the incorrect way to use the RecordCount property to count

      ' records in a dynaset.

      '===========================================================

      Function MyWrongRecordCount ()

         Dim MyDB As Database, MyDyna As Dynaset

         Set MyDB = CurrentDB()

         Set MyDyna = MyDB.CreateDynaset("Customers")

         MyWrongRecordCount = MyDyna.RecordCount

         MyDyna.Close

      End Function

      '===========================================================

      ' The following function, MyRightRecordCount(), demonstrates

      ' the correct way to use the RecordCount property to count

      ' records in a dynaset.

      '===========================================================

      Function MyRightRecordCount ()

         Dim MyDB As Database, MyDyna As Dynaset

         Set MyDB = CurrentDB()

         Set MyDyna = MyDB.CreateDynaset("Customers")

         MyDyna.MoveLast

         MyRightRecordCount = MyDyna.RecordCount

         MyDyna.Close

      End Function

5. From the View menu, choose Immediate Window.

6. In the Immediate window, type the following and then press ENTER:

      ?MyWrongRecordCount()

   Note that the function returns 1.

7. In the Immediate window, type the following and then press ENTER:

      ?MyRightRecordCount()

   Note that the function returns the correct number of records in

   the Customers table.

REFERENCES

==========

Microsoft Access "Language Reference," versions 1.0 and 1.1, page 390

For more information on the RecordCount property, search for "RecordCount"

then "RecordCount Property" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 record count move last


PRB: Setting OnEnter to TAB and OnExit to SHIFT+TAB Loops

 Article Number: Q105977

 CREATED: 28-OCT-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you set the OnEnter property of text box on a form to run a macro that

sends a TAB, and you set the OnExit property of the text box to run a macro

that sends a SHIFT+TAB, an infinite loop situation will occur when the form

is viewed in Form view.

CAUSE

When the form is viewed in Form view, the text box control's OnEnter

property runs a macro that sends a TAB. The TAB triggers the control's

OnExit property, which runs a macro that sends a SHIFT+TAB. The SHIFT+TAB

triggers the OnEnter property again, and so on.

RESOLUTION

The macros are performing as they should. Press CTRL+BREAK to halt

execution of the macros.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create the following macros:

      Macro Name       Action

      -------------------------

      Tab              SendKeys

      ShiftTab         SendKeys

      Tab Actions

      --------------------

      SendKeys

         Keystrokes: {tab}

         Wait: No

      ShiftTab Actions

      ---------------------

      SendKeys

         Keystrokes: +{tab}

         Wait: No

2. Create a new form. Place two text boxes on the form.

3. Set the first text box's OnEnter property to Tab, and its OnExit

   property to ShiftTab.

4. View the form in Form view.

Additional reference words: 1.00 1.10 2.00 on enter exit


PRB: Record Sort Order Is Different Than Expected

 Article Number: Q105978

 CREATED: 28-OCT-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you view data in a datasheet, combo box, or list box, the record order

is different than you expect. For example, text fields may appear out of

alphabetical order or numeric fields may appear out of sequence.

CAUSE

Microsoft Access has two default sort orders, insertion order and primary

key order. These sort orders are used at different times, causing records

to appear to be sorted differently than you expect.

RESOLUTION

If you want to see the insertion order for a table with a primary key

field, remove the primary key from the table. For more information on

removing a primary key, search for "primary key" then "Deleting the Primary

Key" using the Microsoft Access Help menu.

If you want to store records in a different order than insertion order,

build a new table with a custom sort. To do this, use a make-table query

with a specified sort order. For more information on make-table queries,

see the Microsoft Access "User's Guide," Chapter 7.

STATUS

This behavior is by design.

MORE INFORMATION

Insertion order is the order in which records are entered and stored in a

table. This order may not be in alphabetical or numeric sequence, since

records are often entered in a random order.

Primary key order is based on the field or fields in a primary key. This

order has no effect on the way records are stored in a table; the records

are still stored in insertion order. Primary key order changes only the way

the records are displayed.

If the underlying table for a table, form, subform, or query datasheet has

no primary key, the data will be displayed in insertion order. If the table

has a primary key, the data will be displayed in primary key order.

There are two exceptions to this rule. For query datasheets, insertion

order will be used for a query that has specific criteria but no specific

sort order, even if the underlying table has a primary key. For combo boxes

and list boxes, insertion order is used even if the underlying table has a

primary key.

Steps to Reproduce Behavior

---------------------------

The following four examples demonstrate the two default record orders and

the two exceptions described above. Note that all the examples use the

sample database NWIND.MDB.

Viewing Records in Insertion Order:

1. Make a copy of the Categories table and save the copy as Categories2.

2. Open the Categories2 table in Datasheet view.

3. Add the following record:

      Category ID:  APPZ

      Category Name:  Appetizers

      Description:  <leave blank>

      Picture:  <leave blank>

Note the record order in the Category ID field. BEVR is the first record

and APPZ is the last. This is the order in which the records were added to

the table.

Viewing Records in Primary Key Order:

1. Create a new query based on the Categories2 table as follows:

      Field name: Category ID

      Sort: <leave blank>

      Show: True

      Criteria: <leave blank>

2. From the Query menu, choose Run.

Note that the query datasheet is sorted alphabetically by Category ID,

which is the primary key field.

Viewing Records in Insertion Order Despite a Primary Key:

1. Create a new query based on the Categories2 table as follows:

      Field name: Category ID

      Sort: <leave blank>

      Show: True

      Criteria: a* or s*

2. From the Query menu, choose Run.

The following records will be displayed:

   Category ID

   -----------

   SEAF

   APPZ

Note that SEAF appears before APPZ even though Category ID is a primary key

field. Microsoft Access is using insertion order because the query includes

specific criteria but no specific sort order.

Viewing Combo Box Items in Insertion Order:

1. Create the following new form:

      Form: Test1

         ControlSource: Unbound

2. Add the following combo box to the Test1 form:

      Combo box: Field1

         ControlSource: Unbound

         RowSourceType: Table/Query

         RowSource: Categories2

         ColumnCount: 2

         ColumnWidth: 1 in; 1 in

3. View the form in Form view.

4. View the items listed in the combo box.

Note that the items are displayed in the combo box in insertion order, even

though the underlying table has a primary key field.

Additional reference words: 1.00 1.10 2.00


PRB: Canceling a DoCmd Print Returns Error Messages

 Article Number: Q106181

 CREATED: 02-NOV-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Choosing Cancel to cancel printing that was started by a macro that

contains a function with a DoCmd Print A_Printall statement will return a

series of alert messages.

STATUS

This behavior is by design. It allows you to trap and test for execution

failure and cancellation as individual results.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

 1. Create a new module. Enter the following in the Declarations section:

       Option Explicit

       Function PrintTest()

          DoCmd Print A_PRINTALL,,,True

       End Function

 2. Save the module as Print Test Module.

 3. Create the following new macro:

       Action

       -------

       RunCode

       Macro Actions

       -----------------------------

       RunCode

          Function Name: PrintTest()

 4. Save the macro as Print Test Macro

 5. Open a new form in Design view.

 6. Add a command button to the form.

 7. Set the command button's OnPush property to Print Test Macro.

    NOTE: In version 2.0, the OnPush property is named OnClick.

 8. View the form in Form view. Choose the Print Test Macro button.

 9. Once printing begins, choose Cancel.

10. The message "Action Print Was Cancelled" will appear. Choose the OK

    button.

11. The Module Design window will be open to the PrintTest function. Close

    the Module Design window by selecting Close from the File menu. When

    you receive the message "Reset halted programs so Code window can be

    closed," choose OK.

12. The Action Failed dialog will be in the foreground, referring to the

    macro action. Choose the Halt button.

Additional reference words: 1.00 1.10 2.00


INF: Error Message Using AutoKeys Macro

 Article Number: Q106183

 CREATED: 02-NOV-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

If an invalid key combination is entered in an AutoKeys macro, the

following error message will occur:

   The key combination '<your key combination>' in 'AUTOKEYS' isn't

   valid and will be ignored.

MORE INFORMATION

Even though you entered a valid syntax for the key combination in the

AutoKeys macro, it still may not work. Only specific key combinations can

be used in AutoKeys macros. The following table lists valid key

combinations:

   SendKeys syntax example    Key combination

   ------------------------------------------------------

   ^A or ^4                   CTRL+any letter or number

   {F1}                       Any function key

   ^{F1}                      CTRL+any function key

   +{F1}                      SHIFT+any function key

   {INSERT}                   INS key

   ^{INSERT}                  CTRL+INS key

   +{INSERT}                  SHIFT+INS key

   {DELETE} or {DEL}          DEL key

   ^{DELETE} or ^{DEL}        CTRL+DEL key

   +{DELETE} or +{DEL}        SHIFT+DEL key

Macro actions can be assigned to key combinations using a special key-

assignment macro, which is normally called AutoKeys. To specify a different

name for this macro, type the macro name you want in the Key Assignment

Macro box, which is available by choosing Options from the View menu and

then selecting Keyboard.

When you open the database, Microsoft Access looks for a macro with the

name you entered. If the macro contains a key combination that is not in

the list above, you will receive the error message stated above.

Steps to Reproduce Behavior

---------------------------

1. Create a new macro.

2. Type "+Z" (without the quotation marks) in the macro name column.

3. Enter the set of actions you want this key combination to run. For

   example, try the MsgBox action.

4. Save the macro with the name AutoKeys. This is the default key

   assignment macro.

You will receive the error message:

   The key combination '+Z' in 'AUTOKEYS' isn't valid and will be

   ignored

REFERENCES

==========

For more information on AutoKeys, search for "Autokeys" using the Help

menu.

Additional reference words: 1.00 1.10 2.00 Auto Keys ADK


INF: Formatting Immediate IF (IIF) Statements in Reports

 Article Number: Q106184

 CREATED: 02-NOV-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

If a report that is based on a query contains a field that includes a null

value from an Immediate If (IIf) statement, you will not be able to

format the field properly on the report.

MORE INFORMATION

There are two ways to work around this behavior. The first method is to

format the IIf expression in the query. You can add a format statement to

the beginning of the IIf statement. For example, the following statement

would add formatting to the field:

   Format(IIF([freight] = 32.07,[freight],null),"$0.00")

The second method is to use the IIf statement on the report directly, and

not in the query. For example, you could add the following statement to the

ControlSource property of the expression field's text box:

   =Format(IIF([freight]=32.07,[freight],null),"$0.00")

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create the following new query based on the Customers and the Orders

   tables. Join the two tables on the Customer ID field. Save the

   query as TestIIF:

      Query: TestIIF

      ---------------------------------------------------

      Field: Company Name

      Field: Order ID

      Field: Freight

      Field: Shipped Date

      Field: MyField: IIf([freight]=32.07,[freight],null)

3. Use the ReportWizards to create a new single-column report based on

   the TestIIF query. Include all the fields on the report.

4. Choose Print Preview to verify that the MyField field is unformatted.

5. Choose Cancel to return to Design view. Try to format the field.

Additional reference words: 1.00 1.10 2.00


PRA: Cannot DDE Execute RunSQL Command with Brackets

 Article Number: Q106185

 CREATED: 02-NOV-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.1

---------------------------------------------------------------------

SYMPTOMS

You receive an error message indicating that the process has failed

when you use DDE from a DDE client application such as Microsoft Word for

Windows or Microsoft Excel to run the RunSQL macro action in Microsoft

Access version 1.1.

CAUSE

The SQL statement you are trying to run with the RunSQL command contains

square brackets. When Microsoft Access receives the command it assumes that

the first right square bracket marks the end of the command. For example,

the command

   UPDATE Employees SET [First Name] = 'Jim' WHERE [First Name] =

   'Andrew';

would be interpreted by Microsoft Access to be

   UPDATE Employees SET [First Name

which is not a complete command and cannot be run successfully.

RESOLUTION

The SQL command must be enclosed in double quotation marks in the DDE

execute string.

The SQL command in the example above could be successfully sent as:

   "[RunSQL "UPDATE Employees SET [First Name] = 'Jim' WHERE

   [First Name] = 'Andrew';"]"

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version

1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB.

2. With Microsoft Access still running, start Word for Windows.

3. Create and then run the following Word for Windows macro, which

   will use DDE to instruct Microsoft Access to change all first

   names in the Employees table that are Andrew to Jim:

      Sub MAIN

         SQL$ = "UPDATE Employees SET [First Name] = 'Andrew' "

         SQL$ = SQL$ + "WHERE [First Name]= 'Jim';"

         chan = DDEInitiate("MSACCESS", "System")

         DDEExecute chan, "[RunSQL " + SQL$ + "]"

         DDETerminate chan

      End Sub

The error message "WordBASIC Err=503 Process failed in other application"

will result.

To correct the problem, enclose the SQL statement in double quotation

marks, as follows:

Sub MAIN

   QT$ = Chr$(34)

   SQL$ = "UPDATE Employees SET [First Name] = 'Jim' "

   SQL$ = SQL$ + "WHERE [First Name]= 'Andrew';"

   chan = DDEInitiate("MSACCESS", "System")

   DDEExecute chan, "[RunSQL " + QT$ + SQL$ + QT$ + "]"

   DDETerminate chan

End Sub

REFERENCES

==========

For more information on using Microsoft Access as a DDE server, query on

the following words here in the Microsoft Knowledge Base:

   DDE and server and DoCmd

Microsoft Access "Language Reference," version 1.0, pages 149-150

Additional reference words: 1.00 1.10


PRA: Printing "Data Only" Prints Gridlines

 Article Number: Q106186

 CREATED: 02-NOV-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you are printing a form, datasheet, or report to a printer set up

to print Data Only, gridlines and other graphics print along with the

data.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Printing with the Data Only box selected in the Printer Setup dialog

box is supposed to print only the text data of a datasheet or report

and is supposed to leave out gridlines, graphics, borders, and so on,

so that you can print the text on preprinted forms. However, even when

the Data Only box is selected, gridlines and graphics are included

when printing.

Steps to Reproduce Problem

--------------------------

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. Open the Categories form.

3. From the File menu, choose Print, and then choose Setup.

4. In the Print Setup dialog box, select the Data Only check box.

5. In the Print dialog box, choose OK, and then choose OK again.

Note that gridlines and pictures print along with the text data.

REFERENCES

==========

For more information, search for "Print Setup Command" using the Help

menu.

Additional reference words: 1.00 1.10 Printing Grids


PRB: TransferDatabase Macro Action Does Not Replace Table

 Article Number: Q106187

 CREATED: 02-NOV-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SYMPTOMS

If you use a TransferDatabase macro action to transfer a

table with the

same name as an existing table in the destination database,

the existing

table will not be overwritten by the transferred table.

CAUSE

If the destination database contains a table with the same

name as the

table you are trying to transfer, Microsoft Access will give

the

transferred table a new name in the destination database.

The new name will

consist of the original table name plus a sequential number.

For example,

if you try to transfer a table named Categories to a

database that already

has a table with the same name, the newly transferred table

will be named

Categories1.

RESOLUTION

If you want to replace an existing table using a

TransferDatabase macro

action, you first need to rename or delete the existing

table in the

destination database.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

NOTE: The following example assumes that Microsoft Access is

installed in

the C:\ACCESS directory. If Microsoft Access is installed in

a different

directory on your computer, modify the example to refer to

your Microsoft

Access directory.

1. Before starting Microsoft Access, use the Microsoft

Windows File Manager

   to make a copy of the NWIND.MDB file. Name the copy

NWIND2.MDB, and

   place it in the Microsoft Access directory.

2. Start Microsoft Access. Open the sample database

NWIND.MDB.

3. Create the following new macro, and save it as Test1:

      Macro Name   Action

      -----------------------------

      Test1        TransferDatabase

      Test1 Actions

      -----------------------------------

      Transfer Type: Import

      Database Type: Microsoft Access

      Database Name: C:\ACCESS\NWIND2.MDB

      Destination:  Categories

      Structure Only: No

5. Run the macro by choosing Run from the Macro menu, and

then close

   the macro.

6. In the Database window, choose Table. Note that the

original

   Categories table still exists, and that a new Categories1

table has

   been added.

table in the

destination

Additional reference words: 1.00 1.10 ADK


PRB: ListTables Method Returns Odd Names

 Article Number: Q106188

 CREATED: 02-NOV-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SYMPTOMS

When you use the ListTables method to list table or QueryDef

names, you

may see odd names that are not objects in the Database

window. For example,

the ListTables method may return a name similar to

   Customer Mailing Labels0000

which is neither a table nor a QueryDef in your database.

There may be an

object with a similar name in the Database window, but no

actual table or

QueryDef with the same name.

CAUSE

The odd name is the name of a hidden query that was created

by running a

report. Although the QueryDef cannot be seen in the Database

window, it

does exist and will be found by the ListTables method.

RESOLUTION

Hidden QueryDefs are retained in the database until the

report is deleted

and you compact the database.

MORE INFORMATION

This article assumes that you are familiar with Access Basic

and with

creating Microsoft Access applications using the programming

tools provided

with Microsoft Access. For more information on Access Basic,

please refer

to the "Introduction to Programming" manual.

Steps to Reproduce Behavior

---------------------------

1. Create a new report and save it as Test1.

2. Run the Test1 report at least once.

3. Open a module and enter the following function:

'===========================================================

==

      ' The following function ListMyTables() can be run

from the

      ' Immediate window by typing "?ListMyTables()"

(without the

      ' quotation marks). It returns the Table/QueryDef name

      ' and TableType.

'===========================================================

==

         Function ListMyTables ()

            Dim MyDB As Database, MySnap As Snapshot

            Set MyDB = CurrentDB()

            Set MySnap = MyDB.ListTables()

            MySnap.MoveFirst

               Do Until MySnap.EOF

               Debug.Print MySnap.name & " " &

MySnap.TableType

               MySnap.MoveNext

            Loop

         End Function

4. Run the function in the Immediate window by typing:

      ? ListMyTables()

Note that "test100005" is returned in the Immediate window.

This is the

name of the hidden QueryDef created by the Test1 report.

If you delete the report, compact the database, and then run

the function

again, "test100005" will not be returned.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages

292-294

Additional reference words: 1.00 1.10


INF: "Incorrect Syntax Near '-'" Using TransferDatabase Action

 Article Number: Q106244

 CREATED: 03-NOV-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you are running a TransferDatabase macro action to attach a SQL

Server table, the following error message may be generated:

   Connection Failed. SQL State 37000. SQL Server Error 102. Incorrect

   Syntax Near '-'.

MORE INFORMATION

This error is generated because there is an error in the database name

argument, or connect string, of the TransferDatabase macro action.

The Microsoft Access Help system suggests that the connect string can be

copied from the table properties of the attached table. When you copy the

connect string into the database name argument, a string similar to the

following example is produced:

NOTE: In the following example, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this

example.

   ODBC;DSN=MyServer;UID=User2;APP=Microsoft Access;WSID=User2; _

   DATABASE=pubs-->-->dbo.authors

The syntax error is caused by the text after the "pubs" database name. All

text after the database name should be removed from the string, and the

table name should be moved to the source argument.

The following example demonstrates correct arguments for the

TransferDatabase action:

NOTE: In the following example, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this

example.

   Transfer Type:  ATTACH.

   Database Type:  <SQL DATABASE>.

   Database Name:  ODBC;DSN=MyServer;UID=User2;APP=Microsoft Access; _

                      WSID=User2;DATABASE=pubs

   Object Type:    TABLE

   Source:         DBO.AUTHORS

   Destination:    DBO_AUTHORS

   Structure Only: NO

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 472-474

Additional reference words: 1.00 1.10 2.00 import export transfer


INF: How To Compute Moving Averages in Access Basic

 Article Number: Q106245

 CREATED: 03-NOV-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The following sample Access Basic function computes a moving average for a

set of values in a table based on a given period of time. For example, if

you have data that has been collected weekly for the past year, and you

want to compute a historical average for a three-week time period on each

value, you can use this function to return an average for each value in the

table based on the current value and the values from the two previous

weeks.

MORE INFORMATION

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

The sample function below computes moving averages based on a table with a

multiple-field primary key. The weekly values of foreign currencies are

used for this example.

1. Create the following table. Save the table as Table 1.

      Table: Table 1

      ----------------------------------------

      FieldName: CurrencyType [Primary Key]

      DataType: Text

      Field Size: 25

      FieldName: TransactionDate [Primary Key]

      DataType: Date/Time

      Format: Short Date

      FieldName: Rate

      DataType: Currency

      Decimal Places: 4

2. View the table in Datasheet view, and enter the following values:

      CurrencyType     TransactionDate     Rate

      --------------------------------------------

      Yen              8/6/93              $0.0079

      Yen              8/13/93             $0.0082

      Yen              8/20/93             $0.0085

      Yen              8/27/93             $0.0088

      Yen              9/3/93              $0.0091

      Mark             8/6/93              $0.5600

      Mark             8/13/93             $0.5700

      Mark             8/20/93             $0.5800

      Mark             8/27/93             $0.5900

      Mark             9/3/93              $0.6000

3. Open a new module and enter the following functions:

      '*************************************************************

      'Declarations section of the module.

      '*************************************************************

      Option Explicit

      '===============================================================

      ' The following function MAvgs computes moving averages based on

      ' a table with a multiple field primary key.

      '===============================================================

      Function MAvgs (Periods As Integer, StartDate, TypeName)

         Dim MyDB As Database, MyTable As Table, MySum as double

         Dim i, x

         Set MyDB = CurrentDB()

         Set MyTable = MyDB.OpenTable("Table 1")

         On Error Resume Next

         MyTable.index = "PrimaryKey"

         x = Periods - 1

         ReDim Store(x)

         MySum = 0

         For i = 0 To x

           MyTable.MoveFirst

           MyTable.Seek "=", TypeName, StartDate

                'these two variables should be in the same order as the

                '  primary key fields in your table

            Store(i) =MyTable![rate]

            If i <> x Then StartDate = StartDate - 7

                '7 here assumes weekly data, you would use 1 for daily

                '  data

            If StartDate < #8/6/93# Then MAvgs = Null: Exit Function

                '#8/6/93# is replaced with the earliest date of the data

                '  in your table

            MySum = Store(i) + MySum

            Next i

         MAvgs = MySum / Periods

         MyTable.Close

      End Function

4. Create the following query based on Table 1:

      Query: Query1

      -----------------------------------------

      Field: CurrencyType

      Field: TransactionDate

      Field: Rate

      Field: Expr1: MAvgs(3,[CurrencyType],[TransactionDate])

   NOTE: This query will generate a 3-week moving average of the Rate data.

   To compute a longer or shorter moving average, change the "3" in the

   query's Expr1 column to the value you want to compute.

5. Run the query.

You will see a 3-week moving average for each currency. A null indicates

that there were not enough prior values to compute that week's average.

NOTE: If you want to compute a moving average for a table with a single

primary key, use the primary key both as an argument to be passed to the

function and as the key value for the Seek method.

Additional reference words: 1.00 1.10 2.00


PRA: Run-Time Error Occurs Calling Financial Functions

 Article Number: Q106246

 CREATED: 03-NOV-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

When you are calling financial functions, the following error message

occurs:

   A run-time error occurred in database: UTILITY. You don't have

   permissions to view modules in this database.

CAUSE

Although each function defined in the library has error trapping

enabled, the declaration for the SetUserError() subroutine does not

point to the correct dynamic link library (DLL).

RESOLUTION

You must change the UTILITY.MDA file using the procedure listed below.

This change will correct the declaration for the SetUserError()

subroutine, causing it to point to the correct DLL.

STATUS

This problem no longer occurs in Microsoft Access version 2.0, or in the

Microsoft Access Developer's Toolkit version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

In any module's Immediate window, run the following function by typing:

   ? Rate(27,5495,277512,189000,1,0.1)

You will receive the error message stated in the SYMPTOMS section.

Steps to Correct Problem

------------------------

 1. From the File menu, choose New Database to create a new, empty

    database. Type "junk.mdb" (without the quotation marks) in the

    File Name text box and choose OK.

 2. Close all instances of Microsoft Access.

 3. Open the MSACCESS.INI file located in the Windows directory using

    any text editor. (For example, use the Microsoft Windows Notepad

    text editor.)

 5. In the MSACCESS.INI file, locate the [OPTIONS] section. Comment

    out the UtilityDB line by placing a semicolon (;) at the beginning

    of the line.

 6. Add a new line to specify a new utility database called JUNK.MDB.

    The MSACCESS.INI file should now look like the following:

    NOTE: The drive and pathnames in your MSACCESS.INI file may differ

    from those listed in the example below.

       [Options]

       ;UtilityDB=D:\ACCESS.110\UTILITY.MDA

       UtilityDB=D:\ACCESS.110\JUNK.MDB

 7. Save the changes to the MSACCESS.INI file and close the text

    editor.

 8. Open Microsoft Access.

 9. From the File menu, choose Open Database. Type "utility.mda"

    (without the quotation marks) in the File Name text box and choose

    OK.

10. You may receive error messages. Bypass these messages and

    continue.

11. Open the Finance module.

12. Change the following line

    Declare Sub SetUserError Lib "MSABC100.DLL" (ByVal ErrCode As _

                   Integer)

    to:

    Declare Sub SetUserError Lib "MSABC110.DLL" (ByVal ErrCode As _

                   Integer)

    NOTE: In the declaration above, the underscore (_) is used as a

    line-continuation character to improve readability. Your code will

    appear on a single line without the underscore.

13. Save the changes to the Finance module. Close Microsoft Access.

14. Return the MSACCESS.INI file back to its original settings. The

    file should read:

    NOTE: The drive and pathnames in your MSACCESS.INI file may differ

    from those listed in the example below.

       [Options]

       UtilityDB=D:\ACCESS.110\UTILITY.MDA

15. Save the changes to the MSACCESS.INI file and close the text

    editor.

Additional reference words: 1.10


PRA: Error Using FormWizard with VGA Mono Driver

 Article Number: Q106247

 CREATED: 03-NOV-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The Main/Subform FormWizard generates an "Application Error" or general

protection (GP) fault when you create a form.

CAUSE

This problem occurs when you are using the Main/Subform FormWizard if you

have installed the VGA with Monochrome Display video driver (VGAMONO.DRV)

in Microsoft Windows.

RESOLUTION

Use the standard VGA video driver (VGA.DRV).

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Install the VGA with Monochrome Display video driver in Microsoft

   Windows.

2. Create a new form with the Main/Subform FormWizard.

The error will occur when you choose the Next button after selecting the

style for the form.

Additional reference words: 1.00 1.10 GPF


PRB: Empty Field List in Report or Form's Design View

 Article Number: Q106286

 CREATED: 04-NOV-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A blank field list appears when you are viewing an unbound form or report

in Design view.

CAUSE

A field list will appear automatically if it was displayed in the form or

report you last designed. If the current form or report is unbound, the

field list will be empty.

RESOLUTION

Close the field list. The Field List command on the View menu will become

unavailable until the form or report in Design view is bound.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB. Open the Categories form in

   Design view.

2. From the View menu, choose Field List. The field list will be displayed.

3. Close the form.

4. Open a new, unbound form in Design view.

An empty field list will be displayed.

Additional reference words: 1.00 1.10 2.00


INF: How to Return Records in a Many-to-Many Relationship

 Article Number: Q106287

 CREATED: 04-NOV-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The article demonstrates how to design a query to return the records from

one table in a many-to-many relationship where each of the records returned

is related to two records in the other table in the relationship. Note that

the many-to-many relationship between the two tables is broken into two

one-to-many relationships with a third (junction) table.

MORE INFORMATION

The following steps demonstrate how to create a sample query to return

records from one table in a many-to-many relationship as mentioned above:

1. Open the sample database NWIND.MDB.

2. Create the following new query based on the Order Details table:

      Query: Test

      ---------------------

      FieldName: Order ID

         Total: Group By

      FieldName: Product ID

         Total: Count

         Criteria: >1

      FieldName: Product ID

         Total: Where

         Show: False

         Criteria: 14 Or 21

Note that the use of the "14 or 21" query with a "Where" total on the

Product ID field returns only those order IDs that contain either one or

both of the products. The use of the ">1" query with a "Count" total on the

same field returns only records with both products.

Additional reference words: 1.00 1.10 2.00 ADK


INF: How to Use the IIf() (Immediate If) Function

 Article Number: Q106288

 CREATED: 04-NOV-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

You may receive unexpected results when you are using the IIf() (Immediate

If) function to evaluate an expression. Your results will depend on the use

of double quotation marks in the function's arguments.

MORE INFORMATION

The following example demonstrates how the use of double quotation marks in

the IIf() function's arguments can affect the results:

1. Open the sample database NWIND.MDB.

2. Create the following new query based on the Orders table:

      Query: Test

      ---------------------------------------

      FieldName: Sum(IIf("[Freight]>50",1,0))

         Total: Expression

3. Run the query. The result will be 1078 records, the total number of

   orders, not just those with a freight charge greater than 50.

4. View the query in Design view. Remove the double quotation marks so the

   query matches the following:

      Query: Test

      -------------------------------------

      FieldName: Sum(IIf([Freight]>50,1,0))

         Total: Expression

5. Run the query again. The result will be 447 records, which is the

   number of records with a freight charge greater than 50.

The double quotation marks around the "[Freight] > 50" argument caused

Microsoft Access to evaluate the expression as a string instead of as a

comparison. A string will always evaluate to true, while a comparison will

test for the condition to be met before returning a value.

Additional reference words: 1.00 1.10 2.00


PRA: GP Fault Closing Subform in Datasheet View

 Article Number: Q106289

 CREATED: 04-NOV-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

---------------------------------------------------------------------

SYMPTOMS

You receive a general protection (GP) fault when you close a form that

contains a subform that is being displayed in Datasheet view.

CAUSE

A macro that switches the subform between Datasheet and Form view is

assigned to the OnDblClick property of the subform.

RESOLUTION

Use the View menu to view the subform in Datasheet view, or switch the

subform to Form view before closing the form.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version

1.0. This problem no longer occurs in Microsoft Access version 1.1.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

WARNING: Reproducing this problem will cause a GP fault on your computer.

Make sure to save any open work on your computer before you reproduce this

problem.

1. Open the sample database NWIND.MDB.

2. Create the following new macro:

      Macro Name   Action

      -----------------------

      Switch       DoMenuItem

      Switch Actions

      --------------------------

      Menu Bar: Form

      Menu Name: View

      Command: Subform Datasheet

3. Open the Categories form in Design view. Double-click the Categories

   Subform subform to open it in Design view.

4. Set the subform's OnDblClick property to the Switch macro.

5. Close the subform, and then view the Categories form in Form view.

6. Double-click the Product ID field on the subform to switch it to Form

   view. Double-click the field again to switch the subform to Datasheet

   view.

7. Close the Categories form.

A GP fault will occur.


PRB: Using Format() and Month() Returns Incorrect Month

 Article Number: Q106290

 CREATED: 04-NOV-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

An incorrect result will be returned if you use the Format() function on

the result of a Month() function.

STATUS

This behavior is by design. The Month() function converts a date to an

integer. The Format() function is expecting a date serial number as an

argument, but instead receives an integer.

MORE INFORMATION

The following sample function will return January instead of April:

   Format$(Month(#4/30/93#), "mmmm")

To return just the name of the month, use the Format() function without the

Month() function. For example, the following example will return April:

   =Format(#4/30/93#,"mmmm")

If the Month() function is required, use the Choose() function to return

the name of the month. The following example demonstrates how to use the

Choose() function:

NOTE: In the following example, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating example.

   =Choose(Month([datefield]),"January","February","March","April",_

       "May","June","July","August","September","October","November",_

       "December")

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 65, 202-209,

and 310

Additional reference words: 1.00 1.10 2.00


PRA: User-Defined Formatting Symbols Erase Characters

 Article Number: Q106291

 CREATED: 04-NOV-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you use the "!" formatting symbol in your user-defined formats,

it erases the formatting in the third and fourth positions. For

example, if you have a user-defined format such as

   #;#;0;"None"

and you place the "!" formatting symbol at the beginning of the

user-defined format, you get:

   !#;#

RESOLUTION

To work around this problem, use the "*" formatting symbol at the end

of the appropriate section of the user-defined format.

The "!" formatting symbol is used to force left alignment instead of

right alignment. The "*" formatting symbol is used to fill available

space with the character following it.

If you use "*" followed by a space (" ") you get the same results as

using "!".

For example, if you have a user-defined format such as

   #;#;0;"None"

you can place an "* " formatting symbol at the end of the appropriate

section of the user-defined format to get

   #* ;#;0;"None"

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Create a text box on a form.

2. Set the format of the text box to:

      #;#;0;"None"

3. Commit the Format property by pressing TAB.

4. Add an exclamation point ("!") character to the front of the format

   property so that you have !#;#;0;"None" and then commit it by

   pressing TAB.

   The format changes to !#;#.

REFERENCES

==========

For more information on formatting symbols, search for "Format/Format

Property" using the Help menu.

Additional reference words: 1.00 1.10


PRA: Mouse Remains I-beam Over Text Box Scroll Bar

 Article Number: Q106292

 CREATED: 04-NOV-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The mouse pointer remains an I-beam instead of an arrow when the

Database window has the focus and you place the pointer over the

scroll bar of a multiline text box on a pop-up form.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Start Microsoft Access and open the sample database

   Northwind Traders (NWIND.MDB).

2. Open the Customers form in Design view.

3. Change the ScrollBars property of the address text box to Vertical.

4. From the View menu, choose Form.

5. Select the address text box.

6. Select the Database window.

7. Move the mouse pointer over the vertical scroll bar of the address

   text box.

   Note that the cursor remains an I-beam instead of turning to an

   arrow.

8. Close Microsoft Access without saving the changes to NWIND.MDB.

Additional reference words: 1.00 1.10 UI


INF: Aligning User-Defined Formats in Text Fields

 Article Number: Q106293

 CREATED: 04-NOV-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

The Format Property topic in the Microsoft Access Help system states the

following:

   NOTE When you create a user-defined format, the alignment defaults

   to right-aligned. Use an exclamation point to force left alignment.

This information is not true for fields with a text data type. Fields with

a text data type will be left-aligned.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Open the Suppliers table in Design view.

3. Select the Region field, and then enter the following user-defined

   format in the field's Format property:

      @;none

3. View the table in Datasheet view.

Note that the field is left-aligned. To right-align the field, use the

following sample user-defined format:

   /@;none

REFERENCES


PRA: TransferSpreadsheet Causes Error -1310

 Article Number: Q106294

 CREATED: 04-NOV-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you are importing or exporting to Microsoft Excel using the

TransferSpreadsheet macro action, the following error is generated:

   Reserved error (-1310); there is no message for this error.

CAUSE

When the table name is left blank in the TransferSpreadsheet Action,

Microsoft Access cannot determine the table to export.

RESOLUTION

To correct this, include a valid table or query that you want to import or

export in the "Table Name" argument.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Create a new macro named ExcelExport:

      ExcelExport Actions

      -------------------

      TransferSpreadsheet

         Transfer Type: Export

         Spreadsheet Type: Microsoft Excel

         Table Name: (leave blank)

         File Name: C:\ACCESS\TEST.XLS

         Has Field Names: Yes

         Range: (leave blank)

2. Run the Macro ExcelExport.

Additional reference words: 1.00 1.10


INF: How to Quickly Open the STFSETUP.IN_ File for Editing
INF: How to Quickly Open the STFSETUP.IN_ File for Editing [B_WAccADK]

 Article Number: Q106295

 CREATED: 04-NOV-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SUMMARY

It is often necessary to edit the STFSETUP.IN_ file when you are creating a

custom application with the Microsoft Access Distribution Kit. This article

describes two methods for quickly opening the STFSETUP.IN_ file for

editing.

MORE INFORMATION

The STFSETUP.IN_ file is a text file that can be edited with any text

editor, including the Microsoft Windows Notepad editor.

Method 1

--------

The first method of opening the STFSETUP.IN_ file for editing is to create

a file association for the STFSETUP.IN_ file that will automatically open

the file in the Notepad text editor.

The following example demonstrates how to create a file association for

files with .IN_ extensions:

1. Start the Microsoft Windows File Manager.

2. From the File menu, choose Associate.

3. Type "IN_" (without the quotation marks) in the Files With Extension

   box.

4. Type "notepad.exe" (without the quotation marks) in the Associate With

   box, and then choose OK.

To edit the STFSETUP.IN_ file you can either:

 - Double-click the STFSETUP.IN_ file in the File Manager.

   -or-

 - Choose Run from the File Manager or Program Manager's File menu, and

   then type the full path and filename for the .IN_ file.

Method 2

--------

The second method of opening the STFSETUP.IN_ file for editing is to

create an icon for the STFSETUP.IN_ file in the Microsoft Windows Program

Manager.

The following example demonstrates how to create an icon for the

STFSETUP.IN_ file:

1. Open or create the Program Manager group in which you want to create

   the new icon.

2. From the Program Manager's File menu, choose New.

3. Choose Item, and then choose OK.

4. Type "notepad.exe" (without the quotation marks), followed by the full

   path and filename for the STFSETUP.IN_ file in the Command Line box.

   For example, you might type the following in the Command Line box:

      notepad.exe C:\APPSETUP\DISK1\STFSETUP.IN_

5. Choose OK.

To edit the STFSETUP.IN_ file, double-click the new icon.

NOTE: The Notepad editor is used as an example throughout this article

because it is included with Microsoft Windows. However, you can use any

text editor in its place. If you do use the Notepad editor, the following

limitations should be observed:

 - Text files opened by Notepad should not be larger than 45K.

 - Notepad will not continue editing a text file that exceeds 45K

   during the editing process.

Additional reference words: 1.10 ADK


PRB: Control with Expression Shows up Blank in Form View

 Article Number: Q106296

 CREATED: 04-NOV-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A control that contains an expression appears blank in Form view.

However, if the control receives focus, the proper value appears. You

can tab to the control or click it with the mouse; once the cursor is

in the control, the correctly calculated value appears.

All bound controls on the form display their correct values at all

times.

CAUSE

This problem is often caused by an outdated or incompatible Windows

video driver.

RESOLUTION

Change the video driver to a standard driver included with Windows,

such as the 640 x 480 VGA driver.

MORE INFORMATION

Certain video driver incompatibilities can cause calculated controls

on a form to appear blank until the control receives focus. For

example, a text box with the following ControlSource appears empty in

Form view until you click the control with your mouse. Then the

correct value is displayed.

   ControlSource:=Date()

To test for video driver incompatibility, change the video driver that

Windows is currently using. For best results, change the video driver

to the standard 640 x 480 VGA driver included with Windows.

If the problem does not occur using the VGA driver, contact the video

card manufacturer and/or computer manufacturer for an updated video

driver.

For instructions on changing the video driver, refer to your Microsoft

Windows "Users Guide."

Additional reference words: 1.00 1.10 2.00


INF: How to Find Which Groups a User Belongs

 Article Number: Q106297

 CREATED: 04-NOV-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Microsoft Access has no built-in mechanism for finding which groups a user

belongs to. This article demonstrates a sample Access Basic function that

you can use to check if a user is a member of a specific group.

Notes

-----

 - The technique described below relies on the use of tables stored with

   your SYSTEM.MDA file. These tables are undocumented and are subject to

   change in future versions of Microsoft Access. Use of the system tables

   is not supported by Microsoft.

 - This article assumes that you are familiar with Access Basic and with

   creating Microsoft Access applications using the programming tools

   provided with Microsoft Access. For more information on Access Basic,

   please refer to the "Introduction to Programming" manual.

MORE INFORMATION

You can use the following sample function to check if a user belongs to a

specific group:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   '---------------------------------------

   'GLOBAL DECLARATIONS SECTION

   '---------------------------------------

   Option Explicit

   '---------------------------------------

   'Function: ug_Group()

   '---------------------------------------

   Function ug_Group (UserName As String, CheckGroup As Variant)

      Dim MyDB As Database, MyQueryDef As QueryDef, MySnap As Snapshot

      'Trap Error

       On Error GoTo ug_Group_Err

      'Verify CheckGroup is String or Null

       If VarType(CheckGroup) <> 1 And VarType(CheckGroup) <> 8 Then

         ug_Group = Null

         Exit Function

       End If

       Set MyDB = OpenDatabase("SYSTEM.MDA")

       Set MyQueryDef = MyDB.OpenQueryDef("MSysUserMemberships")

       MyQueryDef![UserName] = UserName

       Set MySnap = MyQueryDef.CreateSnapshot()

       'Check if CheckGroup = Null or String

       If IsNull(CheckGroup) Then

           If MySnap.BOF Then

               ug_Group = 0

           Else

               MySnap.MoveLast

               ug_Group = MySnap.RecordCount

           End If

       Else

             MySnap.FindFirst "[Name]='" & CheckGroup & "'"

             ug_Group = IIf(MySnap.NoMatch, False, True)

       End If

       MySnap.Close

       MyQueryDef.Close

       MyDB.Close

       Exit Function

   ug_Group_Err:

       ug_Group = "Error: " & Error

       Exit Function

   End Function

You can use the function ug_Group() to check if a user belongs to a

specific group, or to determine the total number of groups to which the

user belongs. You can specify any user in the SYSTEM.MDA file, or you can

dynamically determine the current user of the application.

The ug_Group() function uses the following arguments:

   Argument     Description

   ----------------------------------------------------------

   UserName     String expression of the user to be

                checked. Use the User() function to pass the

                current user.

   CheckGroup   Variant expression of the group to check

                if UserName is a member. A group name

                is passed as a String expression.

                Optionally, this value can be passed as null.

If the argument CheckGroup is a String, the function will return true (-1)

if the UserName is a member of CheckGroup, or will return false if the

UserName is not a member of CheckGroup.

If the argument CheckGroup is null, the function will return the number of

groups of which UserName is a member. If the UserName has not been defined

as a user in the SYSTEM.MDA file, the value 0 will be returned. Since all

users are members of the group Users, the function will return the value 1

if UserName is not a member of any other groups. The function will return a

value greater than 1 if UserName is a member of other groups. The value

returned will equal the total number of groups of which UserName is a

member.

If the argument CheckGroup is not a String or null, the function will

return null.

If an error occurs within the function, a description of the error will be

returned.

For example, assume the following users and groups have been created:

   Users: Donald, Jeanie, and Chelsea

   Groups: People and Pets

   Donald is a member of the groups People and Users.

   Jeanie is a member of the groups People and Users.

   Chelsea is a member of the groups People, Pets, Users, and Admins.

Also assume that Chelsea is currently logged into Microsoft Access.

Type the following examples in an Immediate window and note the results.

Remember that -1 equals true and 0 equals false:

   Example:    ? ug_Group( User(), "Admins" )

   Response:   -1

   Meaning:    Chelsea is a member of Admins.

   Example:    ? ug_Group( "Donald", "Pets" )

   Response:   0

   Meaning:    Donald is not a member of Pets.

   Example:    ? ug_Group( "Jeanie", NULL)

   Response:   2

   Meaning:    Jeanie is a member of two groups.

REFERENCES

==========

Microsoft Access "User's Guide," Chapter 25

Microsoft Access "Language Reference," page 489

Additional reference words: 1.00 1.10 ADK


INF: How To Determine if a Record Is Being Edited

 Article Number: Q106298

 CREATED: 04-NOV-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

In Microsoft Access version 1.x, there is no built-in functionality to

determine if the current record on a form is "dirty," or being edited. This

article demonstrates a method of determining if the current record is being

edited.

Note that in Microsoft Access version 2.0, you can use the Dirty property

to determine if a record is being edited.

MORE INFORMATION

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual.

When you are editing a record, the record selector on the left side of the

form becomes a pencil. The pencil indicates that changes have been made to

the record that have not yet been saved.

If the record is being edited, and you try to save it, Microsoft Access

will run the form's BeforeUpdate event before saving the record. Microsoft

Access will not run the BeforeUpdate event if the record is not dirty.

The following example demonstrates how to test whether Microsoft Access

needs to run the BeforeUpdate event to determine whether the record is

dirty:

1. Create a new Access Basic module with the following functions and

   Declarations section:

      *********************

      Declarations Section

      *********************

      Option Explicit

      Dim FormToTest As Form

      Dim fNotDirty

      *********************

      Function IsDirty()

      *********************

      Function IsDirty (F As Form)

         ' Store the form to test

         Set FormToTest = F

         ' Set the flag indicating we want to test to see

         ' if the form is dirty or not

         fNotDirty = True

         ' Activate the form so the DoMenuItem will work

         DoCmd SelectObject A_FORM, F.FormName

         ' Save the current record to see if BeforeUpdate event fires

         On Error Resume Next

         DoCmd DoMenuItem A_FORMBAR, A_FILE, A_SAVERECORD

         ' If record is dirty, control goes to TestIsDirty function

         ' Return the flag result; if dirty, TestIsDirty will have

         ' fired and toggled the flag to False and will have

         ' canceled the save record (BeforeUpdate) event.

         IsDirty = Not fNotDirty

         ' Reset the flag

         fNotDirty = False

      End Function

      **********************

      Function TestIsDirty()

      **********************

      Function TestIsDirty ()

         ' If flag is set, we are testing for Edit Mode

         If fNotDirty Then

            ' Indicate we are testing for Edit Mode

            TestIsDirty = True

            ' Toggle the flag to indicate to IsDirty that

            ' the form is, in fact, dirty

            fNotDirty = False

            ' Cancel the BeforeUpdate event

            DoCmd CancelEvent

            ' Control goes back to IsDirty function

        End If

      End Function

2. Open the form you want to test in Design view and examine the form's

   BeforeUpdate property. If the BeforeUpdate property is empty, add the

   following line to the property:

      =TestIsDirty()

   If the BeforeUpdate property has a macro listed, open the macro and add

   the following action as the first action to be executed in the macro or

   the macro group. This action must appear above any other actions in the

   macro or group:

      Condition       Action

      -------------------------

      TestIsDirty()   StopMacro

   If the BeforeUpdate property has an Access Basic function listed, open

   the function and add the following Access Basic statement as the first

   line in the function. This statement must run before any other statement

   in the function:

      If TestIsDirty() Then Exit Function

3. Call the IsDirty() function to test whether the record is dirty. With

   the form open in Design view, open an Immediate window and type the

   following, where <FormName> is the name of your form:

      ?MsgBox (isdirty(Forms!<FormName>))

   A message box will display either a 1 (the form is dirty) or a 0 (the

   form is not dirty).

How to Use the IsDirty() Function with a Command Button

-------------------------------------------------------

The following example demonstrates how to add a command button to a form

that you can use to determine if the current record is being edited:

1. Open the sample database NWIND.MDB. Open the Categories form in Design

   view, and make the changes listed above to the BeforeUpdate event. In

   step 2, modify the Validate Primary Keys.Categories macro so that the

   first lines of the macro are as follows:

      Macro Name     Condition        Action

      -----------------------------------------

      Categories

                     TestIsDirty()    StopMacro

2. Create a new Access Basic function called IsCategoriesFormDirty() or a

   new macro called IsCategoriesFormDirty. Note that the function is the

   preferable method, as the macro method requires IsDirty() to run twice.

   To use the function method, create the following Access Basic function:

      Function IsCategoriesFormDirty ()

         If IsDirty(Forms!Categories) Then

            MsgBox "Dirty!"

         Else

            MsgBox "Not Dirty!"

         End If

      End Function

   To use the macro method, create the following macro:

      Condition                      Action    Described Below

      --------------------------------------------------------

      IsDirty(Forms!Categories)      MsgBox          1

      Not IsDirty(Forms!Categories)  MsgBox          2

      IsCategoriesFormDirty Macro Actions

      -----------------------------------

      1. MsgBox

            Message: Dirty!

      2. MsgBox

            Message: Not Dirty!

3. Create a new button on the Categories form with the following

   properties:

      Caption: Is Dirty?

      OnPush: =IsCategoriesFormDirty()

   NOTE: If you use the macro method, the OnPush property should be set to:

      OnPush: IsCategoriesFormDirty

4. Open the Categories form in Form view.

5. Click the Is Dirty? button. The result will be "Not Dirty!" since the

   record is not being edited.

6. Modify any field in the record, and then click the Is Dirty? button. The

   result will be "Dirty!" since the record is being edited.

7. From the Edit menu, choose Undo Record. Click the Is Dirty? button. The

   result will be "Not Dirty!"

Additional reference words: 1.00 1.10


INF: How to Use Custom Colors in Microsoft Access

 Article Number: Q106299

 CREATED: 04-NOV-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article describes how to use colors that are not available on the

color palette for forms and reports in Microsoft Access version 1.x.

In Microsoft Access version 2.0, you can use the Color Builder to create

custom colors for your forms and reports. For more information, search for

"custom colors" using the Help menu in Microsoft Access 2.0.

MORE INFORMATION

Microsoft Access 1.x can use any of the colors available to Microsoft

Windows. Custom colors that you create in Windows can be created in

Microsoft Access as well. The following example demonstrates how to use a

custom color in Microsoft Access 1.x:

 1. In the Microsoft Windows Control Panel, choose the Colors Icon.

 2. Choose Color Palette.

 3. Choose Define Custom Colors.

 4. Pick the color you want by clicking in the large color square in the

    Custom Color Selector dialog box.

 5. Note the numbers next to the Red, Green, and Blue boxes. Write these

    numbers down in order (for example, Red=233, Green=44, Blue=99).

 6. Choose Close to close the Custom Color Selector dialog box, and then

    close the Control Panel.

 7. Start Microsoft Access.

 8. Open the database that contains the form or report you want to change.

 9. Create a new module. From the View menu, choose Immediate Window.

10. In the Immediate window, type the following, and then press ENTER:

    NOTE: This example uses the numbers from step 5. Substitute your own

    custom color numbers for these numbers.

       ?RGB(233,44,99)

11. Note the number that is returned in the Immediate window. This number

    is a Long integer representing your custom color. In this example,

    the value returned is 6499561.

12. Open the form or report you want to change in Design view.

13. Select the object you want to assign the custom color to.

14. Set the object's Color property to the value noted in step 11.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 310-312

Microsoft Access "User's Guide," version 1.1, pages 314-316

Additional reference words: 1.00 1.10 ADK


PRA: DDEInitiate from Word Fails When Access Not Running

 Article Number: Q106300

 CREATED: 04-NOV-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you attempt to initiate a DDE conversation from Microsoft Word to

Microsoft Access, the DDEInitiate function will fail if Microsoft

Access is not already running.

CAUSE

If the DDE connect request is sent by Microsoft Word before Microsoft

Access is fully initialized, the connect request is rejected.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Enter the following code in a new macro in Microsoft Word:

      iChan = DDEInitiate("MSAccess", "System")

      DDETerminate iChan

2. Save and run the macro. Be sure that Microsoft Access is in the

   PATH statement in the AUTOEXEC.BAT file, but not currently running.

3. Answer Yes to the message:

      The remote data (System) is not accessible. Do you

      want to start the application MSAccess?

You get the error message:

   WordBASIC Err=500

   Cannot Initiate Link

Additional reference words: 1.00 1.10


PRA: Erroneous "Lost Records" Error on Delete Query

 Article Number: Q106301

 CREATED: 04-NOV-1993

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

When you attempt to delete records from a table that has referential

integrity with another table, you get the following error message

   <n> records were lost due to key violations...

where <n> is the number of records in the dynaset. This error appears

even though no records were lost or deleted from the table.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

versions 1.0 and 1.1. We are researching this problem and will post

new information here in the Microsoft Knowledge Base as it becomes

available.

MORE INFORMATION

Referential integrity rules preserve defined relationships between

tables when you enter or delete records. If you enforce referential

integrity, Microsoft Access prohibits you from adding records to a

related table for which there is no primary record, changing values in

a primary table that would result in orphan records in a related

table, or deleting records from a primary table when there are

matching related records.

When you attempt to delete records from a related table that has

referential integrity with a primary table, Microsoft Access will not

delete the records. You will instead get the erroneous error message

stated above.

Steps to Reproduce Problem

--------------------------

1. Start Microsoft Access and open the sample database Northwind

   Traders (NWIND.MDB).

2. Establish referential integrity between the Orders and Order

   Details tables. To do this, select the Orders table in the table

   list and then choose Relationships from the Edit menu.

3. From the Related Table box, select Order Details, and then select

   the Referential Integrity check box.

4. Create a new query, add the Orders table, and choose Delete from

   the Query menu.

5. Drag the asterisk from the Orders table to the Query-by-Example

   (QBE) grid. This sets up the query to delete all records from the

   Orders table.

6. From the Query menu, choose Run.

7. You will get the message "1078 row(s) will be deleted." Choose the OK

   button.

   The query will run and you will get the error message:

      Errors were encountered: The contents of fields in 0 records

      were deleted, 1078 records were lost due to key violations,

      and 0 records were locked and couldn't be modified. Proceed

      anyway?

   However, no records were lost or deleted.

8. Close Microsoft Access without saving the changes to NWIND.MDB.

Additional reference words: 1.00 1.10


PRB: Datasheet Fields Ignore Show or Hide Settings

 Article Number: Q106302

 CREATED: 04-NOV-1993

 MODIFIED: 05-NOV-1993

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

When you are viewing a form in Datasheet view, fields will ignore the

show or hide setting you have chosen. Instead, the setting for the

field's Visible property will control whether the field shows or is

hidden.

In other words, if you set a field's Visible property to No (which

makes the field invisible), then attempt to show the field by choosing

Show Columns from the Layout menu, the setting is ignored and the

field remains invisible.

CAUSE

This behavior is by design. The Datasheet view's show or hide setting

is independent of the Form view's Visible property setting.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access and create a new database.

2. Create a new form (Form1) and place two text box controls on it

   (Field0 and Field2).

3. Set the Visible property of the second text box (Field2) to No.

4. View the form in Form view. Note that Field2 is not visible.

5. View the form in Datasheet view.

6. From the Layout menu, choose Show Columns, and show Field2. Note

   that the Field2 column appears in the datasheet.

7. View the form in Form view.

Note that the second text box control (Field2) is still hidden.

Additional reference words: 1.00 1.10 Forms Hiding


INF: How to Use an Analyzer Table in a Word for Windows Table

 Article Number: Q106303

 CREATED: 04-NOV-1993

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article describes how to paste Microsoft Access Database Analyzer

output into a Microsoft Word for Windows text table so it can be more

easily edited into "data dictionary" format.

MORE INFORMATION

If you have not already installed the Microsoft Access Database Analyzer,

do so by following the directions in the following text file:

 - For Microsoft Access version 1.0, follow the directions in the

   PSSKB.TXT file.

   -or-

 - For Microsoft Access version 1.1, follow the directions in the

   ANALYZER.TXT file.

Once you have installed the Database Analyzer, you can use the following

example to paste analyzer output into Word for Windows:

1. Run the Database Analyzer. A table will be created in your database.

2. Open the table created by the Database Analyzer.

3. From the Edit menu, choose Select All Records, and then choose Copy from

   the Edit menu.

4. Open or switch to the Word for Windows document into which you want

   to paste the table.

5. From the Edit menu, choose Paste.

6. Select the information you just pasted into the document, and then

   choose Convert Text To Table from the Table menu.

7. Place the insertion point in the Table Name column, and then choose

   Select Column from the Table menu. Delete the column by choosing

   Delete Columns from the Table menu.

8. Change the table headings as follows:

      Old heading       New heading

      -----------------------------

      Name              Field Name

      Type              Data Type

      Length            Length

      IndexName         Comments

9. Size the column widths as needed.

You can use the comments column for descriptions of the fields in the

table.


INF: How to Quickly Delete Multiple Tables

 Article Number: Q106304

 CREATED: 04-NOV-1993

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

In some situations you may want to quickly delete multiple

tables,

rather than deleting them one at a time.

For example, when you import data from another product, an

error table

may be created. After several imports, you may have several

old import

error tables to delete.

Below are two methods of quickly deleting multiple tables.

The first

method allows you to bypass the delete confirmation screen.

The second

method uses a function that deletes all tables that begin

with "Import

Errors," and is particularly useful when the same table type

must be

deleted often.

MORE INFORMATION

Method 1

--------

You can bypass the "Delete table <tablename>?" delete

confirmation

screen by pressing SHIFT+DEL instead of just DEL.

For example, if you select a table named Test and then press

DEL to

delete the table, you will get the message:

   Delete table Test?

If you choose OK, the table will be deleted. However, if you

select

the table named Test and then press SHIFT+DEL to delete the

table,

the table is instantly deleted with no delete confirmation

screen.

Method 2

--------

To do a bulk deletion of tables with a certain name, you can

use an Access

Basic function. The sample function below is written

specifically to delete

import error tables. To delete other tables, you can change

the name to the

name of the tables you want to delete. The function must be

called by an

event such as a button press:

   Function DeleteImportErrorTables ()

      On Error GoTo ResetEnv

      Dim MyDB As Database, MySnapShot As Snapshot

      If MsgBox("Delete Import Error Tables?", 292) = 7 Then

         On Error GoTo 0

         Exit Function

      End If

      Set MyDB = CurrentDB()

      Set MySnapShot = MyDB.ListTables()

      DoCmd Echo False        ' Turn off screen updates.

      DoCmd SetWarnings False ' Turn off warning messages.

      Do Until MySnapShot.EOF

         If MySnapShot.[Name] Like "Import Errors*" Then

            DoCmd SelectObject A_TABLE, MySnapShot.Name,

True

            DoCmd DoMenuItem A_DATABASE, A_EDIT, A_DELETE

         End If

         MySnapShot.MoveNext

      Loop

      DoCmd SetWarnings True ' Be sure to set SetWarning

back on!

      DoCmd Echo True        ' Be sure to turn screen

updating back on!

   Exit Function

   ResetEnv:

      DoCmd SetWarnings True ' Be sure to set SetWarning

back on!

      DoCmd Echo True        ' Be sure to turn screen

updating back on!

      Exit Function

   End Function

Additional reference words: 1.00 1.10 Erasing


INF: How to Calculate the Nth Root of a Number

 Article Number: Q106305

 CREATED: 04-NOV-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

To find the nth root of a number, raise that number to the power of 1/n.

The general form of the equation is

   <num>^(1/<n>)

where <num> is the number whose root you want to find, and <n> is the root.

This equation can be used anywhere in Microsoft Access that expressions are

allowed.

MORE INFORMATION

The following example demonstrates how to use the equation described

above:

1. Create the following new table:

      Table: Table1

      ----------------------

      FieldName: Number

         DataType: Number

         Field Size: Double

      FieldName: Root

         DataType: Number

         Field Size: Integer

2. Save the table, and then view it in Datasheet view. Add the following

   records to the table:

      Number      Root

      ----------------

        8          3

       16          4

       32          5

      243          5

3. Create the following new query based on Table1:

      Query: Query1

      ---------------------------------

      Type: Select Query

      Field: Number

         Table: Table1

      Field: Root

         Table: Table1

      Field: Expr1: [Number]^(1/[Root])

4. Run the query.

REFERENCES

==========

Microsoft Access "User's Guide," page 644

Microsoft Access "Language Reference," page 24

Additional reference words: 1.00 1.10 2.00 exponential square cube


PRB: Wide Subform Does Not Scroll to Show Active Control

 Article Number: Q106306

 CREATED: 04-NOV-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The insertion point disappears when you are using the TAB key to move among

the controls on a subform that is wider than the main form window or the

screen.

CAUSE

When you move from one control to another on a form, the form updates the

screen to display the active control, and scrolls the window if necessary.

However, a subform is a single control on a form, and it will remain

selected while the insertion point is anywhere within it. The screen will

not scroll to show the active control in a subform because the subform

itself is considered to be the active control. Note that this behavior does

not apply to subforms in Datasheet view.

RESOLUTION

Use the horizontal scroll bar to see the active control on the subform.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

 1. Create a copy of the sample database NWIND.MDB, and then open the

    copy in Microsoft Access.

 2. Open the Categories Subform form in Design view.

 3. Change the DefaultView property from Datasheet to Single Form.

 4. Change the width of the form to 16 inches.

 5. Drag the Quantity Per Unit text box to the right edge of the form.

 6. Save and then close the form.

 7. Open the Categories form in Design view.

 8. Change the form's width to 17 inches.

 9. Change the width of the embedded subform object to 16 inches.

10. Save the Categories form, and then view it in Form view.

11. Use the TAB key to move through the fields on the form. Note that when

    the insertion point moves from the Unit Price field to the Quantity Per

    Unit field, the insertion point disappears off the screen.

Additional reference words: 1.00 1.10 lost invisible pointer ADK


PRA: Combo or List Box Column Not Formatted

 Article Number: Q106307

 CREATED: 04-NOV-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

A column in a combo or list box displays information without the formatting

you specified for the field in the underlying table or query.

CAUSE

Microsoft Access does not use the format specified in the Format property

for a field in a table or query when the data is being displayed in a combo

or list box. Information contained in a table field will be displayed with

the default format for the data type when the data is being displayed in a

combo or list box. For example, Date/Time fields will display with the

General Date format, and numbers will display with the General Number

format.

RESOLUTION

Base the combo or list box on a query, and format the field using the

Format() function in a calculated query. The following example demonstrates

how to use the Format() function in a query to format a field:

1. Open the sample database NWIND.MDB.

2. Create the following new query based on the Orders table:

      Query: Order Date Query

      -------------------------------------------------------------

      Type: Select Query

         Field: New Order Date: Format([Order Date], "Medium Date")

         Table: Orders

3. Run the query. Note that the date is formatted with the Medium Date

   format.

4. Save the query as Order Date Query, and then close the query.

5. Create a new, blank, unbound form. Add a combo box with the

   following properties:

      Combo Box: Order Dates

      ---------------------------

      RowSourceType: Table/Query

      RowSource: Order Date Query

      ColumnCount: 1

6. View the form in Form view.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create the following new query based on the Orders table:

      Query: Order Date Query

      -----------------------

      Type: Select Query

      Field: Order Date

         Table: Orders

3. Run the query. Note that the date is formatted with the Medium Date

   format.

4. Save the query as Order Date Query, and then close the query.

5. Create a new, blank, unbound form. Add a combo box with the

   following properties:

      Combo Box: Order Dates

      ---------------------------

      RowSourceType: Table/Query

      RowSource: Order Date Query

      ColumnCount: 1

6. View the form in Form view.

Note that the date is displayed with the General Date format.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 126-128

Microsoft Access "User's Guide," version 1.1, pages 130-132

Microsoft Access "Language Reference," version 1.0, pages 202-219

Additional reference words: 1.00 1.10 listbox combobox ADK


PRB: List Box Displays #Error

 Article Number: Q106308

 CREATED: 04-NOV-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

A list box that is filled by a list function displays one row with

the following text:

   #Error

CAUSE

There are no elements to display in the list box. Microsoft Access

displays the #Error row to show the user that it cannot display any

elements.

RESOLUTION

To work around this situation, return -1, rather than zero, as the

number of elements to display.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools

provided with Microsoft Access. For more information on Access Basic,

please refer to the "Introduction to Programming" manual.

The code below shows how to handle the case in which there are no rows

to display within the list box. For "Case 0," use an If statement to

determine if there are any records to show; if there are not, set the

return value to -1.

   Option Explicit

   Function MyList (fld As Control, id, row, col, code)

      Static Entries

      Dim ReturnVal

      ReturnVal = Null

      Select Case code

         Case 0

            Entries = 0

            dbs(Entries) = Dir("C:\WINNT\*.INI")

            Do Until dbs(Entries) = "" Or Entries >= 127

               Entries = Entries + 1

               dbs(Entries) = Dir

            Loop

            ' If there are no entries to display, set the

            ' results to -1 so that #error, and horizontal

            ' scroll bar do not show and also so that the

            ' user cannot select any blank row in the list box.

            If Entries = 0 Then

               ReturnVal = -1

            Else

               ReturnVal = Entries

            End If

         Case 1

            ReturnVal = Timer

         Case 3

            ReturnVal = Entries

         Case 4

            ReturnVal = 1

         Case 5

            ReturnVal = -1

         Case 6

            ReturnVal = dbs(row)

         Case 9

       End Select

       MyList = ReturnVal

   End Function

REFERENCES

==========

Microsoft Access "Introduction to Programming," page 82

Additional reference words: 1.00 1.10 pound pounderror


INF: DLookup() Usage, Examples, and Troubleshooting Tips

 Article Number: Q108098

 CREATED: 05-DEC-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to use the DLookup() function, and includes

examples and tips on usage.

The following topics are addressed in this article:

 - The DLookup() function syntax and usage

 - DLookup() function examples:

    - A function with no criteria

    - Specifying numeric criteria

    - Specifying numeric criteria that comes from a field on a form

    - Specifying textual criteria

    - Specifying textual criteria that comes from a field on a form

    - Specifying date criteria

    - Specifying multiple fields in the criteria

 - Tips for troubleshooting and debugging DLookup() expressions

Note that many difficulties in using the DLookup() function result from

failing to set up and supply the criteria expression correctly. The

criteria expression is common to many other aggregate functions, such as

DSum(), DFirst(), DLast(), DMin(), DMax(), and DCount(). Therefore, the

following material can be useful in helping to understand those domain

aggregate functions as well as the DLookup() function.

MORE INFORMATION

The DLookup() Function Syntax and Usage

---------------------------------------

The DLookup() function can be used in an expression or in an Access Basic

function to return a field value in a domain, or specified set of records.

The syntax of the DLookup() function is:

   DLookup(Expression, Domain [, Criteria] )

The function has three arguments: the expression, the domain, and the

criteria. (Note that the criteria argument is optional.)

The expression argument is used to identify the field that contains the

data in the domain that you want returned, or it can perform calculations

using the data in that field.

The domain argument is the name of the record set that identifies the

domain. It can be a table or a query name.

The criteria argument is an optional string expression that is used to

restrict the range of the data that the DLookup() function is performed on.

Note that the criteria argument is identical to the WHERE clause in an SQL

expression (except that you do not use the keyword WHERE).

The DLookup() function returns one value from a single field even if more

than one record satisfies the criteria. If no record satisfies the

criteria, or if the domain contains no records, DLookup() will return null.

DLookup() Function Examples

---------------------------

The following examples demonstrate how to use DLookup() to find or return

values from a table or query. These examples refer to the sample database

NWIND.MDB and can be entered in the ControlSource property of a text box on

a form or report.

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

A Function with No Criteria:

This example demonstrates how to use DLookup() in its simplest form,

without any criteria specified. This example, which refers to the Orders

form, returns the value contained in the Last Name field of the first

record in the Employees table:

   =DLookUp("[Last Name]", "Employees")

NOTE: Field names in expressions need to be enclosed in brackets ([]). The

table or query name in the domain does not need to be enclosed in brackets.

Specifying Numeric Criteria:

To find the last name of the employee with ID number 7, specify a criteria

to limit the range of records used:

   =DLookUp("[Last Name]", "Employees", "[Employee ID] = 7")

Specifying Numeric Criteria That Comes from a Field on a Form:

If you do not want to specify a particular value in the expression (as in

the example above), use a parameter in the criteria instead. The following

examples demonstrate how to specify criteria from another field on the

current form:

   =DLookUp("[Last Name]", "Employees", _

         "[Employee ID] = Form![Employee ID]")

   =DLookUp("[Last Name]", "Employees", _

         "[Employee ID] = " & [Employee ID])

   =DLookUp("[Last Name]", "Employees", _

         "[Employee ID] = " & Forms!Orders![Employee ID])

The three examples above will all have the same results.

In the first example, Form![Employee.ID] appears inside the criteria's

quotation marks. "Form" tells Microsoft Access that the field reference

"Employee ID" comes from the current form. If you omit it, Microsoft Access

will compare Employee ID to itself in the Employees table, and will return

the last name from the first record in the Employees table (the same result

as if you did not specify any criteria). This is because the first record

in the Employees table has a 1 in the Employee ID field, so the argument

   "[Employee ID] = [Employee ID]"

computes to

   "1 = 1"

and would thus be the first record that matched the criteria.

The criteria for the second two examples are made by concatenating two

string expressions with an ampersand (&). In the third example, the

criteria ends with a form field reference.

When criteria are being evaluated, the individual pieces of the criteria

are first evaluated and then appended or concatenated, and then the whole

value is computed.

If the current value in the Employee ID field on the Orders form is 7, the

original criteria expression

   "[Employee ID] = " & [Employee ID]

would compute to

   "[Employee ID] = " & 7

which, when concatenated, computes to:

   "[Employee ID] = 7"

If you do not specify the full form reference (which the second example

above does not), Microsoft Access will assume that you are referring to the

current form.

The following example is a derivative of the third example above:

   =DLookUp("[Last Name]", "Employees", _

         "[Employee ID] = Forms!Orders![Employee ID]"

In this example, the full form reference is enclosed inside the criteria's

quotation marks. In this case, Microsoft Access will correctly look up the

value when the form first opens, but only until the Employee ID field is

changed by modifications to a record or the addition of a record. Microsoft

Access will not automatically recompute the new employee last name value

after such a change. You can manually recompute the expression by placing

the insertion point on the control, and then pressing F9.

If you want the field to automatically update when the criteria changes,

make the criteria a variable by using the method of concatenating the

expression's parts as described earlier. Note that when you move to a new

record, the DLookup() text boxes that update automatically will have

"#Error" in them until you enter something in the Employee ID text box.

Specifying Textual Criteria:

All the examples above demonstrate how to use the DLookup() function with

numeric criteria. If the criteria fields are textual, enclose the text in

single quotation marks, as in the following example:

   =DLookUp("[Last Name]", "Employees", "[Employee ID] = '7'")

Note that you can use double quotation marks instead of single quotation

marks, although single quotation marks are preferred. Use two double

quotation marks to replace one single quotation mark. The following example

uses double quotation marks, and is equivalent to the example above:

   =DLookUp("[Last Name]", "Employees", "[Employee ID] = ""7""")

Specifying Textual Criteria That Comes from a Field on a Form:

The following example demonstrates how to find the description for a

category on the Products form. The Category ID field is a textual key field

for the criteria, so the DLookup() statement is

   =DLookUp("[Description]","Categories", _

         "[Category ID] = '" & [Category ID] & "'")

or, equivalently:

   =DLookUp("[Description]","Categories", _

         "[Category ID] = '" & Forms!Products![Category ID] & "'")

In the second example, the criteria is made up by concatenating three

string expression pieces. The first is "[Category ID] = '", the second is

the value contained in the actual Category ID field, and the third is the

closing single quotation mark enclosed in double quotation marks.

When this criteria is being evaluated, the individual pieces are first

evaluated, their results appended or concatenated, and then the whole value

is computed.

If the current value selected in the Category combo box on the Products

form is Beverages, the bound column for the combo box will return BEVR as

the Category ID. The original criteria expression

   "[Category ID] = '" & [Category ID] & "'"

will compute to

   "[Category ID] = '" & "BEVR" & "'"

which, when concatenated, computes to:

   "[Category ID] = 'BEVR'"

Specifying Date Criteria:

If the criteria fields are date or time values, enclose the date or time

value in number signs (#). To find an employee whose birthday is on a given

date, use the following sample criteria:

   =DLookUp("[Last Name]", "Employees", "[Birth Date] = #11-15-67#")

Specifying Multiple Fields in the Criteria:

The criteria expression can be any valid SQL WHERE clause (without the

keyword WHERE). This implies that more than one field can be used to

specify criteria for a DLookup() function.

To find the Product ID for one of the products supplied by supplier

"Formaggi Fortini", with a Supplier ID of 14 (numeric), and a Category ID

of DAIR (textual), use the following sample DLookup() statement:

   =DLookUp("[Product ID]", "Products", _

         "[Category ID] = 'DAIR' And [Supplier ID] = 14")

This statement will return Product ID 31, which is the first Product ID

that matches the criteria. Product ID 23 also matches the criteria.

The example above uses hard-coded, or specific, Category ID and Supplier ID

values. To use variables instead of specifics for the criteria, you could

use Access Basic to concatenate multiple string expressions. The following

Access Basic example demonstrates this method:

   ' Declare the variables

   Dim CatID As String

   Dim SuppID As Number

   Dim Result

   ' Assign values to the variables to be used in the criteria

   CatID = "DAIR"

   SuppID = 14

   Result = DLookup("[Product ID]", "Products", _

      "[Category ID] = '" & CatID & "' And [Supplier ID] = " & SuppID)

If the DLookup() function is unsuccessful, the variable Result will contain

null.

Note that the criteria is made up of four pieces that are evaluated

individually. The results are appended, and then evaluated as a whole. The

original criteria expression

   "[Category ID] = '" & CatID & "' And [Supplier ID] = " & SuppID

computes to

   "[Category ID] = '" & "DAIR" & "' And [Supplier ID] = " & 14

which, when concatenated, computes to:

   "[Category ID] = 'DAIR' And [Supplier ID] = 14"

The next example can be used to find an employee whose birthday falls on

today's date:

   =DLookUp("[Last Name]", "Employees", _

      "Month([Birth Date]) = " & Month(Date) & " And Day([Birth Date]) _

      = " & Day(Date))

If today's date is 12/2/93, the original criteria expression

   "Month([Birth Date]) = " & Month(Date) & " And Day([Birth Date]) = " _

   & Day(Date)

computes to

   "Month([Birth Date]) = " & 12 & " And Day([Birth Date]) = " & 2

which, when concatenated, computes to:

   "Month([Birth Date]) = 12 And Day([Birth Date]) = 2"

Tips for Troubleshooting and Debugging DLookup() Expressions

------------------------------------------------------------

To troubleshoot expressions, break down the expression into smaller

components and test the components individually in the Immediate window to

ensure they work correctly. If the smaller components work correctly, they

can be put back together, piece by piece, until the final expression works

correctly.

The Immediate window is a tool that you can use to help debug Access Basic

modules. The window can be used to test and evaluate expressions

independently of the form or macro the expression is to be used in. You can

set up expressions in the Immediate window, run them, and see the results

immediately.

The following example demonstrates a strategy you can use to break down a

DLookup() expression into smaller components that you can test in the

Immediate window. Assume you are having difficulty with the following

statement:

   =DLookUp("[Product ID]", "Products", _

      "[Category ID] = '" & Forms!MyForm![Category ID] _

      & "' And [Supplier ID] = " & Forms!MyForm![Supplier ID])

Note that the criteria includes multiple fields in the lookup criteria, one

of which is numeric and one if which is textual.

To troubleshoot this expression, try the following:

1. Open or create a module. From the View menu, choose Immediate Window.

2. Try the function without any criteria. Type the following in the

   Immediate window and then press ENTER:

      ? DLookUp("[Product ID]", "Products")

   Microsoft Access will perform the calculation and display the result on

   the next line in the Immediate window.

3. Make sure the form references correctly reference data. Type each of the

   following in the Immediate window, and then press ENTER:

      ? Forms!MyForm![Category ID]

      -and-

      ? Forms!MyForm![Supplier ID]

4. Try to get the criteria fields to work independently by hard coding

   values into the expression. Type each of the following in the Immediate

   window, and then press ENTER:

      ? DLookUp("[Product ID]", "Products", "[Category ID] = 'DAIR'")

      -and-

      ? DLookUp("[Product ID]", "Products", "[Supplier ID] = 14)

5. Try to get the criteria fields to work independently with a parameter in

   the query. Type each of the following in the Immediate window, and then

   press ENTER:

      ? DLookUp("[Product ID]", "Products", _

         "[Category ID] = '" & Forms!MyForm![Category ID] & "'")

      -and-

      ? DLookUp("[Product ID]", "Products", _

         "[Supplier ID] = " & Forms!MyForm![Supplier ID])

REFERENCES

==========

Microsoft Access "User's Guide," version 1.1, page 651

Microsoft Access "Language Reference," version 1.1, pages 144-146

Microsoft Access "Introduction to Programming," version 1.1, pages 37-42

Additional reference words: 1.00 1.10 2.00


INF: Sample Function to Return a Random Record

 Article Number: Q108435

 CREATED: 12-DEC-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access does not contain a built-in mechanism for returning a

random record from a set of records. This article describes a sample user-

defined Access Basic function you can use to return a random record.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

MORE INFORMATION

The following sample function will return a random record using the

recordset name and field name that you supply. To create this function,

add the following to the Global Declarations section

   Option Explicit

and then enter the following in the module:

   Function FindRandom (RecordSetName$, Fieldname$)

       Dim MyDB As Database

       Dim MyDyna As Dynaset

       Dim SpecificRecord&, i&, NumOfRecords&

       Set MyDB = CurrentDB()

       Set MyDyna = MyDB.CreateDynaset(RecordSetName$)

       On Error GoTo NoRecords

       MyDyna.MoveLast

       NumOfRecords& = MyDyna.RecordCount

       SpecificRecord& = Int(NumOfRecords * Rnd)

       If SpecificRecord& = NumOfRecords Then

           SpecificRecord& = SpecificRecord& - 1

       End If

       MyDyna.MoveFirst

       For i = 1 To SpecificRecord&

           MyDyna.MoveNext

       Next i

       FindRandom = MyDyna(Fieldname$)

       Exit Function

   NoRecords:

       If Err = 3021 Then

           MsgBox "There Are No Records In The Dynaset", 16, "Error"

       Else

           MsgBox "Error - " & Err & Chr$(13) & Chr$(10) & Error,_

           16, "Error"

       End If

       FindRandom = "No Records"

       Exit Function

   End Function

To test the function, type the following in the module's Immediate window:

   ? FindRandom("<RecordSetName>", "<FieldName>")

Substitute the name of your recordset for <RecordSetName> and the name of

a field in your recordset for <FieldName>.

Each time you run the function, a different record will be returned.

REFERENCES

==========

For more information on returning random records using a query, query on

the following words here in the Microsoft Knowledge Base:

   return and random and record and rnd

For more information on the Int() function or the Rnd() function, search

for "Int" or "Rnd" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 ADK


PRB: Form's Record Sort Order Depends on AllowUpdating

 Article Number: Q108436

 CREATED: 12-DEC-1993

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A table-based form that has its AllowUpdating property set to No Tables

will display records in insertion order instead of in primary key order.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access.

2. Create a new table with a text field. Make the text field the

   primary key.

3. View the table in Datasheet view. Enter three new records with

   the following values:

      Z

      X

      Y

4. Create a new, blank form based on the new table.

5. Place a text box on the form. Set the text box's ControlSource

   property to the new table.

6. View the form in Form view. Note that the display order is:

      X

      Y

      Z

7. View the form in Design view. Set the form's AllowUpdating property

   to No Tables.

8. View the form in Form view. Note that the display order has

   changed to:

      Z

      X

      Y

Additional reference words: 1.00 1.10 2.00 sort


INF: Error in Object Permissions Table

 Article Number: Q108437

 CREATED: 12-DEC-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

There is a table in the Microsoft Access "User's Guide" that summarizes the

permissions available for objects in a database. This table contains an

error. In version 1.0, the table is on page 621. In version 1.1, the table

is on page 627.

The third and fourth lines in the table incorrectly show that Read Data and

Modify Data permissions apply to form objects. These two permissions do not

apply to form objects because forms display data from an underlying

dynaset; they do not actually contain data. Therefore, your ability to

modify data through a form is actually determined by the Read Data and

Modify Data permissions on the form's underlying table or query.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 620-621

Microsoft Access "User's Guide," version 1.1, pages 626-627

Additional reference words: 1.00 1.10 docerr


INF: Tips for Debugging Access Basic Code

 Article Number: Q108438

 CREATED: 12-DEC-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article contains tips to help you debug your Access Basic code. This

article assumes that your code compiles correctly, but does not perform as

you expect.

MORE INFORMATION

The general procedure for debugging Access Basic code is to break larger

procedures apart into smaller sub-procedures, verify that the individual

steps in each sub-procedure work correctly, and then combine the sub-

procedures one by one until the code works correctly.

Using The Immediate Window

--------------------------

You can use the Immediate window to execute individual lines of Access

Basic code, or to check the values of variables. Therefore, you can use the

Immediate window to:

 - Test and debug Function and Sub procedures.

 - Check the value of a field, control, property setting, variable, or

   expression.

 - Display the result of an expression when the code is running.

The following steps demonstrate how to use the Immediate window to debug

your Access Basic functions:

1. Open the module containing your function in Design view.

2. From the View menu, choose Immediate Window.

3. Run your function in the Immediate window by typing "?<FunctionName>()"

   (without the quotation marks) and then pressing ENTER. Substitute the

   name of your function for <FunctionName>, and be sure to place all

   arguments expected by your function inside the parentheses.

For more information on the Immediate window, search for "immediate window"

then "Immediate Window" using the Microsoft Access Help menu.

Using Breakpoints with the Immediate Window

-------------------------------------------

A breakpoint suspends execution of the code, allowing you to check the

values of variables. You can use the Immediate window with breakpoints to

pinpoint code problems quickly.

For example, if the first part of your code runs correctly, but other parts

do not, you can follow the sample steps below to find the malfunctioning

part:

1. Set a breakpoint right after the part that you know works correctly. To

   set a breakpoint:

   a. Move your cursor to the line of code where you want to set the

      breakpoint.

   b. Click the Breakpoint button (the five-fingered hand) on the tool bar.

      Or, press F9, or choose Toggle Breakpoint from the Run menu. The line

      will appear in bold type, indicating that there is a breakpoint set

      at that line.

2. Run the function in the Immediate window (see "Using The Immediate

   Window" above). When code execution reaches the breakpoint, processing

   is suspended and the breakpoint line is selected. You can then check the

   value of variables in the code.

For example, to check the value of a variable called MyName, type the

following in the Immediate window and then press ENTER:

   ?MyName

The value of MyName is displayed in the Immediate window. If the value is

correct, check other variables. If the value is incorrect, check the

previous lines of code to see where this variable is assigned an incorrect

value.

Using the Debug.Print Statement

-------------------------------

You can use the Debug.Print statement in your code to display the values of

your variables in the Immediate window. Good places to include Debug.Print

statements include:

 - The beginnings of functions, to check the arguments passed to the

   function. For example, to check the values of two arguments passed to

   the DoSomeCalcs() function, place the following sample Debug.Print

   statement at the beginning of the function:

      Function DoSomeCalcs(Arg1, Arg2)

         Debug.Print "Function DoSomeCalcs " & Arg1 & " " & Arg2

   When the DoSomeCalcs() function is run, the text "Function DoSomeCalcs"

   and the values of the two arguments Arg1 and Arg2 will be displayed in

   the Immediate window. If the values of the arguments are not correct,

   the problem is occurring before the function is run.

   You can also use the Debug.Print statement at the beginning of each

   function if you have a complex application and you are not sure which

   function might be causing the problem. This allows you to check the

   Immediate window to see the order in which functions were called, and

   determine which was the last function called.  In Access 2.0, you can

   also select Calls from the View menu to list the current function

   call stack, and show the order that functions were called.

 - Decision structures, to check that you are using the correct logic

   for the function. For example, the sample code on page 23 of the

   Microsoft Access "Introduction to Programming" manual uses a Select

   Case statement. You can add a Debug.Print statement to this sample

   code, as demonstrated below, to verify that the code is doing what

   you expect:

      Function DueDate (anyDate)

      Debug.Print "Function DueDate " & anyDate

      Dim Result

         If Not IsNull(anyDate) Then

            Result = DateSerial(Year(anyDate), Month(anyDate) + 1, 1)

            Debug.Print "Result: " & Result

            Debug.Print "Weekday(Result): " & Weekday(Result)

            Select Case Weekday(Result)

               Case 1:      'Sunday

                  Debug.Print "Case 1"

                  DueDate = Result + 1

               Case 7:      'Saturday

                  Debug.Print "Case 7"

                  DueDate = Result + 2

               Case 6:      'Friday

                  Debug.Print "Case 6"

                  DueDate = Result - 1

               Case Else

                  Debug.Print "Case Else"

                  DueDate = Result

            End Select

         Else

            Result = Null

         End If

      End Function

   Run this function in the Immediate window by typing the following

   and then pressing ENTER:

      ?DueDate(#10/1/93#)

   The following results will be displayed in the Immediate window:

      Function DueDate 10/1/93

      Result: 11/1/93

      Weekday(Result): 2

      Case Else

      11/1/93

   These results show that you are using the correct logic for this

   function. If you had received different results (the wrong case, for

   example) you could then check the values of other values and expressions

   to determine where the problem is.

 - In loops, to check the values of variables. If you use a breakpoint

   to check the value of a variable in a loop, you cannot see how the

   value of the variable changes as the loop executes. However, if you

   include the statement "Debug.Print MyName" (without the quotation marks)

   in your loop structure, the value of variable MyName will be displayed

   in the Immediate window each time the function cycles through the loop.

   This method is also a good way to verify that the loop is executing

   the number of times you expect. If the loop executes four times, you

   should see four values for the value in the Immediate window.

 - Where clauses, to check the values of criteria in SQL statements.

   For example, the following sample function creates a dynaset from

   a SQL statement. If there is a problem in a SQL statement (such as

   in this function), it can be difficult to locate the problem. However,

   this function uses the Debug.Print statement to display the SQL

   statement as Microsoft Access sees it and uses it:

      Function TestMe()

         Dim db As Database, ds As Dynaset

         Dim empnum As Long

         Dim sql As String

         Set db = CurrentDB()

         empnum = 5

         sql = "select * from orders where [employee id]=empnum;"

         Debug.Print sql

         Set ds = db.CreateDynaset(sql)

      End Function

   Run this function in the Immediate window by typing the following

   and then pressing ENTER:

      ?TestMe()

   The following result is displayed:

      select * from orders where [employee id]=empnum;

   Note that the Where condition shows [employee id] = empnum, not

   [employee id] = 5, as you assigned it. To fix this particular problem,

   change the Where condition to concatenate the empnum variable, as

   follows:

      Function testme()

         Dim db As Database, ds As Dynaset

         Dim empnum As Long

         Dim sql As String

         Set db = CurrentDB()

         empnum = 5

         sql = "select * from orders where [employee id]=" & empnum & ";"

         Debug.Print sql

         Set ds = db.CreateDynaset(sql)

      End Function

   When you run the corrected function, the following statement will be

   displayed:

      select * from orders where [employee id]=5;

Stepping Through the Code

-------------------------

Stepping through your code means executing the code one line at a time.

This is sometimes referred to as tracing. Access Basic has two ways of

stepping through code: single stepping, and procedure stepping.

Single stepping executes each step of a called procedure, stopping at each

line in the procedure. Procedure stepping executes a called procedure all

at once, then returns to the next line in the current procedure.

To step through your code:

1. Set a breakpoint in your code at the line where you want to begin

   stepping. (See "Using Breakpoints with the Immediate Window", above).

   To step through an entire function, set the breakpoint on the first

   line of the function.

2. Start the function. When program execution reaches the breakpoint, the

   line with the breakpoint will be selected in the function's module.

3. To single step, click the Single Step button (single foot) on the

   toolbar. Or, press F8, or choose Single Step from the Run menu. The

   selected line of code will be executed, and then the next line of code

   will be selected. You can continue through your code one line at at time

   in this fashion.

If your code calls other functions or procedures you will single step

through them as well. If you do not want to single step through these other

procedures, click the Procedure Step button (double foot) on the toolbar.

Or, press SHIFT+F8, or choose Procedure Step from the Run menu.

Note that as you step through your code, you can check the values of

variables in the Immediate window (see "Using the Immediate Window",

above).

If you want to continue running your code normally (without single or

procedure stepping), click the Run button (exclamation point) on the

toolbar. Or, press F5, or choose Continue from the Run menu.

REFERENCES

==========

Microsoft Access "Introduction to Programming," version 1.x, Chapter 4,

"Debugging Your Access Basic Code"

Microsoft Access "Building Applications," version 2.0, Chapter 9,

"Debugging"

Additional reference words: 1.00 1.10 2.00 AB trouble shoot


PRB: "ORA-00904: Invalid Column Name" Error Message in Query

 Article Number: Q108439

 CREATED: 12-DEC-1993

 MODIFIED: 01-APR-1994

 VERSION(S): 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.1 and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you have a query based on an attached Oracle synonym that has a sort on

a column name, and the owner of the synonym has read-only permissions on

the table on which the synonym is based, you will receive the error

messages:

   ODBC - call failed

   -and-

   [PageAhead][ODBC Oracle Driver][Oracle OCI]ORA-00904: invalid

   column name. [#904]

CAUSE

This error occurs because the owner of the synonym has read-only

permissions on the Oracle table on which the synonym is based.

RESOLUTION

There are four ways to correct this problem:

 - Create a Public synonym in Oracle.

 - In Microsoft Access, attach directly to the table on which the

   synonym is based.

 - In Oracle, assign the owner of the synonym permissions greater

   than read-only.

 - In Microsoft Access, remove the "order by" clause from the

   query.

MORE INFORMATION

The following is an example of an SQL statement that will cause this

error:

   SELECT * FROM <owner>.<synonym_name>

      ORDER BY <owner>.<synonym_name>.<column_name>

Note that the same errors will occur if this command is issued in SQL*DBA

or SQL*PLUS, which are Oracle's interface tools. If you remove the ORDER BY

clause, the statement will run. The statement will run with the ORDER BY

clause if you remove the <owner>. clause instead. The statement will run

with all the clauses included if you increase the owner's permissions on

the table on which the query is based.

Steps to Reproduce Behavior

---------------------------

1. In Oracle, create a table. Assign all permissions on the table to user

   A, and read-only permissions to user B.

2. Log into Oracle as user A. Create synonym A based on the new table.

3. Log into Oracle as user B. Create synonym B based on the new table.

4. Start Microsoft Access. Attach synonym A with user A's login account.

   Create a query based on synonym A with a sort on one of the columns.

5. Run the query. Note that the query runs correctly.

6. Attach synonym B with user B's login account. Create a query based on

   synonym B with a sort on one of the columns.

7. Run the query. The error messages stated above will occur.

NOTE: You can reproduce this behavior in Oracle's SQL*DBA as well. To do

so, connect as user A and issue the following command:

  SELECT * FROM userA.synonymA ORDER BY userA.synonymA.column1;

Note that the command runs correctly. Next, connect as user B and issue the

following command:

  SELECT * FROM userB.synonymB ORDER BY userB.synonymB.column1;

An error message will occur.

Additional reference words: 1.10 2.00 ADK errmsg


PRA: Duplicate Control Menus and Restore Buttons on Form

 Article Number: Q108440

 CREATED: 12-DEC-1993

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

A maximized, continuous form has two Control (system) menus and two Restore

buttons.

CAUSE

Duplicate Control menus and Restore buttons will appear on a form under the

following conditions:

 - The form is a maximized, continuous form.

 - The form's detail section is short, so multiple records are

   displayed in Form view.

 - A record in the lower part of the Form window is selected.

 - The form has a custom menu that activates another form.

 - The other form is activated from the custom menu and then closed.

RESOLUTION

Add the following macro action to the beginning of the macro attached to

the custom menu that opens the second form:

    Action

    -------------------------

    DoMenuItem

       MenuMar: Form

       MenuName: Edit

       Command: Select Record

       Subcommand:

This macro action will select the current continuous form before opening

the second form. For example, to open a second form called Test2, use the

following macro actions:

    Action

    -------------------------

    DoMenuItem

       MenuMar: Form

       MenuName: Edit

       Command: Select Record

       Subcommand:

    OpenForm

       FormName: Test2

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

 1. Open the sample database NWIND.MDB.

 2. Create the following new macro. Save it as Test Menu:

      Action

      --------------------------------

      AddMenu

         MenuName: View

         MenuMacroName: Test Menu View

 3. Create the following new macro. Save it as Test Menu View:

      Action

      ------------------

      OpenForm

         FormName: Test2

 4. Create a blank, unbound form. Add a text box to the form, and

    then save the form as Test2.

 5. Create a new form bound to the Customers table. Add the following

    properties to the form, and then save the form as Test:

      OnMenu: Test Menu

      DefaultView: Continuous Forms

 6. Create a text box bound to the Company Name field at the top of

    the Test form's detail section.

 7. Size the Test form's detail section so that it is as short

    (vertically) as possible.

 8. View the Test form in Form view.

 9. Maximize the form.

10. Click in the Company Name box in the record closest to the horizontal

    scroll bar (which is the lowest record visible on the form).

    NOTE: If you select a record closer to the top of the window, the

    problem will not occur.

11. From the View menu, choose Test2.

12. From the File menu, choose Close.

Note that the Test form now has two Control menus and two Restore buttons.

Additional reference words: 1.00 1.10


WX0964: SecurityWizard and White Paper Application Note

 Article Number: Q109074

 CREATED: 21-DEC-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

The "SecurityWizard and White Paper" (WX0964) Application Note contains

in-depth information about the Microsoft Access security model to help you

understand and use Microsoft Access security effectively.

You can obtain this Application Note from the following sources:

 - CompuServe, GEnie, and Microsoft OnLine

 - Microsoft Download Service (MSDL)

 - The Internet (Microsoft anonymous ftp server)

 - Microsoft Product Support Services

For complete information, see the "To Obtain This Application Note"

section at the end of this article.

THE TEXT OF WX0964

==================

======================================================================

  Microsoft(R) Product Support Services Application Note (Text File)

                WX0964: SECURITYWIZARD AND WHITE PAPER

======================================================================

                                                  Revision Date: 12/93

                                                       1 Disk Included

The following information applies to Microsoft Access(R), version 1.1.

|---------------------------------------------------------------------|

| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY     |

| ACCOMPANY THIS DOCUMENT (collectively referred to as an Application |

| Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER      |

| EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED      |

| WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR       |

| PURPOSE. The user assumes the entire risk as to the accuracy and    |

| the use of this Application Note. This Application Note may be      |

| copied and distributed subject to the following conditions:  1) All |

| text must be copied without modification and all pages must be      |

| included;  2) If software is included, all files on the disk(s)     |

| must be copied without modification (the MS-DOS(R)  utility         |

| diskcopy is appropriate for this purpose);  3) All components of    |

| this Application Note must be distributed together;  and  4) This   |

| Application Note may not be distributed for profit.                 |

|                                                                     |

| Copyright (C) 1993 Microsoft Corporation.  All Rights Reserved.     |

| Microsoft, Microsoft Access, and MS-DOS are registered trademarks   |

| and Windows is a trademark of Microsoft Corporation.                |

|---------------------------------------------------------------------|

The disk included with this document contains two files. The

about the Microsoft Access security model to help you understand and

use Microsoft Access security effectively. The WZSECURE.MDA file

contains the Microsoft Access SecurityWizard, which is a tool for

easily securing your databases. The white paper includes instructions

for using the SecurityWizard.

To Install the SecurityWizard

-----------------------------

1. Copy the WZSECURE.MDA file to your Microsoft Access 1.1 program

   directory.

2. Add the following line to the [Libraries] section of your

   MSACCESS.INI file:

      WZSECURE.MDA=RO

3. Add the following lines to your MSACCESS.INI file, and then

   save the file:

      [Menu Add-Ins]

      Security&Wizard==swz_SecureDB()

The next time you start Microsoft Access, the SecurityWizard command

will be available on the Help menu.

The SecurityWizard runs only in Microsoft Access version 1.1, but will

work with databases in either 1.0 or 1.1 format. Attempting to use the

SecurityWizard in Microsoft Access version 1.0 will result in an "Out-

of-date database format" error message, followed by a "Some library

modules could not be loaded" error message when you start Microsoft

Access. Databases created by the SecurityWizard are always in version

1.1 format.

The SecurityWizard may take some time to run. For example, securing

the sample database NWIND.MDB on a 486/50 computer takes approximately

13 minutes. The SecurityWizard's About dialog box gives further

information on what the SecurityWizard does, as does the text file

included on the disk.

The Security White Paper

------------------------

The security white paper is a text document written by Microsoft

Access development.  It contains in-depth information on the security

model used by Microsoft Access, details on how and why Microsoft

Access security acts the way it does, and answers to some common

security questions.  The file is in text (.TXT) format and is readable

by any word processor.

--------------------------------------------------------------------

TO OBTAIN THIS APPLICATION NOTE

===============================

 - On CompuServe, GEnie, and Microsoft OnLine, Application Notes

   are located in the Microsoft Software Library. You can find

   WX0964 in the Software Library by searching on the word WX0964,

   the Q number of this article, or S14488. WX0964 is a compressed,

   self-extracting file. After you download WX0964, run it to

   extract the file(s) it contains.

 - Application Notes are available by modem from the Microsoft

   Download Service (MSDL), which you can reach by calling (206)

   936-6735. This service is available 24 hours a day, 7 days a week.

   The highest download speed available is 14,400 bits per second (bps).

   For more information about using the MSDL, call (800) 936-4100 and

   follow the prompts. To obtain WX0964, download WX0964.EXE.

   WX0964.EXE is a compressed, self-extracting file. After you

   download WX0964, run it to extract the file(s) it contains.

 - On the Internet, Application Notes are located on the Microsoft

   anonymous ftp server, which you can reach by typing "ftp

   ftp.microsoft.com" (without the quotation marks) at the ">" command

   prompt.

 - If you are unable to access the sources listed above, you can

   have this Application Note mailed or faxed to you by calling

   Microsoft Product Support Services Monday through Friday, 6:00 A.M.

   to 6:00 P.M. Pacific time at (206) 635-7050. If you are outside the

   United States, contact the Microsoft subsidiary for your area. To

   locate your subsidiary, call Microsoft International Customer

   Service at (206) 936-8661.

Additional reference words: 1.00 1.10 appnote


INF: How to Add the ACC-KB.HLP File to the Help Menu

 Article Number: Q109267

 CREATED: 30-DEC-1993

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article explains how to the add the Microsoft Access Knowledge Base

Help file (ACC-KB.HLP) to the Help menu in Microsoft Access.

This article assumes that you have already obtained the ACC-KB.HLP file. If

you do not have the file, refer to article Q105380 for full instructions on

how to obtain the file.

MORE INFORMATION

To add the Microsoft Access Knowledge Base Help file to the Help menu, add

the following line to the [Menu Add-Ins] section of the MSACCESS.INI file:

   Access &KB==Shell("winhelp c:\access\acc-kb.hlp",1)

Note that this article assumes that the ACC-KB.HLP file is located in the

ACCESS directory on drive C. If the file and its associated DLL files are

located elsewhere, the error message "Routine not found" will be generated

when you run the new command on the Help menu. Further information on the

"Routine not found" error message is contained in the README.TXT file

included with the ACC-KB.HLP file.

REFERENCES

==========

Microsoft Access "Language Reference," page 440

Additional reference words: 1.00 1.10


PRB: Unbound Controls in Form Datasheet Do Not Print Preview

 Article Number: Q109311

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The data in unbound controls on forms will not be displayed when you

preview the form in Datasheet view. Only the names of the controls will be

displayed. Data in bound controls will be displayed correctly.

RESOLUTION

Preview the form in Form view to correctly display the information in

unbound controls. Or, bind unbound controls to fields on a table that store

the data. Binding the controls in this manner will allow you to preview the

form in Datasheet view and see the controls' values.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create a new, unbound form.

3. Place an unbound text box on the form.

4. View the form in Datasheet view.

5. Type any text in the control on the new form.

6. From the file menu, choose Print Preview.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 205-208

Additional reference words: 1.00 1.10 forms


INF: Reserved Words in Microsoft Access

 Article Number: Q109312

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article lists words and symbols that should not be used in field names

because they are "reserved" words, or words that are reserved by Microsoft

Access because they have a specific meaning to the program.

MORE INFORMATION

The following words are reserved and should not be used as field names:

   AND              IS

   DATE             NO

   DESCRIPTION      NULL

   ELSE             OFF

   END              ON

   ERROR            OR

   EXIT             REAL

   FALSE            REPORTS

   FORM             SCREEN

   FORMS            SECTION

   FUNCTION         SQL

   GROUP BY         TRUE

   IF               YES

   IN

The following symbols should not be used as part of a field name:

   .                !

   /                #

   *                &

   :                -

REFERENCES

==========

For more information on reserved words, search help for "reserved words"

then check each of the topics listed using the Microsoft Access Help menu.

Microsoft Access "Language Reference," page 509

Additional reference words: 1.00 1.10 2.00 misc

KBCategory:

KBSubcategory:


PRB: Changing Show Ruler Option Changes Existing Forms

 Article Number: Q109313

 CREATED: 02-JAN-1994

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Changing the Show Ruler option in the Form & Report Design section of the

Options dialog box overrides this setting in existing forms and reports.

CAUSE

This behavior occurs when the Show Ruler option is changed for a new form

or report. For example, if you set the Show Ruler option to No for a new

form or report, that setting will override a Show Ruler option of Yes that

was set in any already existing form or report.

Note that this behavior also occurs with the Show Grid and Objects Snap To

Grid options.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new, blank form.

2. If the ruler is not currently visible along the top of the form in

   Design view, choose Ruler from the View menu.

3. Save and then close the form.

4. From the View menu, choose Options. Select Form & Report Design and

   then set the Show Ruler option to No.

5. Open the form that you closed in step 3. Note that the ruler is not

   visible.

Additional reference words: 1.00 1.10 2.00


PRB: Text Box Formatted as Currency Has a Space on the Right

 Article Number: Q109314

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A text box with a currency format on a form or report displays data with an

extra space at the right end of the value.

CAUSE

The space at the right end of the value is required for a closing

parenthesis for negative values. The space keeps the decimal point aligned

for positive and negative values.

RESOLUTION

Change the text box's Format property to a custom format, or to a fixed

format with two decimal places.

For example, if you change the control's Format property to $#,##0.00,

values in the control will be displayed without the space on the right end.

Negative values will be displayed as -$nnn.nn, not as ($nnn.nn).

STATUS

This behavior is by design.

MORE INFORMATION

If you format some text boxes on a form with a currency format and others

with a custom format, you may have trouble aligning columns of figures. For

example, if you format totals in a report's footer section with a currency

format, but use a custom format, or no format, on the text boxes above the

footer, the columns may not automatically align.

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Open the Invoice report in Design view.

3. Preview the report. Note that the Subtotal, Freight, and Total columns

   are correctly aligned.

4. View the report in Design view.

5. Select the Freight text box and change its Format property to

   $#,##0.00.

6. Preview the report again. Note that Freight column is not aligned

   correctly.

7. Close the report without saving the changes.

REFERENCES

==========

For more information on formatting a field, search for "Format" then

"Format Property" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


INF: How to Change the Order of Columns in a Graph

 Article Number: Q109315

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

By default, a graph sorts the X-axis fields in alphabetical or numeric

order. This article describes two ways to sort the X-axis fields in a

different order.

MORE INFORMATION

There are two ways to change the ordering of fields in a graph. The first

way is to add an Order By clause to the SQL statement in the graph's

RowSource property. The second way is to create a query that orders the

fields the way you want them, and then use the query for the graph's

RowSource property.

How to Create a Sample Graph

----------------------------

For Microsoft Access version 2.0:

1. Open the sample database NWIND.MDB.

2. Create a new, blank form, and then add a graph object to the form.

3. In the GraphWizard dialog box, select the Sales By Category query as

   the data source for the graph.

4. Select the Category Name field in the Available Fields box and then

   choose the ">" button. Then select the Product Sales field and choose

   the ">" button. Click Next three times, and then click Finish.

5. View the form in Form view. Note that the Category Name records are

   listed in alphabetical order.

For Microsoft Access version 1.x:

1. Open the sample database NWIND.MDB.

2. Create a new, blank form, and then add a graph object to the form.

3. In the GraphWizard dialog box, select the Sales By Category query as

   the data source for the graph. Then, click the Bar Chart button, and

   then choose Next.

4. Select the Category Name field in the Available Fields box and then

   choose the ">" button. Then select the Product Sales field and choose

   the ">" button. Choose Next.

5. Choose Design.

6. View the form in Form view. Note that the Category Name records are

   listed in alphabetical order.

How to Change the Graph's Sorting Order

---------------------------------------

Method 1:

The following example demonstrates how to add an Order By clause to the SQL

statement in a graph's RowSource property:

1. View the form in Design view.

2. Select the Graph.

3. From the View menu, choose Properties.

4. Select the RowSource property, and then press SHIFT+F2 to zoom the

   window. The RowSource property looks like:

      SELECT DISTINCTROW [Category Name] AS [Sales by Category],

      SUM([Sales by Category].[Product Sales]) AS [Product Sales]

      FROM [Sales by Category]

      GROUP BY [Category Name];

5. Type "Order By SUM([Sales by Category].[Product Sales]) desc"

   (without the quotation marks) before the semicolon at the end of

   the SQL statement. The SQL statement should look like:

      SELECT DISTINCTROW [Category Name] AS [Sales by Category],

      SUM([Sales by Category].[Product Sales]) AS [Product Sales]

      FROM [Sales by Category]

      GROUP BY [Category Name]

      Order By SUM([Sales by Category].[Product Sales]) desc;

6. Choose OK.

7. View the form in Form view. Note that the Category Name records are

   now listed in descending order of sales.

Method 2:

The following example describes how to create and use a query for the

graph's RowSource property:

For Microsoft Access version 2.0:

1. Create a form with a graph using the above steps.

2. View the form in Design view.

3. With your right mouse button, click the graph object, and then choose

   Properties.

4. With your right mouse button, click the Row Source property and then

   choose Build.

5. For the Product Sales field, change the sort order to Descending.

6. Close the Query window and save the changes.

7. Switch to Form view.

For Microsoft Access version 1.x:

1. Create a form with a graph using the above steps.

2. Make a copy of the Sales By Category query. Call the copy Sales By

   Category 2.

3. Open the Sales By Category 2 query in Design view. Create the following

   fields in the query:

      Field: Sales by Category:Category Name

         Total: Group By

         Sort: <leave blank>

      Field: Product Sales

         Total: Sum

         Sort: Desc

   Note that the first field is named "Sales by Category:Category Name"

   because the name of the first field becomes the graph's title.

4. Remove the Product Name field.

5. Save the query.

6. View the form in Design view. Replace the SQL text in the graph's

   RowSource property with the Sales By Category 2 query.

7. View the form in Form view.

The columns will be in descending order.

REFERENCES

==========

For more information on ordering fields, search for "order by" then "ORDER

BY Clause (SQL)" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 queries msgraph


INF: "Invalid Path" Error Message on Network Installation

 Article Number: Q109316

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

After performing a network installation of Microsoft Access using the

SETUP /A command to set up the server, and the SETUP /N command to set up

the workstation, you receive an "Invalid Path" error message when you try

to start Microsoft Access.

MORE INFORMATION

During the installation process Microsoft Access checks to see what type

of network you are running. If the network type is Microsoft LanMan,

Windows for Workgroups, or WindowsNT, Microsoft Access will write the

paths of necessary files in the MSACCESS.INI file using the uniform naming

convention (UNC). With other network types, the paths of necessary files

are written using drive letter references.

In either case, the server name must be 11 characters or less in length,

and must use no more than three characters as an extension. This is

standard MS-DOS naming convention.

Filing systems like WindowsNT's NTFS, OS/2's HPFS, UNIX's POSIX, and

Novell's Netware use naming conventions that do not follow standard MS-DOS

naming conventions. This can cause the error message stated above when

Microsoft Access tries to locate a server that is identified in the

MSACCESS.INI file.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.1, Appendix D, "Setting Up

Microsoft Access on a Network"

Additional reference words: 1.00 1.10 errmsg


PRB: OnExit Macro Runs with AfterUpdate Macro in Option Group

 Article Number: Q109317

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Both the macro in the AfterUpdate property and the macro in the OnExit

property of an option group will run when you update the option group if

the macro action in the AfterUpdate property is an ApplyFilter action.

RESOLUTION

Do not use a macro in the OnExit property of an option group if the option

group's AfterUpdate property runs a macro that contains an ApplyFilter

action.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create a new form based on the Employees table. Add the Employee ID

   and Last Name fields to the form.

3. Create an option group on the form with two toggle buttons and the

   following properties:

      Option Group: Test

         AfterUpdate: Macro1

         OnExit: Macro2

      Option Button: Button1

         Option Value: 1

      Option Button: Button2

         Option Value: 2

4. Save the form as Form1.

5. Create the following two new macros:

      Macro Name   Condition                Action

      -------------------------------------------------

      Macro1       Forms![form1]![test]=1   ApplyFilter

                   Forms![form1]![test]=2   ApplyFilter

      Macro2                                MsgBox

      Macro1 Actions

      -------------------------

      ApplyFilter

         Where: [employee id]=5

      ApplyFilter

         Where: [employee id]=7

      Macro2 Actions

      ----------------

      MsgBox

         Message: Test

6. Toggle between the two option buttons. In Microsoft Access version

   1.x, both the ApplyFilter and MsgBox actions are run. In Microsoft

   Access version 2.0, the following error message is displayed:

      Field or record can't be saved while it's being validated.

Additional reference words: 1.00 1.10 2.00


PRB: Index Does Not Work in AB Function with NWIND.MDB

 Article Number: Q109318

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you run an Access Basic function that has PrimaryKey defined as an

index, and that uses the Index method on a table in the sample database

NWIND.MDB, you receive the error message:

   'PrimaryKey' isn't an index in this table.

CAUSE

The PrimaryKey index is incorrectly named Primary Key internally (note the

space between "Primary" and "Key") in three tables in NWIND.MDB. These

tables are the Products, Shippers, and Suppliers tables.

tables

RESOLUTION

When you are running an Access Basic function that uses the Index method

on these three tables, refer to the index as "Primary Key" instead of

"PrimaryKey."

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

NOTE: This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual.

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create a new module and enter the following sample function:

      '*********************************************

      'Declarations section of the module.

      '*********************************************

      Option Explicit

      Function NWINDSEEK (Prod_ID As Integer)

         Dim db As Database, TBL As Table

         Set db = CurrentDB()

         Set TBL = db.OpenTable("Products")

         TBL.Index = "PrimaryKey"

         TBL.Seek "=", Prod_ID

         If TBL.NoMatch Then

            MsgBox "Not a valid ID. Try another"

         Else

            MsgBox "This Product ID is in the table!"

         End If

         TBL.Close

         db.Close

      End Function

3. From the View menu, choose Immediate Window.

4. Type the following in the Immediate window:

      ?NWINDSEEK(1)

   The above error message displays.

5. Change the TBL.Index statement in the module to the following:

      TBL.Index = "Primary Key"

6. Repeat step 4.

The appropriate message box is displayed.

Additional reference words: 1.00 1.10 seek


INF: How to Create a "Top 10" Report
INF: How to Create a "Top 10" Report [B_WAccADK]

 Article Number: Q109319

 CREATED: 02-JAN-1994

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

There is no built-in method in Microsoft Access to limit the

number of

records returned in a query based on their order. This

article describes

a method for creating a "Top 10" report, which is a report

that will

print the first 10 records in the report, based on the

report's sort

order.

MORE INFORMATION

The following example demonstrates how to create a Top 10

report using a

calculated control's RunningSum property to provide a

dynamic counter for

each record. A macro called from the report's OnFormat

property then

cancels the formatting of records whose counter falls

outside the range

you want to print:

1. Open the sample database NWIND.MDB.

2. Create the following new report, and then save it as Top

10 Report:

      Report: Top 10 Report

      ----------------------------------

      RecordSource: Sales by Sale Amount

      Detail Section

      ----------------------

      OnFormat: Top 10 Macro

      Text Box

      --------------------------

      ControlName: Sale Amount

      ControlSource: Sale Amount

      Text Box

      -----------------------

      ControlName: Order ID

      ControlSource: Order ID

      Text Box

      ---------------------------

      ControlName: Company Name

      ControlSource: Company Name

      Text Box

      --------------------

      ControlName: Counter

      ControlSource: =1

      Visible: No

      RunningSum: Over All

3. From the View menu, choose Sorting And Grouping. Enter

the following

   in the Sorting And Grouping window, and then close the

window:

      Field/Expression: Sale Amount

      Sort Order: Descending

4. Create the following new macro, and then save it as Top

10 Macro:

      Macro: Top 10 Macro

      -----------------------

      Condition: [Counter]>10

      Action: CancelEvent

5. Preview the report. The counter control will number each

record, and

   the macro will prevent any record whose counter is

greater than 10

   from being printed. Since the report is sorted on Sale

Amount, the

   10 largest sales will be printed.

Notes

-----

 - If you use this method with a Grouping/Totals report, the

totals will

   include the records that are not printed, so the totals

may not appear

   to be correct. To avoid this discrepancy, you can create

a dynamic

   counter in the query. For more information on this

method, search on the

   following words here in the Microsoft Knowledge Base:

      dynamic and counter and query.

 - You can use this method with a Grouping/Totals report to

show the top

   10 records per group. To do this, change the counter

control's

   RunningSum property from Over All to Over Group.

 - You can use this method with a Grouping/Totals report to

show the top

   10 groups. To do this, add the counter control to the

report's group

   header instead of to the detail section, and add the

macro to the

   OnFormat property of the group header, the detail

section, and the

   group footer.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 19,

"Sorting and

Grouping Data," pages 450-464

Additional reference words: 1.00 1.10 Reports RunningSum


INF: How to Display Intervals Greater Than 24 Hours

 Article Number: Q109320

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you are displaying an interval of greater than 24 hours in a

calculated control, the interval will not be displayed correctly.

Depending on the format of the control, you will see just the hours and

minutes, or you will see an incorrect date, such as 12/31/1889.

This article demonstrates three sample functions you can add to a

calculated control to correctly display intervals of greater than 24

hours.

MORE INFORMATION

NOTE: This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access.

To find the number of hours elapsed between two dates, you can subtract

the values in Access Basic. For example, the sample code

   StartDate=#6/1/93 8:00AM#

   EndDate=#6/1/93 1:00PM#

   ?Format(EndDate-StartDate,"hh:mm")

will return a value of 05:00, which is the correct result.

However, the sample code

   StartDate=#6/1/93 8:00AM#

   EndDate=#6/3/93 3:00PM#

   ? Format(EndDate-StartDate,"hh:mm")

will return a value of 07:00, which is incorrect. The correct result

is 55:00.

The following three sample functions will display the elapsed time

correctly:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

1. Open a module and enter the following in the Declarations section:

      Option Explicit

      Global StartDate

      Global EndDate

2. Enter the following functions:

      '---------------------------------------------------

      ' This function accepts a time interval and returns

      ' a value, such as "55:23" for 55 hours and 23 minutes.

      '---------------------------------------------------

      Function HoursMinutes (Interval)

         Dim Hours As Long, Minutes As Integer

         If IsNull(Interval) Then

            HoursMinutes = Null

         Else

            Hours = Int(Interval * 24)

            Minutes = CInt((Interval * 24 - Hours) * 60)

            If Minutes = 60 Then

               Minutes = 0

               Hours = hours + 1

            End If

            HoursMinutes = Hours & ":" & Format(Minutes, "00")

         End If

      End Function

      '---------------------------------------------------

      ' This function accepts a time interval and returns

      ' a value, such as "1 Day 23 Hours."

      '---------------------------------------------------

      Function DaysHours (Interval)

         Dim Days As Long, Hours As Long

         If IsNull(Interval) Then

            DaysHours = Null

         Else

            Days = Int(Interval)

            Hours = CInt((Interval - Days) * 24)

            If Hours = 24 Then

               Hours = 0

               Days = Days + 1

            End If

            DaysHours = Days & IIf(Days = 1, " Day ", " Days ") & _

               Hours & IIf(Hours = 1, " Hour", " Hours")

         End If

      End Function

      '---------------------------------------------------

      ' This function accepts a time interval and returns

      ' a value, such as "3 Days 17:43".

      '---------------------------------------------------

      Function DaysHoursMinutes (Interval)

         Dim Days As Long, Remainder As Double

         If IsNull(Interval) Then

            DaysHoursMinutes = Null

         Else

            Days = Int(Interval)

            Remainder = Interval - Days

            If Remainder > #23:59:59# Then

               Remainder = 0

               Days = Days + 1

            End If

            DaysHoursMinutes = Days & IIf(Days = 1, " Day ", " Days ") & _

               Format(Remainder, "hh:mm") & " Hours"

         End If

      End Function

3. Open a new module, and type the following in the module's Immediate

   window:

      StartDate=#6/1/93 8:00AM#

      EndDate=#6/3/93 3:05PM#

      ?HoursMinutes(EndDate-StartDate)

   The HoursMinutes() function will return a value of 55:05.

4. Type:

      ?DaysHours(EndDate-StartDate)

   The DaysHours() function will return the value "2 Days 7 Hours."

5. Type:

      ?DaysHoursMinutes(EndDate-StartDate)

   The DaysHoursMinutes() function will return the value "2 Days 07:05."

REFERENCES

==========

For more information on calculating time differences, query on the

following words here in the Microsoft Knowledge Base:

   calculate and timevalue

Additional reference words: 1.00 1.10 2.00


PRB: Options Dialog Box Items Are Not Visible

 Article Number: Q109321

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you choose Options from the View menu, some of the option items are

not visible.

CAUSE

In the Microsoft Windows Control Panel, the Window Text color has been set

to the same color as the Button Face, which is the color Microsoft Access

uses for the background color in the Options dialog box.

RESOLUTION

1. Start the Microsoft Windows Control Panel.

2. Double-click the Color icon.

3. Choose Color Palette.

4. Select Button Face in the Screen Element box.

5. Choose a different color for the Button Face.

6. Choose OK.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start the Control Panel.

2. Double-click the Color icon.

3. Choose Color Palette.

4. Select Window Text in the Screen Elements box.

5. Choose a color (for example, the light gray color).

6. Select Button Face in the Screen Elements box.

7. Choose the same color you chose in step 5.

8. Choose OK. Close the Control Panel.

9. Start Microsoft Access and open any database. Choose Options from the

   View menu.

REFERENCES

==========

Microsoft Windows "User's Guide," version 3.1, pages 141-147

Additional reference words: 1.00 1.10 2.00 Grey


INF: Relationships Between Attached Microsoft Access Tables

 Article Number: Q109322

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Although relationships cannot be established between attached tables in

Microsoft Access, referential integrity can be enforced if the attached

tables reside in another Microsoft Access database, and if relationships

have been established in that Microsoft Access database.

MORE INFORMATION

The following example demonstrates the use of referential integrity between

attached Microsoft Access tables:

1. Create a new database in Microsoft Access.

2. From the File menu, choose Attach Table. Select Microsoft Access in

   the Data Source box, and then choose OK.

3. In the File Name box, select the sample database NWIND.MDB, and then

   choose OK.

4. Attach the Categories and Products tables, and then choose Close.

5. Open the Categories table in Datasheet view.

6. Try to delete any record in the table. You will receive the following

   error message:

      Can't delete or change record. Since related records exist in table

      'Products', referential integrity rules would be violated.

7. Open the Products table in Datasheet view.

8. Try to add a record whose Category ID does not exist in the Categories

   table. You will receive the following error message:

      Can't add or change record. Referential integrity rules require a

      related record in table 'Categories.'

Note that you cannot define relationships for the attached tables in the

Edit Relationships dialog box; the relationship must be established by

a join in a query. If you do create a query using the attached tables, make

sure that any join lines join fields with the same data type.

REFERENCES

==========

For more information on creating relationships between attached tables,

query on the following words here in the Microsoft Knowledge Base:

   create and relationships and attached

Additional reference words: 1.00 1.10 relate attach


INF: How to Create a Graph Bound to Two Combo Boxes

 Article Number: Q109323

 CREATED: 02-JAN-1994

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to create a graph that is bound to two combo

boxes. You can control the data that is displayed in the graph with your

selections in the combo boxes.

MORE INFORMATION

The following example demonstrates how to set up a graph that is bound to

two combo boxes:

 1. Start Microsoft Access and open the sample database NWIND.MDB.

 2. Create the following query based on the Orders, Order Details, and

    Products tables:

       Query: QueryTest

       -----------------------------------------------------

       FieldName: Order Amount

          Table Name: Orders

          Total: Sum

       FieldName: Product Name

          Table Name: Products

          Total: Group By

       FieldName: Category ID

          Table Name: Products

          Total: Group By

       FieldName: Year: CStr(NulltoZero(Year([Order Date])))

          Table Name:

          Total: Group By

 3. Create a new form based on the QueryTest query. Choose FormWizards.

 4. Select Graph and then choose OK.

 5. Choose Next.

 6. Select SumofOrderAmount and then choose ">". Select Product Name and

    then choose ">". Select Category ID and then choose ">". Choose Next.

 7. Select Category ID, and then choose Next.

 8. Choose Open to view the form in Form view.

 9. View the form in Design view.

10. From the Layout menu, choose Form Hdr/Ftr.

11. Add two combo boxes with the following properties to the form:

       Object: Combo box

       -----------------------------

       ControlName: SelectCat

          RowSourceType: Table/Query

          RowSource: Categories

       Object: Combo box

       ---------------------------------

       ControlName: SelectYear

          RowSourceType: Value List

          RowSource: 1989;1990;1991;1992

12. Select the graph and modify the properties of its object frame as

    follows:

       Object: Object Frame

       -----------------------------------------

       ControlName: Embedded0

          LinkChildFields: Category Id;Year

          LinkMasterFields: SelectCat;SelectYear

13. View the form in Form view. As you make different selections in the

    combo boxes, the contents of the graph will change.

Additional reference words: 1.00 1.10 2.00


PRB: Find Company Macro Does Not Work Correctly in NWIND.MDB

 Article Number: Q109324

 CREATED: 02-JAN-1994

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The appropriate record for the company you selected in the Select Company

To Find box on the Suppliers form in the sample database NWIND.MDB will not

be displayed if you have chosen any of the alphabet buttons on the form.

For example, if you have chosen the "L" alphabet button, and then select a

company that has a name that starts with the letter "E" in the Select

Company To Find box, the record will not be displayed. Only companies whose

names start with the letter "L" can be displayed.

CAUSE

The alphabet buttons on the Suppliers form apply filters to the records. If

a filter is applied, only records that match the filter's criteria will be

displayed.

RESOLUTION

Choose the All button, so that no filters are applied, before using the

Select Company To Find box.

 -or-

Add the ShowAllRecords macro action as the first line of the Find Company

macro, which is the macro run by the Select Company To Find combo box. The

ShowAllRecords macro action removes all filters. To add the ShowAllRecords

action to the Find Company macro, follow these steps:

1. Open the sample database NWIND.MDB.

2. Open the Find Company macro in Design view.

3. Select the top cell in the Action column, and select ShowAllRecords in

   the action list.

4. Save the macro.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Open the Suppliers form in Form view.

3. Select any company name in the Select Company To Find box.

4. Choose the "L" alphabet button.

5. Select a company in the Select Company To Find box whose name does

   not begin with the letter "L". Note that the record for the company is

   not displayed.


PRB: Default Values Used Only with a Bound Control

 Article Number: Q109325

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If a form's underlying dynaset contains a field that has a default value,

the default value will not be used if there is no control bound to the

field.

RESOLUTION

A control on the form must be bound to the field in order for the default

value to be used when a new record is added.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create a new form based on the Order Details table. Include all the

   fields except Quantity (which has a default value of 1) on the form.

3. View the form in Form view. Add the following new records:

      Order ID   Product ID   Unit Price   Discount

      ---------------------------------------------

       12000     19           1.00         25%

4. From the File menu, choose Save Record.

5. Open the Order Details table in Datasheet view. Note that the Quantity

   column is blank for the records you added, even though this field has

   a default value of 1.

REFERENCES

==========

Microsoft Access "User's Guide," Version 1.0, pages 216-217

Microsoft Access "User's Guide," Version 1.1, pages 220-222

Additional reference words: 1.00 1.10


PRB: Report Grouping on Date/Time Field Incorrect

 Article Number: Q109326

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

A report that groups on a Date/Time field will group incorrectly if Group

On is set to Day and the Interval is set to 1. The report will group the AM

and PM records in different groups, instead of putting all the records for

one day in one group. In some cases, the group header will be repeated.

RESOLUTION

To get the correct grouping on the report, set Group On to Hour and set the

Interval to 24.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

 1. Copy the Orders table in the sample database NWIND.MDB to a table

    named Orders1.

 2. Open the Orders1 table in Datasheet view. Modify the entries in the

    Order Date column as follows, making sure to add "AM" and "PM"

    (without the quotation marks) as indicated:

       Order ID      Order Date

       -------------------------------

       10000         1/6/92 9:00:00 AM

       10001         1/6/92 3:00:00 PM

       10002         1/7/92 9:00:00 AM

       10003         1/7/92 3:00:00 PM

       10004         1/7/92 3:00:00 PM

 3. Delete all other records in the table.

 4. Create a new report based on the Orders1 table.

 5. Choose ReportWizards.

 6. Select Groups/Totals, and then choose Next.

 7. Select Order ID and then choose ">". Select Order Date and then

    choose ">". Choose Next.

 8. Select Order Date and then choose ">". Choose Next.

 9. Select Day in the Records Will Be Grouped By box, and then choose

    Next.

10. Choose Next.

11. Choose Next.

12. Choose Print Preview.

Note that January 6 is split into two groups. One group contains the AM

records for January 6, and the other group contains the PM records for

January 6 and the AM records for January 7.

Additional reference words: 1.00 1.10


INF: How to Fill a Combo Box with Table Names (1.x)

 Article Number: Q109327

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article describes how to create a combo box that will list the names

of the tables in your Microsoft Access version 1.x database.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access.

MORE INFORMATION

The following example demonstrates how to create a combo box that lists the

names of tables in your database:

1. Add the following to the Declarations section of the Introduction to

   Programming module in the sample database NWIND.MDB:

      Option Explicit

2. Enter the following sample function:

   NOTE: In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

   Function TableList (Fld As Control, Id, Row, Col, Code)

      Static TbLst_Array(100), No_Entries

      Dim MyDB As Database

      Dim cnt As Integer

      Dim Returnval

      Dim SnapOfTables As Snapshot

      Returnval = Null

      Set MyDB = CurrentDB()

      Set SnapOfTables = MyDB.ListTables()

      Select Case code

         Case 0

         '------------------------------------------------------------

         '  CASE 0:  Initializes the function. Lets the function know

         '  how many elements will be in the list box. It also

         '  initializes the array that holds the elements.

         '------------------------------------------------------------

            SnapOfTables.MoveFirst

            No_Entries = 0

            TbLst_Array(No_Entries) = Null

            Do Until SnapOfTables.EOF

               If SnapOfTables.tabletype = db_table And_

               SnapOfTables.attributes = 0 Then

                  TbLst_Array(No_Entries) = SnapOfTables.Name

                  No_Entries = No_Entries + 1

               End If

               SnapOfTables.MoveNext

            Loop

            Returnval = No_Entries

         Case 1

         '------------------------------------------------------------

         ' Open. Provides a unique id number for the function. Most

         ' cases just use the following code in this case.

         '------------------------------------------------------------

            Returnval = Timer

         Case 2

         '------------------------------------------------------------

         ' (Reserved for future use.) This case should be omitted.

         '------------------------------------------------------------

         Case 3

         '------------------------------------------------------------

         ' Number of Rows. Lets the function know how many rows are

         ' going to be in the list (can be zero). Use -1 if number is

         ' unknown.

         '------------------------------------------------------------

            Returnval = No_Entries

         Case 4

         '------------------------------------------------------------

         ' Number of Columns. (CANNOT BE ZERO) Should match the value

         ' in the property sheet.

         '------------------------------------------------------------

            Returnval = -1

         Case 5

         '------------------------------------------------------------

         ' Column width. Width in twips of column specified by the col

         ' argument. Use -1 to use default widths.

         '------------------------------------------------------------

            Returnval = -1

         Case 6

         '------------------------------------------------------------

         ' List Entry. Gives element to be displayed in the row and

         ' column specified by the row and col arguments.

         '------------------------------------------------------------

            Returnval = TbLst_Array(row)

         Case 7

         '------------------------------------------------------------

         ' Format String. Format string to be used to format the list

         ' element displayed in the row and column specified by the

         ' row and col arguments. Use NULL to use the default format.

         '------------------------------------------------------------

         Case 8

         '------------------------------------------------------------

         '(Reserved for Future Use.) This case should be omitted.

         '------------------------------------------------------------

         Case 9

         '------------------------------------------------------------

         ' End. This is the last call to function. Always

         ' include this case. This is a good place for any

         ' cleanup code.

         '------------------------------------------------------------

            For No_Entries = 0 To cnt

               TbLst_Array(cnt) = ""

            Next

      End Select

      TableList = Returnval

   End Function

3. Save the module.

4. Create a new, unbound form.

5. Place a combo box with the following properties on the form:

      Form: Form1

      ---------------------------

      Combo Box:

         ControlName: Tablelist

         RowSourceType: TableList

         ColumnCount:    1

         BoundColumn:    1

6. View the form in Form view. Click the combo box.

The combo box will be filled with the names of the tables in the NWIND

database.

REFERENCES

==========

Microsoft Access "User's Guide," Chapter 9, "Designing Forms"

Microsoft Access "Introduction to Programming," pages 82-85

Additional reference words: 1.00 1.10


PRB: CTRL+' Does Not Trigger Update Events in Datasheet View

 Article Number: Q109328

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The CTRL+' key combination does not trigger either the BeforeUpdate or the

AfterUpdate property of a form control when the form is in Datasheet view.

The key combination also does not work in a control on a subform that is in

Datasheet view.

RESOLUTION

Do not use macros or functions for the BeforeUpdate or AfterUpdate property

of controls on forms that will be used in Datasheet view.

If you need to trigger update events for a control on a form that will be

used in Datasheet view, such as a subform, create the form with a tabular

look and set the DefaultView property of the form to Continuous Forms. This

will produce a form that appears to be in Datasheet view, but will allow

the update events to be triggered.

If you need to trigger update events for a control on a form that will be

used in both Form view and Datasheet view, use a key assignment macro like

Autokeys to select the field in the previous record, copy the value found

there, return to the current record, and paste the value.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create the following new macro called Test Macro:

      Test Macro Actions

      ----------------------------------

      MsgBox

         Message: This Field has Changed

3. Open the Customers form in Design view.

4. Set the Customer Name control's AfterUpdate property to Test Macro.

5. View the form in Datasheet view.

6. From the Records menu, choose Go To. Choose New.

7. Select the Customer name field, press CTRL+', and then select another

   field in the same record.

Note that the message box does not appear, meaning that the AfterUpdate

event was not triggered. Repeating steps 6-7 with the form in Form view

will cause the message box to appear.

Additional reference words: 1.00 1.10


INF: How to Delete Duplicate Records from a Table

 Article Number: Q109329

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to remove duplicate records from a table using

primary keys. This is particularly useful for tables with more than 10

fields, where it is not possible to use the Group By function in queries.

MORE INFORMATION

The following example demonstrates how to remove duplicate records from a

table:

1. Make a copy of the table from which you want to remove the duplicate

   records. To copy a table, select the table in the Database window and

   then choose Copy from the Edit menu. Then choose Paste from the Edit

   menu. Enter a new name for the table and select the Structure Only

   option. Choose OK.

2. Open the new table in Design view and assign primary keys to the fields

   that you want to check for duplicates.

3. Save and then close the table.

4. Create an append query and append the data from the original table into

   the new table. Because the primary key fields in the new table will not

   permit duplicates, the error message

      Errors were continued...Proceed anyway?

   will occur when you run the append query. Choose OK. The new table

   will contain the data from the original table, but without duplicates.

NOTE: A fast way to remove duplicates from small tables is to skip the

append query, and instead Edit and Paste the table a second time. This

time, select Append Data To Existing Table. This will result in an error

message similar to the one stated above, and the data from the original

table will be pasted into the new table without the duplicates.

REFERENCES

==========

For more information on deleting duplicate records, query on the

following words here in the Microsoft Knowledge Base:

   query and unique and duplicate and filter

Microsoft Access "User's Guide," Version 1.0, pages 28-29, 32-33, and

174-178

Additional reference words: 1.00 1.10 2.00


INF: How to Replace a String with Another String

 Article Number: Q109330

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article demonstrates a sample function you can use to replace one

string with another string.

MORE INFORMATION

The following sample function can be used to replace one string with

another. This function accepts three parameters that specify:

 - the string that contains the string you want to replace

 - the specific string to be replaced

 - the value of the replacement string

The following steps demonstrate how to create and use the sample function

Replace():

1. Create a new module.

2. Enter the Access Basic code below.

   NOTE: In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

      '=============================================================

      ' Declarations section of the module

      '=============================================================

      Option Explicit

      Function Replace(Valuein, WhatToReplace, Replacevalue)

         Dim Temp as String, P

         Temp = Valuein

         P = Instr(Valuein, WhatToReplace)

         Do While P > 0

            Temp=Left(Valuein,P-1) & Replacevalue &_

                Mid(Valuein,P+Len(WhatToReplace))

            P = Instr(P + Len(WhatToReplace),Valuein, WhatToReplace,1)

         Loop

         Replace = Temp

      End Function

3. To replace the string "Sample" with the string "Test" in the string

   "This is a Sample," use the following parameters for the Replace()

   function:

      Valuein: "This is a Sample"

      WhatToReplace: "Sample"

      ReplaceValue: "Test"

The function Replace("This is a Sample","Sample","Test") will return:

   This is a Test

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 276-277 and

page 303

Additional reference words: 1.00 1.10 2.00 substitute


INF: How to Import FoxBase for Macintosh Files

 Article Number: Q109331

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

FoxBase for Macintosh files can be imported into or attached to Microsoft

Access by specifying a dBASE III data source file type.

MORE INFORMATION

Although you can import or attach FoxBase for Macintosh files in Microsoft

Access by specifying a dBASE III data source file type, make sure to note

the following restrictions:

 - You cannot import FoxBase for Macintosh files that contain fields with

   a PICT data type. The PICT data type is similar to the Microsoft Access

   OLE data type. If you import a file that contains a field with a PICT

   data type, you will receive the following error message:

      External table isn't in the expected format.

 - You can import FoxBase for Macintosh files that contain memo fields only

   if the associated .DBT file is present. The .DBT file must be located in

   the same directory as the FoxBase (.DBF) file. The .DBT file will be

   incorporated into the Microsoft Access table and is not needed by

   Microsoft Access after the import process is complete.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 4, "Importing,

Exporting, and Attaching," pages 60-64

Additional reference words: 1.00 1.10 2.00 Foxbase Import Macintosh


PRB: Error Using Automatic ODBC Setup with Auto Switch

 Article Number: Q109333

 CREATED: 02-JAN-1994

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Page 663 of the Microsoft Access "User's Guide," version 1.0, and page

673 of the Microsoft Access "User's Guide," version 1.1, contains

instructions for creating an ODBC installation disk or directory, and for

setting up ODBC automatically.

If you follow these instructions, you will receive the error message:

   Setup is unable to install ODBC. C:\~MSODBC.T\ODBCINST.INI is

   either empty or missing.

CAUSE

There is a step missing in the instructions. The [FILES] section of the

SETUP.LST file is missing two lines.

RESOLUTION

To correct this problem, open the SETUP.LST file in any text editor, such

as Windows Notepad. The SETUP.LST file is located on your ODBC disk, or in

the directory where the ODBC files were copied. Add the following two lines

to the [FILES] section:

   ODBC.INI = ODBC.INI

   ODBCINST.INI = ODBCINST.INI

Run the Setup program again.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, page 663

Microsoft Access "User's Guide," version 1.1, page 673

Additional reference words: 1.00 1.10 docerr


INF: How to Dynamically Create a Filter

 Article Number: Q109334

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes a method of dynamically creating a filter by

applying expressions on a form using a macro. The same technique can

also be adapted to a Query by Form (QBF) method.

The article assumes that you are familiar with form and macro design.

MORE INFORMATION

The "+" and "&" operators are used to concatenate (join) two string

values. However, each operator behaves differently when used on null-

valued strings. For example, if you use a null variable "Name" in the

expression "Dear "+[Name], then the expression evaluates to null,

whereas if you have the expression "Dear "&[Name], then the expression

evaluates to "Dear ".

You can use these different behaviors to build a string for use in the

Where condition of an ApplyFilter or OpenForm macro action. You combine

the strings using the + operator to concatenate values to dynamically

build each separate part of the filter (which becomes null if no value

is entered), then use the & operator to concatenate the separate strings.

The example below, using the sample database NWIND.MDB, uses a form and

a macro to create a 3-field filter:

1. Open the sample database NWIND.MDB.

2. Open the Employees form in Design view.

3. Choose Save As from the File menu and save the form as Employees 2.

4. Widen the Employees 2 form and add the following controls to the

   new blank area in the detail section to the right of the photo:

   NOTE: The labels should be to the left of their corresponding text

   boxes.

      Label

      ------------------

      Caption: Search ID

      Text Box

      -------------------------------

      Name: SID

      ControlSource: <leave blank>

      AfterUpdate: Filter.Make null 2

      NOTE: In Microsoft Access version 1.x, The Name property is

      called ControlName.

      Label

      --------------------------

      Caption: Search First Name

      Text Box

      -----------------------------------------------------

      Name: SName

      ControlSource: <leave blank>

      Validation Rule: Not Like "*'*" Or Is Null

      Validation Text: Can't use apostrophe in filter text.

      AfterUpdate: Filter.Make null

      Label

      -------------------------

      Caption: Search Hire Date

      Text Box

      -----------------------------------------------------

      Name: SDate

      ControlSource: <leave blank>

      Validation Rule: Not Like "*'*" Or Is Null

      Validation Text: Can't use apostrophe in filter text.

      AfterUpdate: Filter.Make null

      NOTE: In the following example, an underscore (_) is used as a

      line-continuation character. Remove the underscore when re-creating

      this line.

      Text Box

      -------------------------------------------------------------------

      Name: Where Text

      ControlSource: =Mid((" And [Employee ID]="+[SID]) & _

                             (" And [First Name] Like '"+[SName]+"'") & _

                             (" And [Hire Date] Like '"+[SDate]+"'"),6)

      Command Button

      ---------------------------

      Caption: Apply Filter

      OnClick: Filter.Apply Filter

      NOTE: In Microsoft Access version 1.x, the OnClick property

      is named OnPush.

5. Create the following macro group:

      Macro Group: Filter

      --------------------------------------------------------------

      Macro Name: Make null

         Condition:  IsNull(Screen.ActiveControl)

         Action: StopMacro

         Description: This macro is for text fields.

         Condition: Len(Screen.ActiveControl)=0

         Action: SetValue

         Item: Screen.ActiveControl

         Expression: Null

         Description: Make an empty text field null.

      Macro Name: Make null 2

         Condition: IsNull(Screen.ActiveControl)

         Action: StopMacro

         Description: This macro is for numeric fields.

         Condition: Not IsNumeric(Screen.ActiveControl)

         Action: SetValue

         Item: Screen.ActiveControl

         Expression: Null

         Description: Turn non-numeric values into nulls.

      Macro Name: Apply Filter

         Condition: IsNull([Where Text])

         Action: ApplyFilter

         Where Condition: True

         Description: No Where Text, so select all records and stop.

         Condition: ...

         Action: StopMacro

         Condition: Len([Where Text]) > 255

         Action: MsgBox

         Message: You have selected too many criteria in the filter.

         Title: Apply Filter

         Description: If filter too long, display warning and stop.

         Condition: ...

         Action: StopMacro

         Action: ApplyFilter

         Where Condition: =[Where Text]

         Description: Apply the filter.

6. Save the macro and the form.

7. View the form in Form view and enter values in the search fields.

Note that the data for the Apply Filter's Where condition is

constructed in the Where text control. If you do not want users to see

this, set the Visible property of the Where text field to False.

Limitations

-----------

 - The length of the ControlSource property for the Where text box cannot

   exceed 255 characters. Microsoft Access will not let you type an

   expression longer than this. One workaround to this limitation is to

   use several text boxes to build each part of the criteria, then use a

   final text box to combine the various parts into a single Where

   clause.

 - The string that the expression produces cannot exceed 255 characters.

   The second test in the Apply Filter macro above tests for this

   condition. If the filter string is longer than 255 characters, you

   will receive a warning that the filter is too long and the macro

   will halt.

To modify the above example for a QBF method, add the controls

to a blank unbound form and change the ApplyFilter actions to OpenForm

actions. To select all the records using OpenForm actions, leave the

Where condition blank instead of using True.

REFERENCES

==========

For more information on the ApplyFilter action, search for "ApplyFilter"

using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 macros forms


INF: SQL Server System Administrator Cannot See System Tables

 Article Number: Q109335

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

In order for the SQL Server System Administrator (logged on as SA) to see

the SQL Server system tables from within Microsoft Access, the Show System

Objects option must be set to Yes in Microsoft Access.

MORE INFORMATION

The Show System Objects option is set to No by default because most users

do not need to see the system tables. You can change this option back and

forth between Yes and No as needed.

NOTE: Setting the Show System Objects option to Yes will show the Microsoft

Access system tables. The system tables have names beginning with MSys.

These tables are undocumented and are subject to change in future versions

of the product. Changes to these tables are unsupported.

The following steps describe how to change the Show System Objects

option:

1. Start Microsoft Access.

2. Open any database.

3. From the View menu, choose Options.

4. Select General in the Category box.

5. Modify the Show System Objects option in the Items box.

6. Choose OK.

Additional reference words: 1.00 1.10 2.00


PRB: Duplicate Values Printed on Report

 Article Number: Q109336

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Multiple instances of the same value are printed in a field on your report,

even though only one instance of the value exists in the underlying data.

CAUSE

This problem can occur if there are any nonprintable characters at the end

of the value in the underlying data and if the field's CanGrow property is

set to Yes. Note that if the CanGrow property is set to No, the problem

does not occur.

Note that this problem is most noticeable when using the @QuerySQL table

created by the ANALYZER.MDA in Microsoft Access version 1.x. The field

SQLStatement contains the nonprintable character.

RESOLUTION

1. Open the underlying table in Datasheet view.

2. Select the value that was printed multiple times on the report.

3. Press END to move the insertion point to the end of the value.

4. Press BACKSPACE until the insertion point reaches the value's last

   visible character.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10


PRB: Menu Visible When All Objects Are Minimized
PRB: Menu Visible When All Objects Are Minimized [B_WAccADK]

 Article Number: Q109337

 CREATED: 02-JAN-1994

 MODIFIED: 05-JAN-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

The normal Microsoft Access menu bar is displayed even though all objects

(such as forms and reports) are minimized and the Microsoft Access window

is empty. The menu bar appears as it was designed to with custom menu

macros when a form or report is displayed.

CAUSE

The normal Microsoft Access menu bar that appears in this situation is the

Database window menu bar. The Microsoft Access run-time executable hides

the Database window by keeping it minimized and not displaying the

minimized window's icon. However, the Database window's menus and commands

are still available.

RESOLUTION

To keep the Database window's menu bar from being displayed, you must

hide the Database window. You can hide the Database window by adding the

following sample macro actions to the executable's Autoexec macro:

NOTE: Make sure to add this line before any OpenForm actions in the

Autoexec macro in order to avoid hiding the forms after they are opened.

   Action

   ----------------------

   DoMenuItem

      MenuBar:  Database

      Menuname: Window

      Command:  Hide

Additional reference words: 1.10 ADK


INF: How to Declare C++ Functions Called from Access Basic

 Article Number: Q109338

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

The following steps describe how to call C++ dynamic-link library (DLL)

functions in Access Basic:

1. Make sure to define the functions within your C++ code with the

   "extern" declaration. The following example demonstrates the syntax for

   the extern declaration:

      extern "C" {return type} FAR PASCAL  __export {function name}

         ({parameters})

   An example of an actual declaration in your C++ code might look

   like:

      extern "C" int FAR PASCAL __export my_func ()

   To call the sample function above you would define the Declare

   statement as follows:

      Declare Function my_func Lib "MYLIB.DLL" () As Integer

2. Make sure that the declaration is not set for case-sensitive

   exports.

REFERENCES

==========

For more information on calling DLLs, search on "declare external

procedures" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 Programming


PRB: Incorrect Time Calculations in Years Prior to 1900

 Article Number: Q109339

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Using the DateAdd() function to perform a time calculation on a Date/Time

field that contains a date prior to the year 1900 returns an incorrect

value. For example, the expression

   DateAdd("n",30,#January 1, 1776 9:00:00 AM#)

should add 30 minutes to the value, but instead returns:

   January 1, 1776 8:30AM

CAUSE

Microsoft Access stores dates as serialized numbers that represent the

number of days from a reference date. The time component is represented by

the digits to the right of the decimal point. Since Microsoft Access uses

December 31, 1899 as the reference date, all dates prior to that date are

stored as negative numbers. Microsoft Access correctly interprets larger

negative whole numbers as earlier dates, but incorrectly interprets larger

negative fractions as an earlier time.

RESOLUTION

Use an immediate if (IIf) function, or an If-Then-Else construction, in

Access Basic to reverse the sign of the calculation. The following example

demonstrates how to use the IIf() function to reverse the calculation's

sign for a Date/Time field called MyDate.

NOTE: In the following example, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating example.

   IIf([MyDate]<#12/31/1899#, DateAdd("n",-30,[MyDate]),_

   DateAdd("n",30,[MyDate]))

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 102-103

Additional reference words: 1.00 1.10 query ab


PRA: Cannot Edit Text Box on Pop-Up Form

 Article Number: Q109340

 CREATED: 02-JAN-1994

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You cannot enter or delete text in a text box on a pop-up form when

Microsoft Access is minimized.

RESOLUTION

Do not minimize Microsoft Access if you need to work with data on a pop-

up form.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. We are researching this problem and will post new information

here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Create a new form.

2. Change the form's Popup property to Yes.

3. Place a text box control on the form.

4. Save the form as Form1.

5. Create a new macro with the following actions:

      Action        Arguments

      -----------------------------

      SendKeys      Keystrokes: % N

                       Wait: yes

      OpenForm      FormName: Form1

6. Run the macro.

7. Try to enter text in the text box on the pop-up form. Note that you

   cannot edit the text box.

Additional reference words: 1.00 1.10 Forms


PRB: "ODBC Call Failed" When Exporting Table to SQL Server

 Article Number: Q109341

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You receive the error message "ODBC - Call failed" when you export a

Microsoft Access table to a SQL Server database using ODBC if the table

field names are SQL reserved words. This error message is followed by

another which reads:

   [Microsoft][ODBC SQL Server Driver][SQL Server] Incorrect syntax

   near the keyword '<keyword>'. (#156)

CAUSE

This problem will occur if the table you are exporting contains a field

name that is also an SQL keyword. The Microsoft ODBC driver for SQL Server

translates the export command into an SQL statement that can be interpreted

by the SQL Server. If a field name in the Microsoft Access table is an SQL

keyword, the SQL Server will interpret the field name as an SQL command

keyword.

RESOLUTION

Rename the fields in the Microsoft Access table to non-SQL reserved words.

Field names such as Order, In, From, or Where should not be used when

you create Microsoft Access tables.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Create a new table with a field named Order.

2. Save the table with the name Test Table.

3. From the File menu, choose Export.

4. In the Data Destination box select <SQL Database>, and then choose OK.

5. In the Select Microsoft Access Object box, choose Test Table. Choose OK.

6. In the Export dialog box, choose OK.

7. In the SQL Data Sources dialog box, select a SQL Server. Choose OK.

8. If necessary, log on to the SQL Server using the SQL Server Login

   dialog box.

The error messages stated above will be displayed.

Additional reference words: 1.00 1.10 2.00


PRA: GP Fault Importing Multiuser Microsoft Excel Spreadsheet

 Article Number: Q109342

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If you are importing a multiuser Microsoft Excel spreadsheet and someone

else tries to open the spreadsheet from Microsoft Excel during the import

process, you will receive a general protection (GP) fault error message,

such as:

   General Protection Fault in MSAJU110.DLL at 0007:006E2

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB.

2. Import data from any Microsoft Excel spreadsheet. Use the default

   choice to create a new table in Microsoft Access.

3. While the data is being imported, attempt to open the same spreadsheet

   from Microsoft Excel on a different computer.

Additional reference words: 1.00 1.10 gpf adk


PRA: Error Importing Filenames Without Extensions

 Article Number: Q109343

 CREATED: 02-JAN-1994

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If you attempt to import an external database with a filename that does not

have an extension (such as .DB, .DBF, and so on), you will receive the

error message:

   Couldn't find object '<tablename>'

RESOLUTION

Make sure that all external database files that you want to import have

the appropriate database filename extension.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. We are researching this problem and will post new information

here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Using the Microsoft Windows File Manager, copy the FoxPro database file

   NEWCUST.DBF to NEWCUST (no extension). Note that NEWCUST.DBF is included

   with Microsoft Access and is in the ACCESS directory.

2. Start Microsoft Access and open the sample database NWIND.MDB.

3. From the File menu, choose Import.

4. In the Data Source box, select Foxpro 2.0, and then choose OK.

5. In the Select File dialog box, select "All Files (*.*)" in the List

   Files Of Type box. In the Directories box, select the ACCESS directory.

6. In the File Name box, select NEWCUST. Choose Import.

You will receive the error message stated above, even though the file is

available and is a valid FoxPro database file.

Additional reference words: 1.00 1.10 Importing


PRA: OLE Objects Clipped Using Fahrenheit Video Driver

 Article Number: Q109344

 CREATED: 02-JAN-1994

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

OLE objects inserted into a Microsoft Access form will be clipped on the

bottom and on the right side if you are using an Orchid Fahrenheit video

driver in Microsoft Windows.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1, and 2.0. We are researching this problem and will post new

information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The following Orchid Fahrenheit drivers are known to cause this problem:

 - All 800 x 600 resolution drivers

 - The 1024 x 768 16 colors large font driver

Steps to Reproduce Problem

--------------------------

1. Install any of the above listed video drivers in Microsoft Windows.

2. Start Microsoft Access. Open any database.

3. Open a new form.

4. From the Edit menu, choose Insert Object.

5. Select Microsoft Graph, and then choose OK.

6. Close Microsoft Graph. Choose Yes in the Update Changes box.

Note that the chart is clipped on the bottom and on the right side.

Additional reference words: 1.00 1.10 2.00 Interoperability


PRA: RowSource Property Changes Commas to Semicolons

 Article Number: Q109345

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you set the RowSource property of a list or combo box control to

a query name containing commas, the commas are changed to semicolons.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Create a new query, and then save the query with a name that

   contains a comma. For example, save your query as "My, Query"

   (without the quotation marks).

2. Create a new form and place a combo box control on it.

3. Set the RowSourceType property of the combo box to Table/Query.

4. Select "My, Query" as the RowSource property for the combo box.

Note that "My, Query" is changed to "My;Query."

Additional reference words: 1.00 1.10 Queries


PRA: Error Message "Internal Database Error -1310"

 Article Number: Q109346

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you run a large query (about 25K or more in size), you receive the

error message

   Internal database error -1310 has occurred

even if the SQL statement is correct.

CAUSE

This error is caused by an out of memory condition in an internal

memory segment.

RESOLUTION

Break up large queries that generate this error into several smaller

queries.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1, and 2.0. We are researching this problem, and will post new

information here in the Microsoft Knowledge Base as it becomes available.

Additional reference words: 1.00 1.10 2.00 Queries OOM


PRB: Locking First Record Also Locks Last Record

 Article Number: Q109347

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you set the Default Record Locking option to Edited Record in the

Multiuser category of the Options dialog box, editing the first record may

lock both the first and the last record in the table.

CAUSE

Some data from the first record may be stored in the last data page in

the table. The entire data page is locked, which locks both the first

and the last record.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access on two different computers and open the

   sample database NWIND.MDB.

2. On both computers, choose Options from the View menu.

3. On both computers, select Multiuser from the Category box.

4. On both computers, select Edited Record in the Default Record Locking

   box.

5. On one of the computers, open the Customers table. Edit the first record

   by adding enough characters to each field so that each field is the

   maximum allowed length. This will force Microsoft Access to store the

   data on the last data page.

6. On the other computer, open the Customers table, move to the last

   record, and try to edit the record.

Note that compacting your database periodically will keep the data in order

on the data pages, which should help prevent this problem from occurring.

Note also that if all the records in a table are locked when you choose the

Edited Record option it means that all the records fit on one data page,

and therefore if any record is locked, then all the records are locked.

REFERENCES

==========

For more information on record locking, query on the following words here

in the Microsoft Knowledge Base:

   record and locking

Additional reference words: 1.00 1.10 2.00


PRA: Datasheet and Run Buttons Disabled On Append Query

 Article Number: Q109348

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you create an append query using only a constant value in the Query-

By-Example (QBE) grid, the Datasheet and Run buttons remain disabled, even

though appending constant values is a valid query.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. Create a new query.

3. Choose Close in the Add Table dialog box.

4. From the Query menu, choose Append. Select any table in the Table

   Name box.

5. Type "100" (without the quotation marks) in the Field row.

Note that the Datasheet and Run buttons remain disabled.

Additional reference words: 1.00 1.10 Queries Appending Greyed Grayed


PRA: Macro with Action on Different Line Does Not Work

 Article Number: Q109349

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If a macro line contains a false condition with no action, or the action

is on a different line, the macro does not execute correctly.

For example, the following macro results in a message box, even though no

message box should be displayed (because the condition is false):

   CONDITION       ACTION

   ----------------------

   1=2

   ...             MsgBox

In the following example, no message box is displayed because the

condition is false and the action is on the same line as the condition:

   CONDITION       ACTION

   ----------------------

   1=2             Beep

   ...             MsgBox

If a condition is true, but the action is on a different line, the rest

of the macro group will not run.

RESOLUTION

Put a macro action on the same line as the condition.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10


PRA: "Cursor Stops at First/Last Field" Setting Ignored

 Article Number: Q109350

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You can move the insertion point among records even though you have set the

"Cursor Stops at First/Last Field" option in the Options dialog box to Yes.

RESOLUTION

To work around this problem, add the following two actions to an Autoexec

macro for your database:

   Action: SendKeys

      Keystrokes: %ck%i{tab 2}Yes{Enter}

         Wait: No

   Action: DoMenuItem

      Menu Bar: Database

      Menu Name: View

      Command: Options

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB.

2. Open the Categories table. Note that you can move among records with

   the RIGHT ARROW and LEFT ARROW keys.

3. From the View menu, choose Options. In the Category box, select

   Keyboard.

4. Set the "Cursor Stops at First/Last Field" option to Yes.

5. Quit Microsoft Access and restart it.

6. Open the Categories table. Notice you can still use the RIGHT ARROW

   and LEFT ARROW keys to move among records, even though now you should

   not be able to.

REFERENCES

==========

For more information on keyboard options, search for "Options command" then

"Options Command (View Menu)" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 ui


PRA: Reserved Error -1051 Pasting Over Primary Key Field

 Article Number: Q109351

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Microsoft Access allows you to paste a field over an existing primary key

field in a table's Design view. However, when you try to save the changes

to the table you will receive the error message:

   Reserved error (-1051); there is no error for this message.

CAUSE

Microsoft Access does not allow you to delete key fields from tables if

they are referenced in a relationship with other tables. However, Microsoft

Access does not check to see if a row can be deleted before pasting the new

row into the table.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

NOTE: In some cases the following example will generate a reserved error

(-1046). If you then close the table and choose No in the Save Changes To

Table <Tablename> box, the primary key WILL be gone when you next open the

table. Microsoft Access will not let you re-create the primary key because

the table is part of a relationship with at least one other table. You must

delete all relationships with other tables before you can re-create the

key.

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. Open the Customers table in Design view.

3. Select the Customer ID row.

4. From the Edit menu, choose Copy. Then, choose Paste from the Edit

   menu.

5. From the File menu, choose Save. Choose No in the Create A Primary

   Key? box.

The error message stated above will occur.

Additional reference words: 1.00 1.10


PRA: STFSETUP.EXE Does Not Overwrite Existing SYSTEM.MDA

 Article Number: Q109352

 CREATED: 02-JAN-1994

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The Change Workgroup utility (STFSETUP.EXE) will not overwrite an existing

SYSTEM.MDA file, but gives no indication that the SYSTEM.MDA file was not

overwritten.

RESOLUTION

To have the Change Workgroup application create a new SYSTEM.MDA file in a

directory that already contains a SYSTEM.MDA file, you must first remove

or rename the existing SYSTEM.MDA file.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Start the Change Workgroup utility.

2. Choose New.

3. Create a new workgroup in C:\TMP\SYSTEM.MDA. (Make sure you have a

   TMP subdirectory first.)

4. Repeat steps 1-3.

The process will be completed with no notification given that a new

SYSTEM.MDA was not created the second time.

Additional reference words: 1.00 1.10 Setup ChangeWorkGroups


PRA: "Database Already in Use" Error After Running Query

 Article Number: Q109353

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You receive the error message "Couldn't use '<database name>'; database

already in use" when you close a database after running a query containing

a subquery or crosstab query based on an empty table or another query.

You must quit Microsoft Access and restart it in order to restore proper

operation. In some cases, the database may become corrupt, and may result

in a database that remains corrupt even after you run the Repair Database

command and receive notification that the database was repaired

successfully.

RESOLUTION

To work around this problem, add some records to the empty underlying

table. Or, you can use a DLookUp() function to make sure all referenced

tables contain records before running the query.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

If a parameter query is the subquery for a query, and you do not enter

anything in the parameter box, the subquery will return an empty set, and

will cause the error stated above.

Steps to Reproduce Problem

--------------------------

 1. Start Microsoft Access and either create a new database or open one

    of your choosing.

 2. Create a new table called Table1 with the following structure:

      Field   Type

      --------------------

      f1      text

      f2      text

      f3      text

      z1      long integer

 3. Create another new table called Table2 with the following

    structure:

       Field   Type

       --------------------

       f4      text

       f5      text

       z2      long integer

 4. Create a new query called Query1 based on Table1.

 5. Click the Totals button.

 6. Drag all fields from Table1 to the query grid.

 7. Choose Group By in the Total row for all fields. The SQL

    statement (choose SQL from the View menu) should look like:

       SELECT DISTINCTROW Table1.f1, Table1.f2, Table1.f3, Table1.z1

       FROM Table1

       GROUP BY Table1.f1, Table1.f2, Table1.f3, Table1.z1

       WITH OWNERACCESS OPTION;

 8. Create a second query called Query2. Add Query1 and Table2 to the

    new query.

 9. Place a join line between field z1 in Query1 and field z2 in

    Table2.

10. Drag the f1 and f2 fields from Query1 to the query grid. The

    SQL statement should look like:

       SELECT  DISTINCTROW Query1.f1, Query1.f2

       FROM Query1, Table2,

       Query1 INNER JOIN Table2 ON Query1.z1 = Table2.z2

       WITH OWNERACCESS OPTION;

11. Do not enter any data. Instead, open Query2 and close the database

    from the Control menu of the Database window.

Additional reference words: 1.00 1.10 Queries


PRA: Opening Multiple-Column Query Causes Clause Truncation

 Article Number: Q109354

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

In Microsoft Access, each cell of the query grid has a character limit.

However, you can use multiple columns in the Query-By-Example (QBE) grid to

logically join clauses with an AND operator to form a larger query.

This technique works fine as long as you just run the query. However,

if you save the query, then reopen it, the clauses will be combined into

one statement that is truncated at the character limit as follows:

 - In Microsoft Access version 2.0, the character limit is 1024.

 - In Microsoft Access versions 1.0 and 1.1, the character limit is 255.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1, and 2.0. We are researching this problem, and will post new

information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The following sample query is longer than 255 characters, so Microsoft

Access versions 1.0 and 1.1 will not allow the entire query in one column

on the query grid:

   Column 1:  FieldN Not In ("arnold", "burnett", "crawford",

              "drayton", "edwards", "flaherty", "green", "harvey",

              "iverson", "jackson", "kelly", "lawrence", "morrison",

              "nelson", "opitz", "quale", "robertson", "simonsen",

              "thomas", "underwood", "vernon", "woods", "xavier",

              "yonsen", "zetterburg")

To use this query, you could break the statement up into two Not In clauses

against the same field (FieldN). The two statements would look like:

   Column 1:   FieldN Not In ("arnold", "burnett"..."lawrence")

   Column 2:   FieldN Not In ("morrison", "nelson"..."zetterburg")

This joins the clauses with a logical AND operator, producing the same

result as if it were all one statement.

Additional reference words: 1.00 1.10 2.00 Queries


INF: Errors When RunSQL Action Argument Exceeds 256 Characters

 Article Number: Q109355

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The RunSQL macro action argument can accept up to 256 characters. However,

you receive no error message that tells you when you have exceeded this

limit. Instead, the SQL string is truncated at 256 characters and Microsoft

Access attempts to parse the first 256 characters. This can cause a

variety of error messages, including:

 - Syntax error in WITH OWNERACCESS OPTION declaration.

 - Syntax error in query expression.

 - Missing semicolon (;) at end of SQL statement.

 - Syntax error in FROM clause.

The error message you receive depends on where the string was truncated.

MORE INFORMATION

Note that these errors occur when you manually enter a SQL string with more

than 256 characters. If you paste a string with more than 256 characters,

Microsoft Access will notify you that you have exceeded the limit with the

following error message:

   Text would be too long; change canceled.

Additional reference words: 1.00 1.10 2.00 Macros


PRA: "Can't Delete Account" After Losing Net Connection

 Article Number: Q109356

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You receive the error message "Can't delete account" when you attempt to

open or save database objects in a remote database after you lose your

network connection.

CAUSE

Microsoft Access cannot tell when a remote database is unavailable due

to a dropped or disconnected network connection. As a result, you receive

the misleading error message stated above.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10 Connecting


PRB: Error While Importing FoxPro Table Structure

 Article Number: Q109357

 CREATED: 02-JAN-1994

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00

------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 1.0

------------------------------------------------------------

SYMPTOMS

When you are importing an empty FoxPro version 2.0 table

into Micorosoft

Access, you receive the following error message:

   Table '<tablename#DBF>' is exclusively locked

CAUSE

The FoxPro indexed sequential access method (ISAM) opens

empty tables in

exclusive mode, and opens non-empty tables as read-only.

Microsoft Access

opens the table, placing it in exclusive mode, and then

attempts the

import. The import cannot be carried out, however, because

the table has

already been opened exclusively.

STATUS

This problem was corrected in Microsoft Access version 1.1.

Additional reference words: 1.00


PRB: Assigned Values Not Displayed When Form Opened As Dialog

 Article Number: Q109358

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you open a form as a dialog form using the OpenForm action, fields do

not receive values that you assign them.

CAUSE

This occurs because dialog forms are modal, and the DoCmd action does not

return control to Microsoft Access until the dialog form is closed. After

the form is closed, the values cannot be seen. All other forms are modeless

and return control to Microsoft Access after the form is opened, allowing

you to see the assigned values.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access and either create a new database or open an

   existing database.

2. Create a new form called Form1. Add a text box control to the form.

3. Save and close the form.

4. Create a new module and add the following sample function:

      Function Test ()

         DoCmd OpenForm "Form1", A_NORMAL, "", "", A_EDIT, A_DIALOG

         Forms!Form1!Field0 = "Hello"

      End Function

5. Create a new macro and add the following action:

      RunCode

         =Test()

6. Open Form1 and run the macro.

Note that the text box does not display the text assigned to it. However,

if you change the A_DIALOG constant to A_NORMAL, the text box will be

filled with the text "Hello."

Additional reference words: 1.00 1.10 2.00 Forms


PRB: Hidden Pop-Up Forms Not Listed in Show Dialog Box

 Article Number: Q109359

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you hide a pop-up form using the OpenForm action with a hidden flag,

the form does not appear in the Show dialog box object list.

CAUSE

Only multiple document interface (MDI) windows appear in the Show dialog

box object list, and pop-up windows are not MDI windows.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access and either create a new database or open one

   of your choosing.

2. Create the following Access Basic function:

      Function HideForm(FormName$)

         DoCmd OpenForm FormName$,0,,,1,1 'Open form as hidden

      End Function

3. Create a new form and set its PopUp property to Yes.

4. Place a button control on the form and set the button's OnPush

   property to:

      =HideForm("<your form name>")

   Substitute the name of your form for <your form name> in the example

   above.

5. Open the form in Form view and choose the command button.

6. Choose the Window menu. Note that although the form is hidden, the

   Show command is unavailable. If you have previously hidden windows,

   the pop-up window does not appear in the Show dialog box.

Additional reference words: 1.00 1.10 2.00 Forms Hiding Showing


PRB: Find Does Not Work with Fields Containing # Character

 Article Number: Q109360

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You cannot use the Find command to find fields containing the number sign

character (#).

CAUSE

The number sign character is a control character in Microsoft Access;

the Find command does not treat it as it does regular characters.

RESOLUTION

To search for the number sign character (or any control character) you

must place brackets around the control character. For example, to search

for a record containing the text string "hello#", you would enter:

   hello[#]

STATUS

This behavior is by design.

Additional reference words: 1.00 1.10 2.00


PRB: Macro Action Argument Runs with False Condition

 Article Number: Q109361

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Macro action arguments run, even though the macro condition is false.

CAUSE

This behavior is caused by an equal sign (=) in the action argument.

Expressions with an equal sign are evaluated first by Microsoft Access.

An action argument that begins with an equal sign runs before the macro

condition is evaluated.

RESOLUTION

Remove the equal sign from the beginning of your macro action argument.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access and either create a new database or open an

   existing one.

2. Create a new macro with the following action:

      Condition: "False"

      Action: MsgBox

         Message: =InputBox("Message to display:")

3. Save the macro and then run it.

Note that the message box does not appear because its condition is

false. However, the input box does appear.

Additional reference words: 1.00 1.10 Macros


PRB: Export to Word for Windows Creates .TXT Filename

 Article Number: Q109362

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.1 and 2.0

---------------------------------------------------------------------

SYMPTOMS

Exporting a Microsoft Access table to a Word for Windows merge file creates

a text file with a .TXT extension, instead of a Word for Windows document

with a .DOC extension as you expect.

CAUSE

Microsoft Access cannot export data to Word for Windows native file format.

However, the text file that is exported by Microsoft Access can be used by

Word for Windows.

NOTE: Microsoft Word version 6.0 for Windows supports merging data directly

from Microsoft Access without having to export the data into another file.

For more information, consult the Word 6.0 for Windows documentation.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. Select any table and then choose Export from the File menu.

3. Select Word for Windows Merge in the Data Destination box, and then

   choose OK.

4. Choose OK in the Select Microsoft Access Object dialog box.

Note that the filename in the Export To File dialog box has a .TXT

extension, not a .DOC extension.

Additional reference words: 1.10 2.00 Import/Export


PRB: Dialog Form Reopened by OpenForm Is Disabled

 Article Number: Q109363

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you perform an OpenForm action on a form that was previously

opened as a dialog form, the form opens and is selected, but it is

disabled.

CAUSE

When an OpenForm action is performed on a form that has already been

opened, Microsoft Access opens the form and selects it, even if the form

is disabled. The form will not be enabled until other modal forms opened

earlier are either hidden or closed.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

 1. Create the following new macro and save it as Macro1:

       Actions       Arguments

       ---------------------------------

       Openform      Form Name: Form2

                     Window Mode: Dialog

 2. Create another new macro as follows. Save the macro as Macro2:

       Actions       Arguments

       ---------------------------------

       Openform      Form Name: Form1

                     Window Mode: Dialog

 3. Create a new, blank form.

 4. Place a button control on the form.

 5. Set the button's OnPush property to Macro1.

    NOTE: In Microsoft Access version 2.0, the OnPush property is

    called the OnClick property.

 6. Save the form as Form1.

 7. Create another new, blank form.

 8. Place a button control on the form.

 9. Set the button's OnPush property to Macro2.

10. Save the form as Form2.

11. Click the button on Form1 to run Macro1. Note that Form2 opens as

    a modal form.

12. Click the button on Form2 to run Macro2. Note that Form1 opens as

    a modal form.

13. Position Form1 so that you can see both Form1 and Form2.

14. Click the button on Form1.

Form2 will be selected, as it should be, but it will be disabled.

Additional reference words: 1.00 1.10 2.00


INF: How to Calculate Averages That Exclude Zero Values

 Article Number: Q109364

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you use the Avg() function in a report to average a set of values, the

function uses records containing zero values in the calculation. In some

cases you may not want to include records with zero values in this

calculation.

This article describes how to calculate an average for all the non-zero

values in a set by counting the number of non-zero values in the set of

values and then using that total with a running sum calculation.

MORE INFORMATION

In the following example, one text box displays the number of non-zero

values, and the other text box displays the average for the set:

1. Open the sample database NWIND.MDB.

2. Use the ReportWizard to create a new Groups/Totals report based on

   the Order Details table. This report will calculate the average

   discount for each Product ID.

3. Include the Product ID and Discount fields on the report. Group the

   report on the Product ID field, grouped as Normal.

4. Open the report in Design view.

5. Create an unbound text box in the report's detail section. Place this

   text box to the left of the Discount text box. The new text

   box will display the count of non-zero values. Set the box's

   ControlSource property to:

      =IIF([Discount]=0 or [Discount] is null,0,1)

   This expression returns 0 if the value of the Discount field is

   equal to zero or null, otherwise it returns 1. The Avg() function

   automatically excludes nulls as well.

6. Set the text box's RunningSum property to Over Group, and its

   Name property to "Count of Data" (without quotation marks).

   NOTE: In Microsoft Access version 1.x, the Name property is called

   the ControlName property.

7. Create another text box in the report's footer section. This text

   box will display the result of the average calculation.

8. Set the ControlSource property of this text box to:

      =Sum([Discount])/[Count of Data]

9. Preview the report.

The left column displays a running count of non-zero (and non-null)

Discounts and the group footer shows an average Discount based on the

running count.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.1, pages 44, 248-249,

414-415, and 461-462

For more information about the Avg() function, search for "Avg" using the

Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 nonzero


PRB: Make-Table Query Generates "Invalid" Error Message

 Article Number: Q109365

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you are running a make-table query, an error message similar to

   'queryname' isn't a valid name

will be displayed if you supply an invalid name for the table to be

created.

CAUSE

The name of the table to be created by the make-table query is invalid.

The error message is misleading in stating that the name of the query is

invalid. It is the name of the table to be created that is invalid.

RESOLUTION

To correct the problem, supply a valid table name in the Query Properties

dialog box. Valid names for objects in Microsoft Access can be up to 64

characters long, and can contain any combination of letters, numbers,

spaces, and special characters except the period (.), exclamation point

(!), and bracket ([]) characters. Valid names cannot include leading spaces

or control characters (ASCII characters 0-32).

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Open the Customer List query in Design view.

3. From the Query menu, choose Make Table.

4. Enter the name "5!" (without the quotation marks) in the Table Name

   box.

5. Save the query as Test Query.

6. Close the query.

7. Run the Test Query query.

An error message will be displayed.

Additional reference words: 1.00 1.10 2.00


PRA: Microsoft Access Closes Abnormally from a Macro

 Article Number: Q109366

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When Microsoft Access is unexpectedly closed by a macro, system resources

are not released, and Microsoft Access remains in the Microsoft Windows

Task List even though the application is no longer available.

CAUSE

The abnormal closing of Microsoft Access is due to event timing in

the macro. The macro opens the Categories table, calls the Replace In

Field dialog box, and then closes the Categories table. However, the

Replace In Field dialog box, by design, functions differently than other

dialog boxes by allowing macros to continue running while the dialog box

is displayed. Because the macro continues running the Categories table

is closed before the replace action is completed. There is no macro

action to pause the macro's execution; macro events occur sequentially

unless a modal dialog box requests input from the user. The fact

that the table is closed before the replace action is completed causes

Microsoft Access to close abnormally.

When Microsoft Access closes abnormally in this way, it does not

relinquish memory or system resources as it should.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

WARNING: Make sure to save any open work on your computer before

following these steps. Following these steps will cause Microsoft

Access to quit; any open work will not be saved.

1. In Program Manager, choose About Program Manager from the Help menu.

   Note the amount of free system resources. Choose OK.

2. Start Microsoft Access.

3. Open the sample database NWIND.MDB.

4. Create the following new macro:

      Action

      -------------------------------

      OpenTable

         Table Name : Categories

         View       : Datasheet

         Data Mode  : Edit

      DoMenuItem

         Menu Bar   : Table Datasheet

         Menu Name  : Edit

         Command    : Replace

      Close

         Object Type: Table

         Object Name: Categories

5. Run the macro.

6. In the Replace In Field dialog box, choose Close. Microsoft Access

   will close abnormally.

7. Press CTRL-ESC to open the Task List. Double-click Microsoft Access.

   Note that you cannot switch to Microsoft Access because it is no

   longer available.

8. Double-click Program Manager.

9. From the Help menu, choose About Program Manager. Note that the system

   resources used by Microsoft Access have not been released.

Additional reference words: 1.00 1.10 abnormal termination close


INF: Sample Functions to Send MCI Commands from Access Basic

 Article Number: Q109371

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article demonstrates how to create sample Access Basic functions that

you can use to make calls to the media control interface (MCI) using the

mciSendString() function to run a CD player application from Microsoft

Access.

NOTE: These sample functions require that you use Windows version 3.1 or

Multimedia Windows version 3.0, and a CD-ROM drive that supports MCI.

MORE INFORMATION

The sample program below uses several functions to control basic CD-ROM

drive features such as stop, play, and eject. The functions can be used in

any CD-ROM application you create. The sample program below is not a

complete application, but is rather a basis you can use to create a full-

featured application.

The simplest way to use these functions is to create a form with five

command buttons on it. Have each of the buttons call one of the five sample

functions below with its OnPush property.

To create these functions, create a new Access Basic module and enter the

following Declarations and functions:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   '******* Declarations Section *******

   Option Compare Database

   Option Explicit

   Declare Function mciSendString% Lib "MMSystem" (ByVal Sound$,_

        ByVal RtnString$, ByVal RtnLength%, ByVal Hndl%)

   Dim RetInt As Integer

   Dim RetStr As String * 64

   Dim mciStatement As String

   Global gTrackCurrent As Integer ' stores current track on CD.

   Global gTrackCount As Integer   ' stores count of tracks on CD.

   '******* Play Function *********

   Function CDPlay () As Integer

      ' This function initializes the audio device

      ' with the first call to mciSendString(), and

      ' then starts the CD playing with the second call.

      RetInt = mciSendString("Open CDAudio", "", 0, 0)

      CDPlay = mciSendString("Play CDAudio", "", 0, 0)

   End Function

   '******* Stop Function **********

   Function CDStop () As Integer

      ' This function stops the CD with the first call

      ' to mciSendString(), and closes the audio device

      ' with the second call.

      RetInt = mciSendString("Stop CDAudio", "", 0, 0)

      CDStop = mciSendString("Close CDAudio", "", 0, 0)

   End Function

   '******** Previous Track Function **********

   Function CDTrackPrevious ()

      Dim TrackPrevious As Integer

      ' Set time format to Tracks, minutes, seconds, and frames.

      RetInt = mciSendString("Set CDAudio Time Format TMSF", "", 0, 0)

      ' Retrieve the track number that is currently playing, and

      ' the total number of tracks on the CD. Store these values

      ' in global variables so that they are available to the form.

      mciStatement = "Status CDAudio Current Track"

      RetInt = mciSendString(mciStatement, RetStr, 63, 0)

      gTrackCurrent = Val(RetStr)

      TrackPrevious = gTrackCurrent - 1

      mciStatement = "Status CDAudio Number of Tracks"

      RetInt = mciSendString(mciStatement, RetStr, 63, 0)

      gTrackCount = Val(RetStr)

      ' Check to see if the current track is the first track. If it

      ' is seek to the beginning of the current track and play it.

      ' Otherwise, move to the previous track and play from there to

      ' the end of the CD.

      If TrackPrevious > 0 Then

         mciStatement = "Play CDAudio from " & TrackPrevious

         mciStatement = mciStatement & " To " & gTrackCount

         CDTrackPrevious = mciSendString(mciStatement, "", 0, 0)

      Else

         mciStatement = "Seek CDAudio to " & TrackPrevious

         RetInt = mciSendString(mciStatement, "", 0, 0)

         CDTrackPrevious = mciSendString("Play CDAudio", "", 0, 0)

      End If

   End Function

   '********** Next Track Function **********

   Function CDTrackNext () As Integer

      Dim TrackNext As Integer

      ' Set time format to Tracks, minutes, seconds, and frames.

      RetInt = mciSendString("Set CDAudio Time Format TMSF", "", 0, 0)

      ' Retrieve the track number that is currently playing, and

      ' the total number of tracks on the CD. Store these values

      ' in global variables so that they are available to the form.

      mciStatement = "Status CDAudio Current Track"

      RetInt = mciSendString(mciStatement, RetStr, 63, 0)

      gTrackCurrent = Val(RetStr)

      TrackNext = gTrackCurrent + 1

      mciStatement = "Status CDAudio Number of Tracks"

      RetInt = mciSendString(mciStatement, RetStr, 63, 0)

      gTrackCount = Val(RetStr)

      ' Check to see if the current track is the last track. If it

      ' is seek to the beginning of the last track and play it.

      ' Otherwise, move to the next track and play from there to the end

      ' of the CD.

      If (TrackNext) < gTrackCount Then

          mciStatement = "Play CDAudio from " & TrackNext

          mciStatement = mciStatement & " To " & gTrackCount

          CDTrackNext = mciSendString(mciStatement, "", 0, 0)

       Else

          mciStatement = "Seek CDAudio to " & gTrackCurrent

          RetInt = mciSendString(mciStatement, "", 0, 0)

          CDTrackNext = mciSendString("Play CDAudio", "", 0, 0)

      End If

   End Function

   '********* Eject Function **********

   Function CDEject () As Integer

      ' This function is not supported by all CD devices.

      CDEject = mciSendString("Set CDAudio Door Open", "", 0, 0)

   End Function

   '********* Pause Function **********

   Function CDPause () As Integer

      CDPause = mciSendString("Stop CDAudio", "", 0, 0)

   End Function

Note that these functions are only a sample; there are many other functions

that can be implemented with mciSendString(). For example, the Position

command returns the current track number that is being played. By using the

Position command with the timer function described in article Q95924, "How

to Implement a Timer," you can create a dynamically updated readout of the

current track number being played.

REFERENCES

==========

Microsoft Windows Software Development Kit "Multimedia Programmer's

Reference," Chapter 7, "MCI Command Strings"

Additional reference words: 1.00 1.10 2.00 CDROM


PRA: Incorrect Install Directory with Workstation Setup

 Article Number: Q109372

 CREATED: 02-JAN-1994

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you run the Microsoft Access version 1.0 Setup program with the

workstation switch (SETUP /N) from a workstation on a network, Microsoft

Access lists :\ACCESS as the default directory for the installation

directory. If you choose this directory for the installation, you receive

an error message.

If you run the Microsoft Access version 1.1 Setup program with the

workstation switch, Microsoft Access lists C:\ACCESS as the default

directory for the installation directory even if the workstation does not

have a drive C.

CAUSE

These errors occur if you run the Microsoft Access Setup program with the

workstation switch from a diskless workstation.

The Microsoft Access Setup program creates a list of locally available hard

disks. Since, in the case of a diskless workstation, there are no local

hard disks, a null list is created, which leads to the incorrect default

directories listed above.

RESOLUTION

Do not run the Microsoft Access Setup program with the workstation switch

(SETUP /N) from a diskless workstation.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10


PRA: Dashed Lines in Graph Print as Solid Lines

 Article Number: Q109373

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Graphs modified in Microsoft Graph so that they will display dashed value

lines will print with solid lines when you are using the HP LaserJet IIISi

version 2.1 printer driver that uses the universal printer driver

UNIDRV.DLL version 3.1.2.

CAUSE

The problem is due to an interaction between Microsoft Access, the HP

LaserJet version 2.x printer drivers (which were written by Microsoft), and

the UNIDRV.DLL printer driver. The version 3.x printer drivers written by

Hewlett-Packard do not use the UNIDRV.DLL driver and do not exhibit this

problem.

RESOLUTION

You can obtain the latest version of the Hewlett-Packard LaserJet printer

drivers from the Hewlett-Packard forum on CompuServe (type GO HPPER), or

contact Hewlett-Packard at (303) 353-7650.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

NOTE: You must install an HP LaserJet version 2.x printer driver in

Microsoft Windows in order to reproduce this problem.

1. Open the sample database NWIND.MDB.

2. Open the Sales By Category report in Design view.

3. Double-click the graph object to open the graph in Microsoft Graph.

4. From the Gallery menu, choose Line. Select graph 4, and then choose OK.

5. Double-click the value line in the graph, and then select a dashed

   line in the Style box. Choose OK.

6. Close Microsoft Graph. Choose Yes to update the report.

7. Print one or more pages of the report. Note that the dashed line prints

   as a solid line.

Additional reference words: 1.00 1.10


INF: Sample Function to Check Whether an Entry Exists
INF: Sample Function to Check Whether an Entry Exists [B_WAccADK]

 Article Number: Q109374

 CREATED: 02-JAN-1994

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

This article demonstrates a sample function called

CheckPrimaryKey() that

you can use to check whether an entry in a text box already

exists in the

form's underlying table.

This article assumes that you are familiar with Access Basic

and with

creating Microsoft Access applications using the programming

tools

provided with Microsoft Access. For more information on

Access Basic,

please refer to the "Introduction to Programming" manual.

MORE INFORMATION

In the following example, the CheckPrimaryKey() function

checks whether

the entry in the Customer ID field on the Customers form

already exists

in the Customers table. The function is attached to the

BeforeUpdate

event of the Customer ID text box on the form.

NOTE: In the following sample code, an underscore (_) is

used as a line-

continuation character. Remove the underscore when re-

creating this code

in Access Basic.

1. Open the sample database NWIND.MDB. Create a new module.

2. In the Declarations section type the following:

      Option Explicit

3. Type the following code in the module:

      Function CheckPrimaryKey(MyCustID)

         Dim MyDB As Database, MyDyna As Dynaset

      ' Create a dynaset of Customer IDs from the Customers

table. The

      ' function may encounter an empty dynaset. If so, the

function will

      ' fail attempting to move to the first record of the

dynaset, and

      ' execute the error handling routine labeled

MyCustErrTrap.

         Set MyDB = CurrentDB()

         Set MyDyna = MyDB.CreateDynaset("SELECT [Customer

ID] FROM _

            Customers WHERE [Customer ID] = '" & MyCustID &

"';")

         On Error GoTo MyCustErrTrap:

         MyDyna.MoveFirst

      ' The Customer ID entered in the form is compared to

the Customer IDs

      ' in the dynaset. If there is a match, display a

message saying so,

      ' then cancel the event of updating the text box, and

send the Escape

      ' (ESC) keystroke to undo the data entry. If there is

no match, leave

      ' the Customer ID in the text box and select the next

control on the

      ' form.

         If MyDyna![Customer ID] = MyCustID Then

            MsgBox "You've entered an existing Customer ID,

please enter _

               a new one"

            DoCmd CancelEvent

            SendKeys "{ESC}"

         End If

      ' This is the Error trap routine.

      MyCustErrTrap:

         Exit Function

      End Function

4. Save the module as Customer ID Test Module.

5. Open the Customers form in Design view, and select the

Customer ID text

   box.

6. Add the following expression to the BeforeUpdate event:

      =CheckPrimaryKey([Customer ID])

7. Switch to Form view and choose Go To from the Records

Menu, then choose

   New.

8. Type "ALWAO" (without quotation marks) in the Customer ID

text box. The

   message box will appear, and when you select OK your data

entry will be

   undone.

9. Type "ZZZZZ" (without quotation marks) in the Customer ID

text box. The

   message box will not appear, and Microsoft Access will

accept the data

   entry.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages

88, 311, and

432

Additional reference words: 1.00 1.10


PRA: "Invalid Argument" Error Message Exporting Table

 Article Number: Q109375

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The error message "Invalid argument" is displayed when you export a table

from Microsoft Access with either the Word For Windows Merge or the "Text

(Delimited") format.

CAUSE

The table you are exporting is an attached SQL table that contains a field

with a Text data type, which is equivalent to a Microsoft Access Memo

field.

RESOLUTION

To work around this problem you can:

 - Choose a different format to export to, such as dBASE.

 - Use a make-table query to copy the SQL table to a local Microsoft

   Access table, and then export the new table.

 - Export only fields from the SQL table that do not have a Text data

   type. To do this, create a select query that contains only fields

   that do not have a Text data type, then use the TransferText macro

   action to export the query results.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

You can use the SQL Server sp_help stored procedure to determine which

fields in the attached SQL Server table have a Text data type.

For example, for a SQL table called MyAddressList that contains a field

called Notes that has a Text data type, the sample command

   sp_help MyAddressList

would return a listing similar to:

   Name             Owner        Type

   ----------------------------------------

   MyAddressList    dbo          user table

   Column_name      Type         Length  Nulls

   -------------------------------------------

   EntryNumber      int          4

   Name             varchar      30

   ... other fields ...

   Notes            text         16

Note that "text" appears in the Type column for the Notes field.

Steps to Reproduce Problem

--------------------------

NOTE: This article assumes that you are familiar with Microsoft SQL Server

and the tools used to administer a Microsoft SQL Server database and

tables.

1. Use the following sample SQL statements to create a table called

   "MyAddressList" on the SQL Server:

      USE <A valid SQL database name here>

      CREATE TABLE MyAddressList

         (

         EntryNumber int null,

         Name varchar(30) null,

         Notes text null

         )

      CREATE UNIQUE NONCLUSTERED INDEX I_EntryNumber

      ON MyAddressList (EntryNumber)

2. Attach the MyAddressList table to a Microsoft Access database by

   choosing Attach from the File menu in Microsoft Access.

3. Export the attached table with either the Word For Windows Merge or

   the "Text (Delimited)" format.

An error message will be displayed.

REFERENCES

==========

For more information on exporting queries, query on the following words

here in the Microsoft Knowledge Base:

   export and query and transfer

Microsoft Access "User's Guide," version 1.0, pages 66-68 and page 163

Microsoft Access "User's Guide," version 1.1, pages 67-68, 84-87, and

page 167

Additional reference words: 1.00 1.10


PRB: Type Conversion Failure when Importing Excel Data

 Article Number: Q109376

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you are importing a Microsoft Excel spreadsheet to a new table in a

Microsoft Access database, you receive the error message "Type Conversion

Failure."

CAUSE

When you import a Microsoft Excel spreadsheet to a new table, Microsoft

Access checks the first row of the spreadsheet to determine the field

types for the new table. If the first row of the spreadsheet contains a

numeric value in a column that allows alphabetic and numeric characters,

Microsoft Access will define the field type in the table for that column

as numeric. If there are alphabetic characters in other rows in this

column in the spreadsheet, the error message stated above will occur.

RESOLUTION

To work around this behavior, insert an extra row of data as the first

row in the spreadsheet. Insert alphabetic characters in any columns that

are defined as alphanumeric columns. Enter numeric characters in any

columns that are defined as numeric columns. Once you have imported the

spreadsheet into Microsoft Access, delete the extra row of data from the

spreadsheet and the table.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Export the Employees table as a Microsoft Excel spreadsheet named

   EMPLOYEE.XLS.

3. Open EMPLOYEE.XLS in Microsoft Excel.

4. Go to the first row of the Postal Code column. Type 98122 (without

   quotation marks) and press ENTER.

5. Close the spreadsheet and save your changes.

6. In Microsoft Access, import the spreadsheet as a new table. Make sure

   to select the First Row Contains Field Names check box in the Import

   Spreadsheet Options dialog box.

7. After the import is complete, an Import Errors table will appear in

   the Database window.

8. Open the Import Errors table. Note the "Type Conversion Failure" error

   for all postal codes that contain alphabetic characters.

REFERENCES

==========

For more information on setting the field type when you are importing

files into Microsoft Access, query on the following words here in the

Microsoft Knowledge Base:

   import and files and first and line

Additional reference words: 1.00 1.10 2.00


INF: TransferText Action Removes Spaces from Field Names

 Article Number: Q109377

 CREATED: 02-JAN-1994

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

The TransferText action removes embedded spaces from field

names when the

Has Field Names argument is set to Yes and the Transfer Type

argument is

set to Delimited Text.

MORE INFORMATION

You can use the TransferText action to automate the import

and export of

tables and queries. The TransferText action can be used in

macros and

Access Basic modules.

The Has Field Names argument indicates whether the field

names in the

table or query are to be included as the first row of the

exported text

file. Note that the default setting for this argument is No,

indicating

that the field names will not be included in the exported

table, and that

the first row of data in the table or query will be the

first row in the

exported table.

If the Has Field Names argument is set to Yes, and the

Transfer Type is

Delimited Text, Microsoft Access will export the field names

from the

table or query as the first row of the exported table. Any

embedded

spaces in the field names will be removed.

NOTE: Microsoft Access version 1.1 has a Transfer Type of

Word For

Windows Merge. This Transfer Type automatically includes

field names as

the first row of the exported table, converts embedded

spaces to

underscore (_) characters, and inserts the characters "m_"

at the

beginning of any field name that starts with a numeral.

The following example demonstrates the TransferText action,

and will

remove the embedded spaces in field names:

1. Create the following new table:

      Table: TransferText Table

      ------------------------------

      Field1

         FieldName: first name

         DataType:  Text

      Field2

         FieldName: last name

         DataType:  Text

      Field3

         FieldName: 1st Address Line

         DataType:  Text

2. Save the table as TransferText Table, and then close it.

3. Create the following new macro:

      Macro: TransferText Macro

      --------------------------------------

      Action: TransferText

         Transfer Type:   Export Delimited

         Specification:   (none)

         Table Name:      TransferText Table

         File Name:       TRANS1.TXT

         Has Field Names: Yes

4. Save the macro as TransferText Macro, and then run it.

5. Open the TRANS1.TXT file with a text editor such as

Windows Notepad.

   Note that the first row in the text file contains the

table's field

   names. The field names are enclosed in quotation marks,

and are

   separated by commas. Note that the embedded spaces in the

field names

   have been removed. For example, the field name "first

name" has become

   "firstname."

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0 and 1.1,

Chapter 23, "Using

Macros to Print Reports or Transfer Data"

Additional reference words: 1.00 1.10 print tab comma


PRA: List Separator Setting Causes Table Design Errors

 Article Number: Q109378

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The list of data types for table fields does not display the normal

Date/Time and Yes/No options. Instead, you see separate options for Date,

Time, Yes, and No. If you modify the table's design to include one of

these data types, you cannot switch the table to Datasheet view or save

the table.

CAUSE

This problem occurs if you have entered a slash (/) in the List Separator

box in the International settings in the Control Panel.

RESOLUTION

Enter a character other than a slash in the List Separator box in the

International dialog box. The default value for this field is a comma.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

 1. Open the Microsoft Windows Control Panel.

 2. Double-click the International icon.

 3. Enter a slash (/) in the List Separator box.

 4. Choose OK.

 5. Start Microsoft Access and open the sample database NWIND.MDB.

 6. Open the Categories table in Design view.

 7. Add a new field to the table. Set the new field's data type to Date.

 8. View the table in Datasheet view. You will be prompted to save the

    table. Choose OK to save the table. Note that nothing happens and you

    remain in Design view.

 9. From the File menu, choose Close. You will be prompted to save the

    table. Choose Yes. Note that nothing happens.

10. From the File menu, choose Save. Note that nothing happens.

If you switch to Control Panel and change the List Separator back to a

comma, the data types in Microsoft Access will be restored immediately.

You do not need to quit and then restart Microsoft Access.

REFERENCES

==========

Microsoft Access "User's Guide," Chapter 2, "Adding Fields," pages 25-27

Additional reference words: 1.00 1.10


INF: How to Prevent Workstation Setup from Installing Locally

 Article Number: Q109379

 CREATED: 02-JAN-1994

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

------------------------------------------------------------

---------

SUMMARY

To prevent Microsoft Access from being installed locally on

workstations

with the SETUP /N command, you need to modify the

STFSETUP.IN_ file that

was placed in the INSTALL directory by the administrator

setup command

SETUP /A.

MORE INFORMATION

If the Setup program is run on a workstation and you have

not modified

the STFSETUP.IN_ file, the following message will be

displayed on the

workstation:

   You can use the copy of Microsoft Access on your network,

or you can

   install Microsoft Access on your hard disk. If you

install Microsoft

   Access on your hard disk, it will run faster, but it will

take up

   space on your hard disk.

   Do you want to install Microsoft Access on your hard

disk?

If the Yes option is chosen, the Setup program will copy all

the files

necessary to run Microsoft Access locally to the

workstation's hard disk.

If the No option is chosen, the Setup program will copy only

those files

necessary to let Microsoft Access run on the workstation

from the server.

The following steps describe how to modify the STFSETUP.IN_

file so that

the message stated above will not appear when the Setup

program is run

from a workstation. The Setup program will instead

automatically

configure the workstation to run Microsoft Access from the

network

server:

1. Make a backup copy of the STFSETUP.IN_ file by copying

the file to

   another disk or directory.

2. Open the STFSETUP.IN_ file located in the INSTALL

directory on the

   network server in a text editor such as Windows Write. Do

not allow

   the editor to change the format of the file--the file

must remain an

   ASCII, or text, file. Note that the STFSETUP.IN_ file is

too large to

   be opened in Notepad.

3. Locate the section of the STFSETUP.IN_ file that contains

the

   following lines:

      ifstr $(STF_MODE) == "NETWORK"

         read-syms "Copy Local"

         ui start MessageBox

         set LocalCopy = $(DLGEVENT)

         ifstr $(DLGEVENT) == "NO"

            set INIPATH = $(WINDOWSPATH)

            read-syms "Minimum Options"

            set COPYPROG = "OFF"

         else

            set CIRPATH2 = $(HD)$(CIRDIR)

         endif

      endif

   Note that an easy way to find this section is to use the

text editor's

   Find function to locate the second occurrence of the text

"Copy Local".

4. Modify the lines in this section as follows:

      ifstr $(STF_MODE) == "NETWORK"

         ;read-syms "Copy Local"

         ;ui start MessageBox

         ;set LocalCopy = $(DLGEVENT)

         set LocalCopy = "NO"

         ;ifstr $(DLGEVENT) == "NO"

            set INIPATH = $(WINDOWSPATH)

            read-syms "Minimum Options"

            set COPYPROG = "OFF"

         ;else

            ;set CIRPATH2 = $(HD)$(CIRDIR)

         ;endif

      endif

5. Save the modified STFSETUP.IN_ file, and then close the

editor.

NOTE: When you are saving the file, do not allow the editor

to change

the format of the file--it must remain a plain ASCII, or

text, file.

After these modifications have been made, running the Setup

program on a

workstation will automatically result in a configuration on

the

workstation to run Microsoft Access from the network server.

NOTE: Make sure, when you are editing an STFSETUP.IN_ file

generated by

the Microsoft Access Distribution Kit's SetupWizard, not to

make any

modifications below the

   ;================================================

   ;DO NOT MODIFY BELOW THIS LINE

   ;================================================

section in the file. Modifications below this section are

not supported.

Additional reference words: 1.00 1.10


PRB: DFirst() and DLast() Functions Return Unexpected Records

 Article Number: Q109380

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The DFirst() and DLast() functions do not return the first and last records

of the specified domain as you expect. If the domain is a query, the

DFirst() and DLast() functions appear to ignore the sort order of the

query.

CAUSE

The DFirst() and DLast() functions return values from the first and last

records according to the order of the records in the domain. If the domain

is an indexed table, the functions will return the first and last records

in the indexed order. If there is no index, the functions will return the

first and last records in the order in which they were entered in the

underlying table.

RESOLUTION

The following two sample Access Basic functions, GetFirst() and GetLast(),

can be used in place of the DFirst() and DLast() functions to return the

first and last records in the sorted domain as you expect.

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   Option Explicit

   Function GetFirst (Expr$, Domain$, Criteria$)

      Dim MyDB As Database

      Dim MyDyna As Dynaset

      On Error GoTo Err_GetFirst

      Set MyDB = CurrentDB()

      Set MyDyna = MyDB.CreateDynaset(Domain$)

      If Len(Citeria$) > 0 Then

         MyDyna.Filter = Citeria$

         Set MyDyna = MyDyna.CreateDynaset()

      End If

      MyDyna.MoveFirst

      GetFirst = MyDyna(Expr$)

   Bye_GetFirst:

      Exit Function

   Err_GetFirst:

      GetFirst = Null

      Resume Bye_GetFirst

   End Function

   Function GetLast (Expr$, Domain$, Criteria$)

      Dim MyDB As Database

      Dim MyDyna As Dynaset

      On Error GoTo Err_GetLast

      Set MyDB = CurrentDB()

      Set MyDyna = MyDB.CreateDynaset(Domain$)

      If Len(Citeria$) > 0 Then

         MyDyna.Filter = Citeria$

         Set MyDyna = MyDyna.CreateDynaset()

      End If

      MyDyna.MoveLast

      GetLast = MyDyna(Expr$)

   Bye_GetLast:

      Exit Function

   Err_GetLast:

      GetLast = Null

      Resume Bye_GetLast

   End Function

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Open the Employee List query. Note that the employee names are sorted

   by last name, with the name "Buchanan, B. L." listed first, with an

   Employee ID of 5.

3. Open the Introduction To Programming module in Design view, and

   then choose Immediate Window from the View menu.

4. Type the following in the Immediate window, and then press ENTER:

      ? DFirst("[Employee ID]","Employee List")

Employee ID 1 is returned, not Employee ID 5, even though Employee ID 5 is

first in the sort order. Employee ID 1 is the first indexed record in the

table that the query is based on.

REFERENCES

==========

Microsoft Access "Language Reference," pages 139-140

Additional reference words: 1.00 1.10 2.00


INF: How to Display Yes/No Choices in a Combo Box or List Box

 Article Number: Q109381

 CREATED: 02-JAN-1994

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article describes how to use a list box or a combo box to display Yes

and No, True and False, or On and Off selections for a field with a Yes/No

data type.

MORE INFORMATION

When you use a Yes/No data type, one of three formats may be applied:

Yes/No, True/False, or On/Off. However, list boxes and combo boxes do not

display these formats. Instead, the actual value of the Yes/No field will

be displayed. The actual value of a Yes/No field is either -1 or 0, no

matter which format is applied.

In order to display values with one of the formats listed above in a list

box or a combo box, the following properties must be set for the list box

or the combo box:

   Object: combo box

   -------------------------

   RowSourceType: Value List

   RowSource: -1;Yes;0;No

   ColumnCount: 2

   ColumnWidths: 0 in; 1 in

   BoundColumn: 1

   List Rows: 2

   Object: list box

   -------------------------

   RowSourceType: Value List

   RowSource: -1;Yes;0;No

   ColumnCount: 2

   ColumnWidths: 0 in; 1 in

   BoundColumn: 1

The above properties will cause a list box or a combo box to display values

with a Yes/No format. To use one of the other formats (True/False or

On/Off) replace the words "Yes" and "No" in the properties listed above.

REFERENCES


INF: Access Basic Is Both a Compiler and an Interpreter

 Article Number: Q109382

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article discusses whether the Access Basic programming language is a

compiled language or an interpreted language.

MORE INFORMATION

Traditional compiled languages, such as C, compile human-readable source

code into machine-readable, and much faster, object code. These object

programs then need to be linked into an executable file to be used.

Syntax errors are not generally located until the code is completely

compiled, although parsing compilers are an exception to this rule.

Traditional interpreted languages, such as QBasic, use interpreters that

read each line of code and translates it into computer instructions as

you write it. An advantage of this method is that an interpreter can test

your code as you write it. In some cases this line-by-line interpretation

can be slow.

Access Basic incorporates elements of both compiled and interpreted

languages. Access Basic does interpret each line of code you as you write

it, but Microsoft Access performs this interpretation in the background,

and does not exhibit any performance degradation because of this

interpretation.

In addition to this interpretation, Microsoft Access also compiles your

code into a combination of compiled and interpreted code known as p-code,

or pseudocode. This p-code runs much faster than interpreted code. The

compilation takes place either when you first run the code, or when you

choose Compile All from the Run menu.

Additional reference words: 1.00 1.10 2.00


INF: Sample Function to Use the COMMDLG Color Dialog Box

 Article Number: Q109390

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The Palette in Microsoft Access provides a limited selection of colors for

database objects, and does not allow you to create custom colors. However,

the BackColor, ForeColor, and BorderColor properties of forms and reports

will accept any valid RGB color value.

This article lists a sample Access Basic function called ChooseColor() that

uses the Microsoft Windows standard Color dialog box so that you can choose

from a greater selection of colors or create your own custom color.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

To set up the sample function ChooseColor(), create a new module with the

following Declarations section and function:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   '********************************************************************

   ' MODULE DECLARATION SECTION

   '********************************************************************

   Option Explicit

   '

   ' Required COMMDLG Declarations

   '

   Type ChooseColor

      lStructSize As Long

      hwndOwner As Integer

      hInstance  As Integer

      RgbResult As Long

      lpCustColors As Long

      Flags As Long

      lCustData As Long

      lpfnHook As Long

      lpTemplateName As Long

   End Type

   Global Const CC_RGBINIT = &H1

   Global Const CC_FULLOPEN = &H2

   Declare Function ChooseColor_API Lib "COMMDLG.DLL" Alias _

      "ChooseColor" (pCHOOSECOLOR As ChooseColor) As Integer

   Declare Function CommDlgExtendedError Lib "COMMDLG.DLL" () As Long

   '

   ' Global Memory Declarations

   '

   Declare Function GlobalAlloc Lib "Kernel" _

      (ByVal wFlags As Integer, ByVal dwBytes As Long) As Integer

   Declare Function GlobalFree Lib "Kernel" _

      (ByVal hMem As Integer) As Integer

   Declare Function GlobalLock Lib "Kernel" _

      (ByVal hMem As Integer) As Long

   Declare Function GlobalUnlock Lib "Kernel" _

      (ByVal hMem As Integer) As Integer

   Global Const GMEM_MOVEABLE = &H2

   Global Const GMEM_ZEROINIT = &H40

   Global Const GHND = (GMEM_MOVEABLE Or GMEM_ZEROINIT)

   Declare Sub hmemcpy Lib "Kernel" _

      (lpDest As Any, lpSource As Any, ByVal dwBytes As Long)

   '********************************************************************

   ' FUNCTION: ChooseColor

   '

   ' PURPOSE:

   '   Uses the standard Windows Color dialog box in COMMDLG.DLL to get

   '   a 256-color RGB value for use in Microsoft Access. The returned

   '   value can be used in the BackColor, ForeColor, or BorderColor

   '   properties.

   '

   ' ARGUMENTS:

   '   DefaultColor - The default RGB color to be selected.

   '                  Black, 0, is usually the default.

   '

   ' RETURN VALUE:

   '   >=0  The user-selected RGB value

   '   -1   Couldn't allocate global memory

   '   -2   Couldn't lock global memory

   '   -3   COMMDLG error occurred. A message box will display the

   '        number prior to this function exiting.

   '

   ' ********************************************************************

   Function ChooseColor (ByVal DefaultColor As Long) As Long

      Dim C As ChooseColor

      Dim MemHandle As Long

      Dim Result As Integer, i As Integer

      ' Define CustomColor array, address, size variables

      ReDim CustomColors(15) As Long

      Dim CustomColorsAddress As Long

      Dim CustomColorsSize As Integer

      ' Fill custom colors array with all white

      For i = 0 To UBound(CustomColors)

         CustomColors(i) = &HFFFFFF

      Next

      ' Get size of global memory needed for custom colors

      CustomColorsSize = Len(CustomColors(0)) * 16

      ' Get a global memory block to hold a copy of the custom colors

      MemHandle = GlobalAlloc(GHND, CustomColorsSize)

      If MemHandle = 0 Then

         ChooseColor = -1

         Exit Function

      End If

      ' Lock the custom color's global memory block

      CustomColorsAddress = GlobalLock(MemHandle)

      If CustomColorsAddress = 0 Then

         ChooseColor = -2

         Exit Function

      End If

      ' Copy custom colors to the global memory block

      Call hmemcpy(ByVal CustomColorsAddress, _

         CustomColors(0), CustomColorsSize)

      ' Initialize Choose Color structure

      C.lStructSize = Len(C)

      C.hwndOwner = 0&

      C.lpCustColors = CustomColorsAddress

      C.RgbResult = DefaultColor

      C.Flags = CC_RGBINIT Or CC_FULLOPEN

      ' Call the Choose Color COMMDLG routine

      Result = ChooseColor_API(C)

      ' Did an error occur?

      If Result = 0 And CommDlgExtendedError() <> 0 Then

         ChooseColor = -3

         MsgBox Str$(CommDlgExtendedError()), 16, "Choose Color Error"

      End If

      ' Copy the new custom colors to the CustomColors address locally

      ' .. CustomColor array will now contain list of new custom colors

      Call hmemcpy(CustomColors(0), _

         ByVal CustomColorsAddress, CustomColorsSize)

      ' Unlock and free the global memory block

      Result = GlobalUnlock(MemHandle)

      Result = GlobalFree(MemHandle)

      ' Return the selected color

      ChooseColor = C.RgbResult

   End Function

How to Use the ChooseColor() Function

-------------------------------------

The following sample Access Basic function demonstrates how to use the

ChooseColor() function:

   Function GetColor()

      MsgBox Str$(ChooseColor(0))

   End Function

The GetColor() function calls the ChooseColor() function and selects black

as the default color. A message box will display the color selected in the

Color dialog box.

The GetColor() function can be called from a command button by entering the

following for the button's OnPush property:

   =GetColor()

Additional reference words: 1.00 1.10 2.00 commdlg.dll


PRB: GP Fault Attaching Tables with Old CTL3D.DLL File

 Article Number: Q109391

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.1 and 2.0

---------------------------------------------------------------------

SYMPTOMS

A general protection (GP) fault may occur when you attach tables using

ODBC. Or, you may notice that the borders of the ODBC dialog boxes appear

unusual.

CAUSE

The GP fault may be due to an older CTL3D.DLL file. This file is usually

treated as a shared DLL and is installed in the WINDOWS\SYSTEM directory.

However, some applications will install the CTL3D.DLL file in the Windows

directory. Older versions of the CTL3D.DLL file in the Windows directory

can cause problems with ODBC.

RESOLUTION

Search your hard drive for CTL3D.DLL files. If there is more than one,

rename all the files except the one with the latest date to some other

filename. Make sure that the CTL3D.DLL file with the latest date is in the

WINDOWS\SYSTEM directory. Note that the CTL3D.DLL file that is shipped with

Microsoft Access is dated 5/21/93 or later with a size of 14,480 bytes.

Additional reference words: 1.10 2.00 GPF


INF: Sample Function to Determine Language Version

 Article Number: Q109392

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access ships in several languages, including English, Spanish,

Portuguese, French, and German. However, there is no built-in command in

Microsoft Access to determine which language version of Microsoft Access

your application is running in. This article demonstrates a sample

function you can use to determine which language version of Microsoft

Access is running.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

The error messages in Microsoft Access are localized to the specific

language version. You can determine which language version of Microsoft

Access is running by looking at the error strings. For example, the

following strings are returned by the various language versions if you

type "Error$(3)" (without quotation marks) in the Immediate window:

   English: Return without GoSub

   French: Return sans GoSub

   German: 'Return' ohne 'GoSub'

   Portuguese: Return sem GoSub

   Spanish: Return sin GoSub

The following sample function can be run to determine which language

version of Microsoft Access is running. To create this function, type the

following in the Declarations section of your module:

  Option Explicit

Then, type the following code in your module:

   Function Language ()

      Select Case Error$(3)

         Case "Return without GoSub":

            Language = "English"

         Case "Return sans GoSub":

            Language = "French"

         Case "'Return' ohne 'GoSub'":

            Language = "German"

         Case "Return sem GoSub":

            Language = "Portuguese"

         Case "Return sin GoSub":

            Language = "Spanish"

      End Select

   End Function

Additional reference words: 1.00 1.10 2.00


INF: How to Import a Data File to a Control on a Form

 Article Number: Q109393

 CREATED: 02-JAN-1994

 MODIFIED: 05-JAN-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article demonstrates how to write the contents of a text data file

to a control on a form.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual.

MORE INFORMATION

The sample code below will read your CONFIG.SYS file (although you

can substitute any text file) and place the contents of the file in

a text box on a form:

1. Create a new, blank form.

2. Place a text box on the form. Set its ControlName property to

   My_Text1. Size the text box large enough to fit the contents of

   the text file that will be read in.

3. Place a button on the form. Set the button's OnPush property to:

      =WriteFile()

   Set the button's Caption property to "Bring Text In" (without the

   quotation marks).

4. Save the form as Form1.

5. Create a new module, and enter the following sample code:

      Function WriteFile ()

         Dim Linedata as String

         Dim WholeFile as String     'These variables are used to

                                     'temporarily store the lines of

                                     'the file.

         Open "C:\CONFIG.SYS" For Input As #1

                                     'Open the read file.

         Do While Not EOF(1)         'Continue reading until end-of-

                                     'file reached.

            Line Input #1, Linedata  'Read a line of data.

            WholeFile = WholeFile + Chr(13) & Chr(10) + Linedata

                                     'Store each line of data in the

                                     'variable "WholeFile", padded

                                     'with carriage return and line-

                                     'feed characters on the end of

                                     'each line.

         Loop

         Forms!Form1![My_Text1] = WholeFile

                                     'Transfer accumulated lines to

                                     'text box control.

         Close #1                    'Close the data file.

      End Function

6. View the form in Form view. Choose the Bring Text In button.

Note that you can erase the contents of the text box by setting it to

an empty variable, such as:

   Forms!Form1![My_Text1] = Null   'Erases the text.

You can call this variable from the Immediate window, or you can assign

it to another button on the form.

Additional reference words: 1.00 1.10 AB


INF: How to Add an Icon to Program Manager Using DDE

 Article Number: Q109394

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes a sample Access Basic function called

CreatePROGMANIcon() that you can use to create an icon in the Microsoft

Windows Program Manager using dynamic data exchange (DDE).

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

To set up the CreatePROGMANIcon() function, create a new module and enter

the code below.

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   Option Explicit

   '**************************************************

   ' FUNCTION: CreatePROGMANIcon

   '

   ' PURPOSE:

   '   To create an icon in the Windows Program Manager.

   '

   ' ARGUMENTS:

   '   CommandLine - The command line argument to execute

   '                 when the icon is double-clicked.

   '   IconText    - The text to appear under the icon.

   '   GroupName   - The name of the group to place the

   '                 icon in.

   ' RESULT:

   '   An icon is placed in the specified group. If the

   '   group does not exist, a new group is created.

   '

   ' *************************************************

   Function CreatePROGMANIcon (CommandLine$, IconText$, GroupName$)

      Dim ChanNum As Integer

      Dim Groups As String

      Dim Exe As String

      ' Begin a DDE conversation with Program Manager.

      ChanNum = DDEInitiate("PROGMAN", "PROGMAN")

      ' Request a tab delimited list of Program Manager groups.

      Groups = DDERequest(ChanNum, "Progman")

      ' See if the requested group exists in the list.

      ' If not, create the group.

      If Not InStr(1, GroupName, Groups) Then

         DDEExecute ChanNum, "[CreateGroup(" & GroupName & ")]"

      End If

      ' Add an icon to the group with the specified text underneath.

      Exe = "[AddItem(" & CommandLine & ", " & IconText & ",,)]"

      DDEExecute ChanNum, Exe

      DDETerminate ChanNum

   End Function

How to Use the CreatePROGMANIcon() Function

-------------------------------------------

Type the command below in an Immediate window and then press ENTER.

NOTE: In the following example, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this

example.

   ? CreatePROGMANIcon("C:\WINDOWS\NOTEPAD.EXE C:\AUTOEXEC.BAT", _

      "AUTOEXEC", "MAIN")

The sample command above uses the CreatePROGMANIcon() function to add an

icon to the Main group in Program Manager. The icon will open the Windows

Notepad text editor and load the C:\AUTOEXEC.BAT file into Notepad.

Note that when the icon is created, Program Manager uses the default icon

supplied with the application specified in the command line. The following

function is a modified version of the CreatePROGMANIcon() function with two

additional arguments. These arguments are IconFile, which specifies the

name of a file containing custom icons, and IconNum, which specifies which

icon in the IconFile to use. Note that if you specify "", or null, for both

of these arguments, the default icon will be used.

   Function CreatePROGMANIcon2 (CommandLine$, IconText$, GroupName$, _

      IconFile$, IconNum$)

      Dim ChanNum As Integer

      Dim Groups As String

      Dim Exe As String

      ' Begin a DDE conversation with Program Manager.

      ChanNum = DDEInitiate("PROGMAN", "PROGMAN")

      ' Request a tab delimited list of Program Manager groups.

      Groups = DDERequest(ChanNum, "Progman")

      ' See if the requested group exists in the list.

      ' If not, create the group.

      If Not InStr(1, GroupName, Groups) Then

         DDEExecute ChanNum, "[CreateGroup(" & GroupName & ")]"

      End If

      ' Add an icon to the group with the specified text underneath.

      Exe$ = "[AddItem(" & CommandLine & ", " & IconText & ", _

             " & IconFile & ", " & IconNum & ")]"

      DDEExecute ChanNum, Exe

      DDETerminate ChanNum

   End Function

The following sample command uses the fourth icon in the MORICONS.DLL file

that is supplied with Windows. This file contains multiple custom icons:

   CreatePROGMANIcon2("C:\TEST\TEST.EXE ","My App","My Group",_

      "C:\WINDOWS\MOREICONS.DLL","4")

The next sample command uses an icon in an .ICO file. Since there is only

one icon in each .ICO file, leave the IconNum argument empty:

   CreatePROGMANIcon2("C:\TEST\TEST.EXE ","My App","My Group",_

      "C:\ICONS\MY.ICO","")

REFERENCES

==========

Windows Software Development Kit "Guide to Programming," pages 19-22

For more information on DDE and Program Manager, query on the following

words here in the Microsoft Knowledge Base:

   dde and progman

Additional reference words: 1.00 1.10 2.00


INF: Description of CreateForm() and CreateReport() Functions

 Article Number: Q109395

 CREATED: 02-JAN-1994

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

------------------------------------------------------------

---------

SUMMARY

This article describes the CreateForm() and CreateReport()

functions that

are documented in the "The Secrets of Access Wizards" manual

which is

included with the Microsoft Access Distribution Kit.

MORE INFORMATION

This article assumes that you are familiar with Access Basic

and with

creating Microsoft Access applications using the programming

tools provided

with Microsoft Access. For more information on Access Basic,

please refer

to the "Introduction to Programming" manual.

CreateForm(), CreateReport() Functions

--------------------------------------

Description   Creates a new form or report and returns a

form or

              report object.

Syntax        CreateForm([database [,formtemplate]])

              CreateReport([database [, reporttemplate]])

Remarks       The CreateForm() and CreateReport() functions

use the

              following arguments:

              Argument         Description

              ----------------------------------------------

----------

              database         String expressions

identifying the name

                               of the database that contains

the form

                               or report template; if the

argument is

                               omitted, the current user

database (the

                               same value as returned by the

CurrentDB

                               function) is used.

              formtemplate,    String expression identifying

the name

              reporttemplate   of the form or report

template, the

                               name of a form or report, or

the word

                               Normal. If the expression is

omitted,

                               Access Basic uses the form or

report

                               template set with the Options

command

                               on the View menu.

              These functions are the equivalent of choosing

New Form

              and New Report from the File menu in the

Database

              window. They return a form or report object.

Use these

              functions in Design Mode only.

Example       Creates a report in the user database using

the Normal

              template.

   Sub NormalReport()

       Dim MyReport As Report

       ' CreateReport function creates a minimized report

       ' that we need to restore.

       Set MyReport = CreateReport("","")

       DoCmd Restore

   End Sub

REFERENCES

==========

Microsoft Access "The Secrets of Access Wizards," page 15

Additional reference words: 1.00 1.10 ADK


PRA: Problems Opening a Modal and Pop-Up Form as Dialog

 Article Number: Q109396

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If two or more modal pop-up forms are opened and closed, the screen can

become distorted or Microsoft Access can stop.

CAUSE

The problem occurs if both forms' Modal and Popup properties are set to

Yes, and the forms are opened with the OpenForm action with the Window Mode

argument set to Dialog.

RESOLUTION

Either change the OpenForm action to open the forms as Normal instead of

Dialog, or change the forms' Modal and Popup properties to No.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 579-580

Microsoft Access "User's Guide," version 1.1, pages 583-584

Additional reference words: 1.00 1.10


INF: How to Run Access Basic Functions with DDE

 Article Number: Q109397

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - Microsoft Access Distribution Kit version 1.1

 - Microsoft Access Developer's Toolkit version 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access does not have any facility for running Access Basic

functions as a dynamic data exchange (DDE) server. However, Access Basic

functions can be run from a DDE client application if they are contained in

an SQL statement used to initiate a DDE conversation with Microsoft Access

using the SQL topic.

This article describes how to run Access Basic functions from a DDE client

application.

MORE INFORMATION

A DDE client application such as Microsoft Excel or Microsoft Word for

Windows can use DDE to run commands in Microsoft Access as a DDE server.

When it is used as a DDE server, Microsoft Access recognizes any of the

following as a valid command:

 - The name of a macro in the currently open database

 - Any action that you can run in Access Basic using the DoCmd statement

 - The OpenDatabase and CloseDatabase commands, which are used only for

   DDE operations

Note that Microsoft Access does not have DDE server functionality for

running Access Basic functions.

How to run Access Basic functions from a DDE client application

---------------------------------------------------------------

The following examples demonstrate how to run Access Basic functions from

DDE client applications. In both examples below, the MyFunct() function is

run against the None table in the sample database NWIND.MDB (note that the

MyFunct() function and the None table do not exist in the NWIND database;

they are simply names used for illustration):

This is the DDE command issued from Microsoft Excel:

   chan=INITIATE("MSACCESS","NWIND;SQL SELECT MyFunct() FROM None;")

This is the DDE command issued from Word for Windows:

   chan=DDEInitiate("MSACCESS", "NWIND;SQL SELECT MyFunct() FROM None;")

Note that you can name any table that exists in the database in the From

clause.

The following example demonstrates how to add a new customer to the

Customers table in the NWIND database by running an Access Basic function

from a DDE client application:

1. Open the sample database NWIND.MDB and create a new table called

   None with one field of any data type.

2. Open or create a module and enter the following sample Access Basic

   function:

      'Declarations section

      Option Explicit

      Function AddNewCust$ (CustomerID$, CompanyName$)

         Dim MyDB As Database, MyTable As Table

         Set MyDB = CurrentDB()

         Set MyTable = MyDB.OpenTable("Customers")  ' Open the table

         MyTable.AddNew             ' Prepare new record

         MyTable("Customer ID") = CustomerID$    ' Set record key

         MyTable("Company Name") = CompanyName$  ' Set company name

         MyTable.Update                          ' Save changes

         MyTable.Close                           ' Close the table

      End Function

3. In the DDE client application, initiate a DDE conversation with

   MSACCESS as the application and an SQL statement that calls the

   AddNewCust() function you created in step 2 as the topic.

The following example demonstrates how to run the AddNewCust() function

from Microsoft Excel:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   AddNewCustomer

   chan=INITIATE("MSACCESS","NWIND.MDB;SQL SELECT _

        AddNewCust$(""JOHNJ"",""John's Place"") FROM None;")

   =TERMINATE(chan)

   =RETURN()

The following example demonstrates how to run the AddNewCust() function

from Word for Windows:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   Sub MAIN

      DDETerminateAll

      qt$ = Chr$(34)

      Funct$ = "AddNewCust$(" + qt$ + "JOHNJ" + qt$ + "," + qt$ + _

         "John's Place" + qt$ + ")"

      Chan = DDEInitiate("MSACCESS", _

         "NWIND;SQL SELECT " + Funct$ + "FROM None;")

      DDETerminate Chan

   End Sub

REFERENCES

==========

For more information on using Microsoft Access as a DDE server, search for

"DDE" then "Using Microsoft Access As a DDE Server" using the Microsoft

Access Help menu.

Microsoft Access "Language Reference," version 1.0, pages 118-124

README.TXT file in Microsoft Access version 1.0

Additional reference words: 1.00 1.10 2.00


PRB: SQL Server Logon Error Message "Select Permission Denied"

 Article Number: Q109399

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you attach a SQL Server table in Microsoft Access you receive the

error message "Select Permission Denied."

CAUSE

This error occurs if you log on to SQL Server using a username that does

not have permissions for the table you are trying to attach.

RESOLUTION

Permissions for the table are granted by the SQL Server Administrator.

Contact your SQL Server Administrator to get permissions on the table.

Additional reference words: 1.00 1.10 2.00


INF: README.TXT File and Novell Locking Issues

 Article Number: Q109400

 CREATED: 02-JAN-1994

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The README.TXT file shipped with Microsoft Access version 1.1 contains a

section titled "Using Microsoft Access on Novell NetWare Servers and Banyan

VINES Servers (Increasing the Number of Record Locks)". This information

does not apply to Novell NetWare286 (version 2.x). It only applies to

Novell NetWare386 (version 3.x) and Banyan VINES.

The README.TXT file does not state that the information does not apply to

Novell NetWare286.

MORE INFORMATION

The following information is taken from the README.TXT file:

------------------------------------------------------------

Using Microsoft Access on Novell NetWare Servers and Banyan

   VINES Servers (Increasing the Number of Record Locks)

------------------------------------------------------------

On Novell NetWare Servers:

If you are attempting to use large Microsoft Access databases on a

Novell NetWare server, set the "maximum record locks per connection"

to the largest allowable value (10,000). The execution of large bulk

operations in Microsoft Access (such as a large update query) can

cause the server to run out of record lock connections. If you do not

set the number of record locks to the maximum value while using

Microsoft Access, it could result in the loss of data due to a server

crash.

See your Novell NetWare documentation for a description of

how to set the number of record locks.

------------------------------------------------------------

NOTE: NetWare286 does not have definable configurations for its locking

schemes. A server supervisor can use the NetWare console command FCONSOLE

to view the locks on the network.

Additional reference words: 1.00 1.10 2.00


PRA: Reserved Error (-1603) Previewing a Report

 Article Number: Q109401

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you preview a report, you receive the error message:

   Reserved error (-1603); there is no message for this error.

CAUSE

This error occurs when an Access Basic function references a field in the

report's underlying data that is not on the report and the resulting

dynaset is empty.

RESOLUTION

Place the field referenced by the function on the report. If you do not

want to see the field on the report, set the field's Visible property to

False.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Start Microsoft Access and either create a new database or open one

   of your choosing.

2. Create the following new table:

      Table: Table1

      -------------------

      FieldName: ID

         DataType: Number

      Table Properties: Table1

      ------------------------

      PrimaryKey: ID

2. Add the following values to the ID field:

      ID

      --

      1

      2

      3

3. Create the following query based on Table1:

      Query: Query1

      ---------------

      Type: Select

      Field: ID

         Criteria: 10

   Note that this query returns no records, which is necessary for

   duplicating the error message.

4. Create a new module and enter the following sample function:

      Function MyFunction (C As Control)

         Debug.Print C

      End Function

5. Create the following new report based on Query1:

      Report: Report1

      --------------------------------------

         RecordSource: Query1

         Text box: Field1

            ControlSource: =MyFunction([ID])

   Note that the ID field is not on the report.

6. Preview the report.

Additional reference words: 1.00 1.10 Reports AB errmsg


INF: How to Use the PrtDevNames Property on Reports

 Article Number: Q109402

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SUMMARY

You can use the PrtDevNames property for checking or changing the currently

connected printing device and port for specific reports.

The PrtDevNames property is not documented in the Microsoft Access manuals,

but will be documented in the manuals in a future release of the program.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual.

MORE INFORMATION

The PrtDevNames property sets or returns information about the selected

printer. It is a variable-length string that mirrors the DEVNAMES structure

defined in the Microsoft Windows Software Development Kit, with the

following components:

 - DriverOffset: Specifies the offset from the beginning of the structure

   to a null-terminated string that specifies the filename (without an

   extension) of the device driver. This string is used to set which

   printer is initially displayed in the dialog box.

 - DeviceOffset: Specifies the offset from the beginning of the structure

   to the null-terminated string that specifies the name of the device.

   This string cannot exceed 32 bytes in length, including the null

   character, and must be identical to the DeviceName member of the DEVMODE

   structure. You can determine the driver name and device name by looking

   at the [DEVICES] section of the WIN.INI file.

 - OutputOffset: Specifies the offset from the beginning of the structure

   to the null-terminated string that specifies the MS-DOS device name for

   the physical output medium (the output port), for example, "LPT1:".

 - Default: Specifies whether the strings specified in the DEVNAMES

   structure identify the default printer. On input, if Default is set to 1

   and all of the values in the DEVNAMES structure match the current

   default printer, the selected printer will be set to the default

   printer. On output, Default is set to 1 if the current default printer

   has been selected.

Microsoft Access uses the DEVNAMES structure to initialize the Print Setup

dialog box. When you choose the OK button to close the dialog box,

information about the selected printer is returned in the PrtDevNames

property.

NOTE: You cannot change the PrtDevNames setting without changing the

PrtDevMode setting to your current printer settings. Some Windows printer

drivers assume that the PrtDevMode was created by that driver. If you

select a different printer driver in the PrtDevNames structure without

changing the PrtDevMode structure, Microsoft Access will pass the old

PrtDevMode structure to the new printer driver. This may cause the printer

driver to operate incorrectly and could cause Application Errors.

The following sample function demonstrates how to set the printer device

and port settings for a report to a PostScript printer on the LPT1 port.

This function is designed to receive one parameter that is a reference to a

report currently open in Design view.

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   '*************************************************************

   'Declarations section of the module

   '*************************************************************

   Option Compare Database   'Use database order for string comparisons

   Option Explicit

   Type zwtDevNamesStr

      rgb As String * 8

   End Type

   Type zwtDevNames

      DriverPos As Integer

      DevicePos As Integer

      OutputPos As Integer

      Default As Integer

   End Type

   '*************************************************************

   ' End of declarations section

   '*************************************************************

   '*************************************************************

   ' FUNCTION NAME: SetDevNames

   ' PURPOSE: Sets the printer driver to output port for a report

   ' INPUT PARAMETERS: Reference to open report

   '*************************************************************

   Function SetDevNames (MyReport As Report)

      Dim PrtDriver As String, PrtDevice As String, PrtOutput As String

      Dim stDevNames As String

      Dim DevNames As zwtDevNames

      Dim dn As zwtDevNamesStr

      PrtDriver = "pscript"

      PrtDevice = "PostScript Printer"

      PrtOutput = "LPT1;"

      '  Verify that the device name does not exceed 32 bytes in

      '  length, including the null character.

      If Len(PrtDevice) > 31 Then

         MsgBox "Invalid device name", 16, "CreateDevNames"

         Exit Function

      End If

      '  Create the offset information within the data structure.

      DevNames.DevicePos = 8   'First string in DevNames 'structure.

      DevNames.DriverPos = DevNames.DevicePos + Len(PrtDevice) + 1

      DevNames.OutputPos = DevNames.DriverPos + Len(PrtDriver) + 1

      DevNames.Default = 0     'Not the default printer

      '  Copy information from DevNames structure into dn.rgb string.

      LSet dn = DevNames

      '  Concatenate strings for use in PrtDevNames property.

      stDevNames = dn.rgb & PrtDevice & Chr$(0) & PrtDriver & _

         Chr$(0) & PrtOutput & Chr$(0)

      MyReport.PrtDevNames = stDevNames

   End Function

To run this function, open a report in Design view and then type the

following in the Immediate window:

   ?SetDevNames(Reports![Your Report Name])

To verify that the function worked correctly, select the report and choose

Print Setup from the File menu.

Additional reference words: 1.00 1.10 PtrIss


PRA: GetChunk on ODBC Table Returns "Invalid Argument"

 Article Number: Q109403

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you call the GetChunk method against a SQL Server or other ODBC table,

Microsoft Access returns the error message: "Invalid Argument."

CAUSE

Microsoft Access does not properly support the GetChunk method against

ODBC tables.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Create a SQL Server table called SQLTest with a field called FldImage

   that has an image data type. Create a unique index on the table.

2. Start Microsoft Access and open the sample database NWIND.MDB.

3. Attach the SQLTest SQL Server table. The table name will be displayed

   as dbo.SQLTest, and will change to dbo_SQLTest after you attach it.

4. From Microsoft Access, add one record to the table.

5. Create a new module and enter the following sample code:

      Sub TestGetChunk()

         Dim MyDB As Database, MyDyna As Dynaset, s As String

         Set MyDB = CurrentDB()

         Set MyDyna = MyDB.CreateDynaset("dbo_SQLTest")

         s = MyDyna![FldImage].GetChunk(0, 10)

         MyDyna.Close

         MyDB.Close

      End Sub

6. Type the following in the module's Immediate window:

      TestGetChunk

Microsoft Access will halt the procedure on the GetChunk line, and will

display the error message stated above.

Additional reference words: 1.00 1.10


INF: How to Make the Analyzer Include Field Descriptions

 Article Number: Q109404

 CREATED: 02-JAN-1994

 MODIFIED: 24-FEB-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

The Object Analyzer utility that comes with Microsoft Access does not

include field descriptions in its output. However, you can make the

Analyzer include field descriptions by making some modifications to the

utility.

MORE INFORMATION

To make the Analyzer include field descriptions in its output you need to

modify the table RLTables and the function DumpTableInfo() in the

ANALYZER.MDA library.

The following steps describe how to make the necessary modifications:

 1. Use Windows Notepad (or any other text editor) to open the

    MSACCESS.INI file that is in your Windows directory.

 2. If the line

       analyzer.mda=

    exists in the [Libraries] section of the MSACCESS.INI file, put a

    semicolon at the beginning of the line. The modified line will be:

       ;analyzer.mda=

 3. Save and then close the MSACCESS.INI file.

 4. Start Microsoft Access and open the database ANALYZER.MDA.

 5. Open the RLTables table in Design view.

 6. Add a field called Description to the table. The field should have a

    data type of Text, with a length of 255 characters.

 7. Save and then close the table.

 8. Open the module Object Analyzer.

 9. Find the function DumpTableInfo().

10. Add the lines of code listed below to the function. Note that the

    lines to be added begin with the characters $$.

    NOTE: In the following sample code, an underscore (_) is used as a

    line-continuation character. Remove the underscore when re-creating

    this code in Access Basic.

   Sub DumpTableInfo (TargetDB As String, SQLTarget1 As String, _

   ObjOption As String, IsAttached As Integer)

      CurrentProc = "DumpTableInfo"

      '$$ New code begins - declare new variables

      Dim F As Form, C As Control

      '$$ New code ends

      If Not TableExists(TargetDB, SQLTarget1) Then

         '$$ New code begins - change the SQL to include Description

         SQLSTRING$ = "Select TableName,Name,Type,Length,IndexName,_

                Description Into [" & SQLTarget1 & "] in """ & TargetDB _

                & """ From RLTables;"

         '$$ New code ends

         PerformSQLAction SQLSTRING$

      End If

      Set RT_Target = OpenDatabase(TargetDB)

      Set RT_Database = CurrentDB()

      Set RT_SysDB = CodeDB()

      Set RT_Table2 = RT_Target.OpenTable(SQLTarget1)

      Set RT_Dynaset1 = RT_Database.CreateDynaset(ObjOption)

      Set RT_Snapshot1 = RT_Dynaset1.ListFields()

      If Not IsAttached Then

         Set RT_Table1 = RT_Database.OpenTable(ObjOption)

         Set RT_Snapshot2 = RT_Table1.ListIndexes()

      End If

      '$$ New code begins - create a form in Design view

      Set F = CreateForm()

      'set the record source to the source table

      F.RecordSource = ObjOption

      '$$ New code ends

      Do Until RT_Snapshot1.EOF

         RT_Table2.AddNew

         RT_Table2!TableName = ObjOption

         RT_Table2!Name = RT_Snapshot1!Name

         RT_Table2!Type = LookUpFieldType(RT_Snapshot1!Type)

         RT_Table2!Length = RT_Snapshot1!Size

         '$$ New code begins - create a control for this field

         Set C = CreateControl(F.FormName, 109, 0, "", RT_Snapshot1!Name)

1         'save the description from the field

         RT_Table2!Description = C.StatusBarText

         '$$ New code ends

         If Not IsAttached Then

            ' Cannot use FindFirst method on List Snapshots

            If RT_Snapshot2.RecordCount > 0 Then

               RT_Snapshot2.MoveFirst

               Do Until RT_Snapshot2.EOF

                  If RT_Snapshot2!FieldName = RT_Snapshot1!Name Then _

                      Exit Do

                  RT_Snapshot2.MoveNext

               Loop

               If Not RT_Snapshot2.EOF Then

                  RT_Table2!IndexName = RT_Snapshot2!IndexName

               End If

            End If

         End If

         RT_Table2.Update

         RT_Snapshot1.MoveNext

      Loop

      '$$ New code begins - close the form, say "No" to save changes

      DoCmd SetWarnings True

      SendKeys "n"

      DoCmd Close A_FORM, F.FormName

      '$$ New code ends

      RT_CloseAllObjects

   End Sub

11. Save and then close the module.

12. Quit Microsoft Access.

13. Use Windows Notepad (or any other text editor) to open the

    MSACCESS.INI file that is in your Windows directory.

14. Remove the semicolon from the beginning of the

       ;analyzer.mda=

    line in the [Libraries] section of the file. The modified line will

    be:

       analyzer.mda=

15. Save and then close the file.

REFERENCES


PRB: Updated Help Compiler Needed for Word 6.0 RTF Files
PRB: Updated Help Compiler Needed for Word 6.0 RTF Files [B_WAccADK]

 Article Number: Q109405

 CREATED: 02-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SYMPTOMS

When you compile a Help file with the Help compiler that ships with the

Microsoft Access Distribution Kit (ADK), you receive error messages similar

to the following:

 - This application has violated system integrity due to an invalid

   fault and will be terminated.

 - Quit all applications, quit Windows, and then restart your computer.

CAUSE

The Rich Text Format (RTF) file that you are using was created with

Microsoft Word version 6.0 for Windows. This version of Word for Windows

generates some new RTF items that are not supported by the Help compiler

that ships with the ADK.

RESOLUTION

An updated version of the Help compiler is available on CompuServe and the

Microsoft Download Service (MSDL). The updated Help compiler is compatible

with Word 6.0 for Windows RTF files.

STATUS

This problem no longer occurs in the Microsoft Access Developer's Toolkit

version 2.0.

MORE INFORMATION

The Help compiler that ships with the ADK is named HC31.EXE and is version

3.10.504. To work with RTF files from Word 6.0 for Windows, you need

version 3.10.505 or later.

The following steps describe how to download the updated Help compiler from

either CompuServe or the MSDL:

To locate the most recent version of the Help compiler on CompuServe:

1. Log on to CompuServe.

2. Type "go msl" (without the quotation marks).

3. Choose the Scan option.

4. When prompted for Keywords, type "help compiler" (without the quotation

   marks).

To locate the most recent version of the Help compiler on the MSDL:

1. Connect to the MSDL at (206) 936-6735. Login instructions will

   be displayed.

2. After you log in, choose the File Index option.

3. Choose the Languages and Windows SDK option.

4. Choose the Windows SDK option.

5. Choose the Articles option.

Once you have located the most recent version of the Help compiler on

either CompuServe or the MSDL, follow the online instructions for

downloading the file.

Note that the file you download may contain two Help compiler files, HC.EXE

and HCP.EXE. HC.EXE is the standard Help compiler, and HCP.EXE is the

compiler for use with extended memory and larger files. HCP.EXE allows

larger files to be compiled in the Windows environment than does HC.EXE.

Additional reference words: 1.10 hccp hc505.exe


PRB: Company Pick List in Suppliers Form Doesn't Filter

 Article Number: Q109406

 CREATED: 02-JAN-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you choose one of the alphabet filter buttons in the Suppliers form

in the sample database NWIND.MDB, the suppliers in the underlying records

are filtered correctly. However, the list of suppliers in the Select

Company To Find box is not filtered, and still displays all the

suppliers.

CAUSE

The alphabet filter buttons are not meant to filter the entries in the

Select Company To Find combo box when the underlying record set is

filtered.

RESOLUTION

The following steps describe how to modify the Suppliers form so that the

alphabet filter buttons will filter the list in the Select Company To

Find combo box:

1. View the Suppliers form in Design view. Place an unbound text box

   with the following properties anywhere on the form:

      ControlName: Company Pick List Filter

      Visible: No

      Default Value: *

2. Open the Alpha Filter Buttons macro in Design view. Add the following

   macro actions at the end of EACH ApplyFilter action:

      SetValue

         Item: [Company Pick List Filter]

         Expression: "[Aaaa]*"

      Requery

         ControlName: Company Pick List

      SetValue

         Item: [Company Pick List]

         Expression: [Company Name]

   The expression in the first SetValue action in each entry should be

   copied from the Where Condition argument of each ApplyFilter section.

   For example, for the A button the ApplyFilter Where Condition argument

   is "[ AÀÂÄ*" (these characters are international versions of A).

   The B button's Where Condition argument is "B*," and so on.

3. After the ShowAllRecords action, add the following actions:

      SetValue

         Item: [Company Pick List Filter]

         Expression: "*"

      Requery

         ControlName: Company Pick List

      SetValue

         Item: [Company Pick List]

         Expression: [Company Name]

4. Open the Supplier List query in Design view and add the following

   criteria to the Criteria row of the Company Name column:

      Like [Forms]![Suppliers]![Company Pick List Filter] & "*"

How the Company Pick List Filter Works

--------------------------------------

After the ApplyFilter action filters the underlying records, the SetValue

action places the criteria in the hidden text box control on the

Suppliers form.

The Requery action forces the Select Company To Find combo box to refresh

its list, forcing the Supplier List query to rerun. The query then runs

using the hidden text box contents as the criteria for filtering the

company names to appear in the list.

The final SetValue action ensures that a valid company name from the

filtered list appears in the combo box.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the Suppliers form in Form view.

2. Choose the B alphabet filter button at the bottom of the form to

   filter for company names that start with the letter B.

3. Click the drop-down arrow on the Select Company To Find combo box.

   Note that all suppliers, not just those with a company name that

   starts with the letter B, are listed.


INF: Description of PrtMip Property

 Article Number: Q109407

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article is a copy of the PrtMip property documentation from the "The

Secrets of Access Wizards" manual that is included with the Microsoft

Access Distribution Kit documentation.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools

provided with Microsoft Access. For more information on Access Basic,

please refer to the "Introduction to Programming" manual.

MORE INFORMATION

The PrtMip property setting is read-write in Design view, and read-only

in other views.

PrtMip Property

---------------

Applies To    Reports.

Description   Sets and returns information from print setup for a

              report.

Setting       The PrtMip property setting is a 24-character string

              that maps to the print setup information displayed after

              you press the More button. It takes the following

              settings:

              Setting        Description

              --------------------------------------------------------

              Left, Top,     Integer for each. The margin settings

              Right,         specify the distance in inches or

              Bottom Margin  centimeters between the edge of the page

                             and the item to be printed.

              Data Only      Integer. Print only the data in a report

                             without borders, gridlines, or display

                             graphics. The value can be True (-1) or

                             False (0).

              Item Size      Integer. The report width in inches or

              Width          centimeters.

              Item Size      Integer. The report height in inches or

              Height         centimeters.

              Default Size   Integer. True (-1) if the same as the

                             size of the detail section and False (0)

                             if defined by the item size width and

                             height.

              Items Across   Integer. Defines the number of columns

                             across for multiple-column reports or

                             labels.

              Row Spacing    Integer. The space between detail rows in

                             inches or centimeters.

              Column         Integer. The space between detail columns

              Spacing        in inches or centimeters.

              Item Layout    Integer. Horizontal (1) or Vertical (2)

                             layout of report columns.

Example       Reads the device and margin information, resets the page

              orientation, and halves the margins.

   Sub PrtSetUpdemo (szReport$)

      ' The structures defined in the zwAlGlobals module.

      Dim dm As zwtDevModeStr

      Dim DevMode As zwtDeviceMode

      Dim mip As zwfMIPSTR

      Dim mi As zwfMarginInfo

      ' Read DeviceMode info.

      dm.rgb = Reports(szReport).PrtDevMode

      LSet DevMode = dm

      ' If the current orientation is portrait then . . .

      If DevMode.dmOrientation = 1 Then

         ' Change it to landscape.

         DevMode.dmOrientation = 2

      Else

         ' Else change it to portrait.

         DevMode.dmOrientation = 1

      End If

      LSet dm = DevMode

      ' Write the device mode information.

      Reports(szReport).PrtDevMode = dm.rgb

      ' Read margin info.

      mip.rgb = Reports(szReport).PrtMip

      LSet mi = mip

      ' Make all margins smaller.

      mi.xLeftMargin = mi.xLeftMargin / 2

      mi.xRightMargin = mi.xRightMargin / 2

      mi.yTopMargin = mi.yTopMargin / 2

      mi.yBotMargin = mi.yBotMargin / 2

      LSet mip = mi

      ' Write the new margin info.

      Reports(szReport).PrtMip = mip.r

   End Sub

The variables and constants that begin with "zw" are defined in the

zwAllGlobals module in WIZARDS.MDA.

REFERENCES

==========

Microsoft Access "The Secrets of Access Wizards," pages 27-28

Additional reference words: 1.00 1.10 PtrIss


INF: "Unexpected Error 1031" Using the SecurityWizard

 Article Number: Q109408

 CREATED: 02-JAN-1994

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you are using the Microsoft Access SecurityWizard, you receive the

error message "Unexpected Error 1031" after the SecurityWizard has

transferred the database objects.

CAUSE

This error can occur if you are using the WZSECURE.MDA with Microsoft

Access running under Windows 3.1 and do not have the MS-DOS SHARE.EXE

program loaded on your computer.

RESOLUTION

Load the MS-DOS program SHARE.EXE with the following steps:

1. Quit Microsoft Access.

2. Quit Microsoft Windows.

3. Add the following line to your AUTOEXEC.BAT file and then save the

   file:

      C:\DOS\SHARE.EXE /L:500

4. Restart your computer and run the SecurityWizard again.

Additional reference words: 1.00 1.10


PRB: Unbound Controls in Form Datasheet Do not Print Preview

 Article Number: Q109409

 CREATED: 02-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Data in unbound controls on forms in Datasheet view will not be displayed

when the datasheet is previewed. Only the control's name will be displayed.

RESOLUTION

View the form in Form view before previewing it. Data in unbound controls

will be displayed if the form is previewed in Form view.

 -or-

Bind the unbound controls to fields on a table that store the controls'

data. Once the controls are bound you will be able to preview the form

in Datasheet view and still see the data in the controls.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create a blank, unbound form.

3. Place an unbound text box on the form.

4. View the form in Datasheet view.

5. Type any text in the control.

6. From the File menu, choose Print Preview to preview the form.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 8, "Form

Basics," pages 205-208

Additional reference words: 1.00 1.10 forms


INF: Xtrieve Data Dictionary (.DDF) File Information

 Article Number: Q109449

 CREATED: 04-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes Xtrieve data dictionary (.DDF) files.

MORE INFORMATION

Each Xtrieve data dictionary consists of three files: FILE.DDF,

FIELD.DDF, and INDEX.DDF.

The first three records in the FILE.DDF file contain information about the

.DDF files for the data dictionary. The first record contains the name and

path to itself (FILE.DDF), the second record contains the name and path to

FIELD.DDF, and the third record contains the name and path to INDEX.DDF.

The remaining records contain the path and filename of each Btrieve file

available for use by Microsoft Access as a table.

Microsoft Access reads the FILE.DDF file to locate the FIELD.DDF and

INDEX.DDF files. If you move these files, make sure to update the FILE.DDF

file to reflect their current location. Or, if you change the names of

these files, make sure to update the FILE.DDF file to reflect the new

names.

To modify the FILE.DDF file you must use Xtrieve, or any hex editor. If you

use a hex editor to modify the file, make sure not to change the record

or field lengths in the file.

Xtrieve and Btrieve are manufactured by Novell, Inc., a vendor independent

of Microsoft; we make no warranty, implied or otherwise, regarding this

product's performance or reliability.

Additional reference words: 1.00 1.10 2.00 Attaching


PRB: Size To Fit Form Command Not Available

 Article Number: Q109450

 CREATED: 04-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you are viewing a form in Form view, the Size To Fit Form command on

the Window menu is unavailable.

CAUSE

This behavior occurs if the form is maximized. When a form is maximized,

its size is tied to the size of the Microsoft Access window. If the Size To

Fit Form command were available at this time, you would be altering the

size of the Microsoft Access program window, rather than the

size of your form.

RESOLUTION

Restore the Form window to its non-maximized size. The Size To Fit Form

command will be available.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Open the Customers form in Form view.

3. Maximize the Customers form.

4. Open the Window menu. Note that the Size To Fit Form command is

   not available.

REFERENCES

==========

For more information on sizing forms, search for "sizing forms" then "Size

to Fit Form Command (Window Menu)" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 grey sizetofit sizetofitform


INF: How to Obtain the Number of Days in a Month

 Article Number: Q109703

 CREATED: 06-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article demonstrates two methods of returning the total number of

days in the current month. The first method uses a query, and the second

method uses a user-defined Access Basic function.

MORE INFORMATION

Query Method

------------

Create the following new query based on any table:

NOTE: In the following example, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this

example.

   Query: QueryTest

   --------------------------------------------------------------

   Field: DateDiff("d",Date()-(Day(Date()- 1)), DateSerial(Year _

          (Date()),(Month(Date())+1),1))

      Total: First

      Show:  True

This query will return an integer for the number of days in the current

month. For example, if the current month is April, the query will return

the integer 30.

User-Defined Access Basic Function

----------------------------------

NOTE: This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

Create the following sample function in a new or existing module:

   '******************************************************

   'Declarations Section of Module

   '******************************************************

   Option Compare Database

   Option Explicit

   '******************************************************

   'DaysInMonth Function

   '******************************************************

   ' This function takes a date as an argument and returns

   ' the total number of days in the month.

   Function DaysInMonth (MyDate)

      Dim NextMonth, EndOfMonth

      NextMonth = DateAdd("m", 1, MyDate)

      EndOfMonth = NextMonth - DatePart("d", NextMonth)

      DaysInMonth = DatePart("d",EndOfMonth)

   End Function

Type the following expression in the module's Immediate window:

   ?DaysInMonth(Date())

The number of days in the current month will be returned. To obtain the

number of days in the month of a specific date, enter the specific date as

follows:

   ?DaysInMonth(#11/4/93#)

The integer 30 will be returned in the Immediate window, since there are

30 days in the month of November.

To use this function in a query or form, use an equal sign (=) instead of

the question mark (?) before the function name:

   =DaysInMonth(<date value or variable>)

REFERENCES

==========

For more information on date functions, search for "date," and then check

each of the date function topics using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


INF: Description of the ControlSource Property

 Article Number: Q109704

 CREATED: 06-JAN-1994

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes the ControlSource property of a control. It also

describes how to use a SetValue macro action to display and save

expressions in a control's underlying field.

MORE INFORMATION

A control's ControlSource property can be blank, or it can contain an

expression or the name of a field in the form's underlying table. If the

ControlSource property is blank or contains an expression, the property is

unbound. If the ControlSource property contains the name of a field in the

underlying table, the property is bound.

Unbound ControlSource Property

------------------------------

An unbound control can display data, but cannot save data. Consider the

following sample control:

   ControlName: MyControl

   ControlSource: ="Hello"

The text "Hello" will be displayed in the control named MyControl, but will

not be stored in any table.

Unbound controls are often used to display calculations on a form that do

not need to be stored in the underlying table.

Bound ControlSource Property

----------------------------

A bound control can display and save data for the field listed in the

control's ControlSource property. Consider the following sample control:

   ControlName: Last Name

   ControlSource: Last Name

This control will display the data from the Last Name field, and will store

any changes made in the control to the Last Name field in the form's

underlying table.

Storing Calculations in a Field

-------------------------------

In some cases you may want to perform a calculation in the ControlSource

property and store the value in the underlying table. The following example

demonstrates how to use a SetValue macro action to accomplish this:

 1. Open the sample database NWIND.MDB.

 2. Open the Orders table in Design view.

 3. Add the following field to the table:

       Table: Orders

       ------------------

       FieldName: Total

       DataType: Currency

 4. Save and then close the table.

 5. Create a new, blank form based on the Orders table.

 6. From the View menu, choose Field List if it is not already selected.

 7. Drag the Order Amount, Freight, and Total fields from the Field List

    to the form. These fields are bound controls on the form. Note that

    their ControlSource properties contain the name of the underlying

    fields.

 8. Create the following new macro:

       Macro Name      Action

       ------------------------

       Test1           SetValue

       Test1 Actions

       ---------------------------------------

       SetValue

          Item: [Total]

          Expression: [Freight]+[Order Amount]

    Note that this macro is equivalent to the expression: [Total]=

    [Freight]+[Order Amount]. When the macro runs it will fill the Total

    field with this calculated value.

 9. Set the form's OnCurrent property to the Test1 macro. This causes the

    macro to run when the form is opened, and every time you move from

    one record to another.

10. Set the Order Amount text box's AfterUpdate property to the Test1

    macro. This causes the Test1 macro to run whenever the contents of

    the control are modified.

11. Set the Freight text box's AfterUpdate property to the Test1 macro.

12. View the form in Form view.

Note that the Test1 macro runs every time you move from one record to

another, or whenever you modify a value in the Freight or Order Amount

fields.

REFERENCES

==========

Microsoft Access "User's Guide," version 2.0, pages 342 and 642

Additional reference words: 1.00 1.10 2.00


INF: Starting Another Application from a Text Box on a Form

 Article Number: Q109705

 CREATED: 06-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to start another application from a text box

on a Microsoft Access form.

MORE INFORMATION

You can start another application from a text box on a form by attaching

a RunApp action to the text box's AfterUpdate property. The example below

demonstrates how to start an application and load the file whose filename

was typed in the text box. This example will start the Microsoft Word for

Windows application and load the file from the Word for Windows

directory:

1. Create the following new macro and save it as Open Word:

   NOTE: In the following example, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this

   line.

      RunApp

      -------------------------------------------------------

      Command Line: ="c:\winword\winword.exe c:\winword\" & _

      Forms![formname]![controlname] & ".doc"

   NOTE: This example assumes you have the Word for Windows application

   in a WINWORD directory on drive C on your computer. Make the appropriate

   changes to the example line above to point to the correct drive and

   directory for your computer.

2. Add a text box to a form.

3. Set the text box's AfterUpdate property to the Open Word macro.

4. View the form in Form view.

5. Type the name of a file that is in your Word for Windows directory in

   the text box without the .DOC extension, and then press ENTER. For

   example, for a file named TEST.DOC you would type "TEST" (without

   quotation marks) in the text box.

REFERENCES

==========

For more information about the RunApp action, search for "RunApp" using the

Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


PRB: Space in Macro Name Column Stops Macro

 Article Number: Q109707

 CREATED: 06-JAN-1994

 MODIFIED: 06-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Your macro stops running even though there are additional macro actions

to be run and no other macro names are visible in the Macro Name column

of the macro group.

CAUSE

This behavior can occur if there is a space in the Macro Name column. A

space character in the Macro Name column is treated as a macro name and

stops the execution of the macro on the line containing the space.

RESOLUTION

Check for spaces in the Macro Name column by selecting the first actual

macro name. Then use the DOWN ARROW key to move the insertion point to the

next row. If a space exists, the insertion point will appear slightly

larger than it does in cells that are empty. To delete a selected space

character, press the DEL key.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database Northwind Traders (NWIND.MDB).

2. Create the following new macro:

      Macro Name   Action

      -------------------

                   MsgBox

      <SPACE>      MsgBox

      MyMacro Actions

      ---------------

      MsgBox

       Message: First Message

      MsgBox

       Message: Second Message

3. Run the macro. Note that only the first message box is displayed.

   If you remove the space from the Macro Name column, both message

   boxes are displayed when you run the macro.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 21, "Macro

Basics," pages 505-526, version 1.1, pages 509-530

Additional reference words: 1.00 1.10 halt run


PRB: "Can't Update Currently Locked" Attaching FoxPro Table

 Article Number: Q109709

 CREATED: 06-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

You receive the error message "Can't Update Currently locked" when you

attach or view a previously attached FoxPro table that another user has

open and is running an append or update operation on.

CAUSE

This error occurs because FoxPro temporarily locks the table and indexes

when a user is performing an append or update operation. The locks are

released as soon as the operation is complete.

RESOLUTION

Wait for the append or update operation to be complete, and then attach or

view the FoxPro table again.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access and open any database.

2. Attach a FoxPro table located on a shared network drive.

3. Start an append or update query on the attached table. The operation

   will need to take long enough to complete the rest of these steps.

4. Start another instance of Microsoft Access on a second computer.

5. On the second computer, attach the same FoxPro table you attached in

   step 2.

You will receive the error message stated above.

NOTE: The following sample code can be used in place of the append or

update query in step 3 to keep the first computer busy with the FoxPro

table:

   Sub test ()

      Dim db As Database

      Dim ds As Dynaset

      Set db = CurrentDB()

      'Query1 is based on the attached FoxPro table and has no criteria.

      Set ds = db.CreateDynaset("Query1")

      ds.MoveFirst

      While Not ds.eof

         ds.Edit

         ds!Author = "FOX"

         ds.Update

         ds.MoveNext

         Debug.Print ".";

         DoEvents

       Wend

       ds.Close

       db.Close

   End Sub

Additional reference words: 1.00 1.10 Attaching


INF: Sample Version 1.1 MSACCESS.INI File

 Article Number: Q109712

 CREATED: 06-JAN-1994

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.1

------------------------------------------------------------

---------

SUMMARY

This article lists a generic MSACCESS.INI file for Microsoft

Access

version 1.1. The MSACCESS.INI file is created by the

Microsoft Access

Setup program. If the MSACCESS.INI file in your Windows

directory is

damaged or removed, you can run the Setup program again, or

re-create

the file yourself using the information in this article.

MORE INFORMATION

To create a new MSACCESS.INI file, follow these steps:

1. Open any text editor such as Windows Notepad.

2. Enter the following text in a new file. Note that you

must use

   the appropriate directory names for your system in the

[Options]

   section of the file:

   ;=====================================================

   ;This is a generic MSACCESS.INI file for version 1.1

   ;=====================================================

   [Options]

   SystemDB=C:\ACCESS\SYSTEM.MDA      ;path may differ

   UtilityDB=C:\ACCESS\UTILITY.MDA    ;use path for your

installation

   [Paradox 3.X]

   Filter=Paradox (*.db)|*.db|All Files (*.*)|*.*|

   Extension=db

   OneTablePerFile=Yes

   IndexDialog=No

   [dBASE III]

   Filter=dBASE III (*.dbf)|*.dbf|All Files (*.*)|*.*|

   Extension=dbf

   OneTablePerFile=Yes

   IndexDialog=Yes

   IndexFilter=dBASE Index (*.ndx)|*.ndx|All Files

(*.*)|*.*|

   IndexExtension=ndx

   [dBASE IV]

   Filter=dBASE IV (*.dbf)|*.dbf|All Files (*.*)|*.*|

   Extension=dbf

   OneTablePerFile=Yes

   IndexDialog=Yes

   IndexFilter=dBASE Index (*.ndx;*.mdx)|*.ndx;*.mdx|All

Files (*.*)|*.*|

   [FoxPro 2.5]

   Filter=FoxPro 2.5(*.dbf)|*.dbf|All Files (*.*)|*.*|

   Extension=dbf

   OneTablePerFile=Yes

   IndexDialog=Yes

   IndexFilter=FoxPro Index (*.idx;*.cdx)|*.idx;*.cdx|All

Files

   (*.*)|*.*|

   [FoxPro 2.0]

   Filter=FoxPro 2.0 (*.dbf)|*.dbf|All Files (*.*)|*.*|

   Extension=dbf

   OneTablePerFile=Yes

   IndexDialog=Yes

   IndexFilter=FoxPro Index (*.idx;*.cdx)|*.idx;*.cdx|All

Files

   (*.*)|*.*|

   [Btrieve]

   Filter=Btrieve (file.ddf)|file.ddf|

   Extension=ddf

   OneTablePerFile=No

   IndexDialog=No

   [Microsoft Access]

   Filter=Microsoft Access (*.mdb)|*.mdb|All Files

(*.*)|*.*|

   Extension=mdb

   OneTablePerFile=No

   IndexDialog=No

   Maximized=1

   Tutorial=1

   [Delimited Text]

   Filter=Delimited Text (*.txt)|*.txt|All Files (*.*)|*.*|

   Extension=txt

   OneTablePerFile=Yes

   IndexDialog=No

   [Fixed Width Text]

   Filter=Fixed Width Text (*.txt)|*.txt|All Files

(*.*)|*.*|

   Extension=txt

   OneTablePerFile=Yes

   IndexDialog=No

   [Word for Windows Merge]

   Filter=Text (*.txt)|*.txt|All Files (*.*)|*.*|

   Extension=txt

   OneTablePerFile=Yes

   IndexDialog=No

   [Microsoft Excel]

   Filter=Microsoft Excel (*.xls)|*.xls|All Files (*.*)|*.*|

   Extension=xls

   OneTablePerFile=Yes

   IndexDialog=No

   [Lotus WKS]

   Filter=Lotus 1-2-3 (*.wks)|*.wks|All Files (*.*)|*.*|

   Extension=wks

   OneTablePerFile=Yes

   IndexDialog=No

   [Lotus WK1]

   Filter=Lotus 1-2-3 (*.wk1)|*.wk1|All Files (*.*)|*.*|

   Extension=wk1

   OneTablePerFile=Yes

   IndexDialog=No

   [Lotus WK3]

   Filter=Lotus 1-2-3 (*.wk3)|*.wk3|All Files (*.*)|*.*|

   Extension=wk3

   OneTablePerFile=Yes

   IndexDialog=No

   [ODBC]

   QueryTimeout=60

   LoginTimeout=20

   [Libraries]

   wizard.mda=ro

   [Form Wizards]

   Single-Column=zwInitWizard, 1

   Tabular=zwInitWizard, 2

   Graph=zwInitWizard, 6

   Main/Subform=zwInitWizard, 7

   [Report Wizards]

   Single-Column=zwInitWizard, 3

   Groups/Totals=zwInitWizard, 4

   Mailing Label=zwInitWizard, 5

3. Save the file as MSACCESS.INI in your Windows directory.

REFERENCES

==========

For more information on the MSACCESS.INI file, search for

"MSACCESS.INI"

then "Customizing MSACCESS.INI Settings" using the Microsoft

Access Help

menu.

Additional reference words: 1.10


INF: Variables for Controls Must Be String Data Type

 Article Number: Q109713

 CREATED: 06-JAN-1994

 MODIFIED: 10-JAN-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

When you are using a variable to refer to a control on a form or report,

the variable must be declared as a String data type.

MORE INFORMATION

The following example demonstrates the correct way to refer to controls

using variables:

1. Create the following new form, and then save it as Form1:

      Object: Text Box

      ----------------

      Control Name: 1

      Object: Text Box

      ----------------

      Control Name: 2

2. Create a new module and enter the following sample code:

      '***********************************

      'Declarations section of the module.

      '***********************************

      Option Explicit

      '===========================================================

      'The following function will fill the text boxes on the form

      'with values.

      '===========================================================

      Function FillForm()

         Dim F as Form, i as Integer

         Set F = Forms("Form1")

         i = 1

         F(i) = "test"

         i = 2

         F(i) = "test2"

      End Function

3. With Form1 open in Form view, run the above function in the Immediate

   window. You will receive the error message "Can't set value."

4. Modify the function to be:

      Function FillForm()

         Dim F as Form, i as string

         Set F = Forms("Form1")

         i = "1"

         F(i) = "test"

         i = "2"

         F(i) = "test2"

      End Function

5. Run the function in the Immediate window. The text boxes on the form

   will be filled.

REFERENCES

==========

Microsoft Access "Introduction To Programming," Version 1.0, pages 79-96

Additional reference words: 1.00 1.10


INF: Description of HotSpot Editor and HotSpot Types

 Article Number: Q109714

 CREATED: 06-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SUMMARY

This article describes how to create a Searchable type action that is

associated with the Hot Spot Editor. The "Help Compiler Guide" does not

document this specific type attribute.

MORE INFORMATION

The Hot Spot Editor that ships with the Microsoft Access Distribution Kit

version 1.1 creates hypergraphics that you can use within your Help file.

You can create hot spots that link to topics, pop-up windows, or macros.

These links are enabled whenever the user clicks the hot spot.

The "Help Compiler Guide" that ships with the Microsoft Access Distribution

Kit version 1.1 documents three different types of hot spot attributes on

pages 58-59:

   Jump (defines a jump to another topic)

   Pop-up (displays a pop-up window)

   Help macro (runs a Help macro)

There is an additional, undocumented, type of hot spot attribute:

   Searchable type (allows you to search for a word, then jumps

                    to the appropriate graphic)

To add the Searchable type to the drop-down list of types in the hot spot's

Attributes dialog box, add the following lines to your WIN.INI file:

   [HotSpot Editor]

   Searchable=1

How to Use the Searchable Type Attribute

----------------------------------------

1. Open a picture (for example, *.BMP) in the Hot Spot Editor.

2. Create a hot spot on the picture by dragging a box onto the picture.

3. Double-click the hot spot and the Attributes dialog box will appear.

   The Attributes dialog box contains binding information for each hot spot

   that you define.

4. In the Type field, select Searchable.

   Note that the binding portion of the Attributes dialog box differs from

   the diagram on page 58 of the "Help Compiler Guide." Instead of a

   Context String field, you see a Search Keys field.

5. In the Search Keys field, enter a valid keyword from your Rich-Text

   Format (RTF) Help file (for example, TestOpen).

   For additional information on coding keywords for your Searchable type,

   refer to the "Help Compiler Guide," page 32.

6. Fill out the Bounding Box portion of the Attributes dialog box as you

   would for the three other types of hot spot actions.

7. Choose OK.

Testing the Hot Spot

--------------------

1. In the online Help for your application, search for TestOpen (or what-

   ever keyword you assigned in step 5 above).

2. Go to the TestOpen topic.

Microsoft Access will jump to the hot spot graphic that has the TestOpen

search key defined.

REFERENCES

==========

Microsoft Access "Help Compiler Guide," Chapter 4, "Creating Graphics for

Help"

Additional reference words: 1.10 hotspot types


INF: How to Sort on Different Fields Dynamically

 Article Number: Q109715

 CREATED: 06-JAN-1994

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

This article demonstrates how to design a filter that you

can use to

dynamically select the field on which to sort records.

MORE INFORMATION

The example below uses the Choose() function in a filter to

sort the

records displayed on a form. Toggle buttons in an option

group are used

to sort on different fields. The Choose() function accepts

the value of

the option group as its first argument, and selects the

field from the

subsequent list based on that value.

The following example describes how to create a form and a

filter that

demonstrate this technique:

 1. Open the sample database NWIND.MDB.

 2. Create the following new form:

       Form: Customer Filter Test

       --------------------------------

          Caption: Customer Filter Test

          RecordSource: Customers

       Text Box: Company Name

          ControlSource: Company Name

       Text Box: Contact Name

          ControlSource: Contact Name

       Text Box: Address

          ControlSource: Address

 3. Create the following option group on the form:

       Option Group: Field Selector

          AfterUpdate: Apply Sort Macro

 4. Place the following toggle buttons in the option group:

       Toggle Button: CompName

          OptionValue: 1

          Caption: Company Name

       Toggle Button: ContName

          OptionValue: 2

          Caption: Contact Name

       Toggle Button: Addr

          OptionValue: 3

          Caption: Address

 5. View the form in Form view.

 6. Choose Edit Filter/Sort from the Records menu.

 7. Create the following calculated field:

    NOTE: In the following example, an underscore (_) is

used as a line-

    continuation character. Remove the underscore when re-

creating this

    example.

       Field: Choose(Forms![Customer Filter Test]![Field

Selector], _

          [Company Name], [Contact Name], [Address])

       Sort: Ascending

 8. From the File menu, choose Save As Query. Save the

filter as Customer

    Sort Filter.

 9. Save and close the form and close the filter.

10. Create the following new macro and save it as Apply Sort

Macro:

       Apply Sort Macro Actions

       ------------------------------------

       Action:  ApplyFilter

          Filter Name: Customer Sort Filter

11. Open the Customer Filter Test form. Click the Contact

Name

    toggle button.

The records on the form will be sorted by the Contact Name

field.

Clicking the other toggle buttons will cause the records to

be sorted on

the fields specified by the toggle buttons.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, "Choose

Function,"

page 65

For more information on the Choose() function, search for

"Choose" using

the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 change column


INF: How To Import or Attach Paradox for Windows 1.0 Files

 Article Number: Q109716

 CREATED: 06-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access version 1.x can attach and import Paradox version 3.x for

DOS tables. Microsoft Access version 2.0 can attach and import Paradox

version 3.x and 4.x for DOS tables. Neither Microsoft Access version 1.x

nor 2.0 can attach or import Paradox version 1.0 for Windows tables

directly.

In Microsoft Access version 1.x, attempting to attach or import a Paradox

version 1.0 for Windows table causes you to be prompted for a password.

In Microsoft Access 2.0, you receive the error message:

   Can't open this Paradox <n>.x table because ParadoxNetStyle is set to

   3.x in MSACCESS.INI

In the error message above, <n> is either 3 or 4, depending on the Paradox

version selected in the Import or Attach dialog box.

MORE INFORMATION

To attach or import a Paradox version 1.0 for Windows table you must first

export the table in Paradox to dBASE IV format. The following steps

describe how to export the table in dBASE IV format:

1. In Paradox 1.0 for Windows, choose Utilities from the File menu,

   then choose Copy.

2. In the Copy File From line, enter the name of the file you want to

   export.

3. In the Copy File To line, enter a new name for the file. Give the file

   a .DBF extension. This extension causes Paradox 1.0 for Windows to save

   the file in dBASE IV format.

4. Start Microsoft Access and import or attach the .DBF file.

Paradox is manufactured by Borland International, a vendor independent of

Microsoft; we make no warranty, implied or otherwise, regarding this

product's performance or reliability.

Additional reference words: 1.00 1.10 2.00 Importing


PRB: Memo and OLE Fields in a Snapshot Are Not Static

 Article Number: Q109717

 CREATED: 06-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

Data contained in a Snapshot that includes a Memo or OLE field can be

changed if the data in the underlying table for the Snapshot changes.

CAUSE

Microsoft Access stores the contents of Memo and OLE fields differently

than other data types. Memo and OLE field data is not stored in the data

page holding the actual record. Instead, the data page holding the record

contains an address pointer that specifies the data page(s) containing

the data.

When you create a Snapshot, a static copy of the data page holding the

record is copied. This copy contains only the address of the Memo or OLE

information. If the actual Memo or OLE information is changed, the

Snapshot will look to the same data page and will find the changed

information.

STATUS

This behavior is by design. The actual Memo or OLE information is not

loaded into the Snapshot in order to avoid performance degradation.

MORE INFORMATION

A Snapshot is a copy of the record source data at the point in time when

the Snapshot was created. Unlike the data in a Dynaset, Snapshot data is

not linked to data in the underlying tables. The Snapshot data does not

change as its underlying tables change.

Steps to Reproduce Behavior

---------------------------

You can use the following sample Access Basic function to demonstrate

that a Memo field contained in a Snapshot can be altered:

1. Open the sample database NWIND.MDB.

2. Create the following new function in a module:

      Function TestSnapShot ()

         Dim SS As Snapshot

         Dim DS As Dynaset

         Dim DB As Database

         Set DB = CurrentDB()

         ' Create a Snapshot and Dynaset of the Categories table.

         Set SS = DB.CreateSnapshot("Categories")

         Set DS = DB.CreateDynaset("Categories")

         ' Move to the first record.

         SS.MoveFirst

         DS.MoveFirst

         ' Print the contents of the Category Name and Description

         ' .. fields from both record sets. Category Name is a

         ' .. Text field and Description is a Memo field.

         Debug.Print

         Debug.Print "Snapshot:"

         Debug.Print "   Category Name: " & SS![Category Name]

         Debug.Print "   Description: " & SS![Description]

         Debug.Print "Dynaset:"

         Debug.Print "   Category Name: " & DS![Category Name]

         Debug.Print "   Description: " & DS![Description]

         ' Alter the Description and Category Name fields using

         ' .. the dynaset.

         DS.Edit

            DS![Description] = "My Description"

            DS![Category Name] = "My Category"

         DS.Update

         ' Print the new contents of the recordsets.

         Debug.Print

         Debug.Print "Snapshot:"

         Debug.Print "   Category Name: " & SS![Category Name]

         Debug.Print "   Description: " & SS![Description]

         Debug.Print "Dynaset:"

         Debug.Print "   Category Name: " & DS![Category Name]

         Debug.Print "   Description: " & DS![Description]

      End Function

3. Type the following in the module's Immediate window, and then press

   ENTER:

      ? TestSnapShot()

The following text will be displayed in the Immediate window:

   Snapshot:

      Category Name: Beverages

      Description: Soft drinks, coffees, teas, beer, and ale

   Dynaset:

      Category Name: Beverages

      Description: Soft drinks, coffees, teas, beer, and ale

   Snapshot:

      Category Name: Beverages

      Description: My Description

   Dynaset:

      Category Name: My Category

      Description: My Description

Note that the second Description for the Snapshot reads "My Description,"

which is the same as the change made by the Dynaset. Note also that the

second Category Name for the Snapshot is unchanged, as Text fields are

static in a Snapshot.

REFERENCES

==========

Microsoft Access "Language Reference," versions 1.0 and 1.1, page 91

Additional reference words: 1.00 1.10 2.00


PRB: Report Detail Items Appear in Group Header

 Article Number: Q109718

 CREATED: 06-JAN-1994

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

SYMPTOMS

The Groups/Totals ReportWizard places controls in the group

header

section of the report that should be in the report's detail

section.

CAUSE

This problem occurs if the report is based on a query that

contains a

calculated field.

RESOLUTION

To work around this behavior, move the calculated field to

the first

column in the query grid. Or convert the query to a make-

table query,

and then base your report on the make-table query's

resultant table,

instead of on the original query.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

 1. Open the sample database NWIND.MDB.

 2. Create a new query based on the Customers table.

 3. Drag the Customer ID, Company Name, and Contact Name

fields onto the

    query grid.

 4. Enter the following expression in the Field row of the

fourth column

    of the grid:

       IIF([customer id] = "ALWAO", "yes", "no")

 5. Save the query as Group/Total.

 6. Choose the Report button in the Database window, then

choose New.

 7. In the Select A Table/Query box, select the Group/Total

query.

 8. Choose the ReportWizards button.

 9. Select Groups/Totals in the Which AccessWizards Do You

Want? box,

    and then choose OK.

10. Click the ">>" button, and then choose Next.

11. Select the Customer ID field and then click the ">"

button.

12. Select the Company Name field and then click the ">"

button. Choose

    Next.

13. At each of the next three screens, choose Next.

14. Choose the Design button.

Note that the report has two group headers. The Company Name

header,

however, contains both the Company Name field and the

Contact Name

field, instead of just the Company Name field.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 17,

"Report Basics,"

pages 399-403

Microsoft Access "User's Guide," version 1.1, Chapter 17,

"Report Basics,"

pages 403-407

Additional reference words: 1.00 1.10


PRA: Changing Font Size Causes Subscript Text

 Article Number: Q109719

 CREATED: 06-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The current line of text you are editing in a multiple-line text box such

as a Memo field appears to be in subscript after you make a font change.

RESOLUTION

The problem will disappear as soon as a line wrap occurs while you are

editing the text in the multiple-line text box. You can also correct the

problem by selecting a different control on the form and then returning

to the multiple-line text box.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

The following steps use the sample database NWIND.MDB.

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB.

2. Open the Employees form in Form view.

3. Place the insertion point at the bottom of the first record's Notes

   field. Press CTRL+ENTER to start a new line in the field.

4. Type any text. Note that the text is displayed correctly.

5. View the form in Design view.

6. Select the Notes text box. Change the font for the text box from MS

   Sans Serif 8-point to Times New Roman 12-point.

7. View the form in Form view.

8. Place the insertion point in the middle of the third line of text

   in the Notes field, and type any text.

   Note that the text you type appears to be in subscript. If you type

   enough text to cause the line to wrap, the text you type will appear

   normal again.

9. Close the Employees form. Do not save the changes to the form.

Additional reference words: 1.00 1.10


INF: Sample Function to List Groups in System Database

 Article Number: Q109720

 CREATED: 06-JAN-1994

 MODIFIED: 10-JAN-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SUMMARY

This article lists a sample Access Basic function you can use to list the

groups in your Microsoft Access system.

Notes

-----

 - The technique described below relies on the use of tables stored with

   your SYSTEM.MDA file. These tables are undocumented and are subject to

   change in future versions of Microsoft Access. Use of the system tables

   is not supported by Microsoft.

 - This article assumes that you are familiar with Access Basic and with

   creating Microsoft Access applications using the programming tools

   provided with Microsoft Access. For more information on Access Basic,

   please refer to the "Introduction to Programming" manual.

MORE INFORMATION

The following sample function returns a comma separated list of the groups

in your Microsoft Access system database. The function takes one argument

that specifies the complete path and filename for the SYSTEM.MDA file that

you want to query.

   Function CurrentGroups (SysDB As String)

      Dim DB As Database

      Dim DS As Dynaset

      Dim CurrUser As String, Groups As String

      Dim Counter As Integer

      Set DB = OpenDatabase(SysDB)

      Set DS = DB.CreateDynaset("MSysGroupList")

      DS.MoveLast

      DS.MoveFirst

      For Counter = 1 To DS.RecordCount

         Groups = Groups & IIf(Len(Groups) > 0, ",", "") & DS![Name]

         DS.MoveNext

      Next Counter

      DS.Close

      DB.Close

      CurrentGroups = Groups

   End Function

To call this function on a computer with the SYSTEM.MDA file stored in the

ACCESS directory on drive C, type the following in the Immediate window:

   ? CurrentGroups("C:\ACCESS\SYSTEM.MDA")

Note that if the system has had no Groups added, you will receive the

following list:

   Admins,Guests,Users

REFERENCES

==========

Microsoft Access "Language Reference," pages 88-90, 198-199, 311-312, and

390-391

Additional reference words: 1.00 1.10 security


INF: Sample Function to Return Current User's Groups

 Article Number: Q109721

 CREATED: 06-JAN-1994

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

This article describes a sample Access Basic function to get

a list of groups the current user belongs to in the current

Microsoft Access system.

Notes

-----

 - The technique described below relies on the use of system

tables

   stored with your database. These tables are undocumented

and are

   subject to change in future versions of Microsoft Access.

 - This article assumes that you are familiar with Access

Basic and with

   creating Microsoft Access applications using the

programming tools

   provided with Microsoft Access. For more information on

Access Basic,

   please refer to the "Introduction to Programming" manual.

MORE INFORMATION

The following function returns a comma-separated list of the

groups in

the Microsoft Access system to which the current user

belongs. The

function takes one argument that lists the complete path and

filename for

the SYSTEM.MDA file you want to query:

'***********************************************************

****************

' Declarations Section of the Module

'***********************************************************

****************

Option Explicit

'===========================================================

================

' The following CurrentUserGroup() function returns a list

of groups to

' which the current user belongs.

'===========================================================

================

   Function CurrentUsersGroups (SysDB As String)

      Dim DB As Database

      Dim QD As QueryDef

      Dim DS As Dynaset

      Dim CurrUser As String, Groups As String

      Dim Counter As Integer

      Set DB = OpenDatabase(SysDB)

      Set QD = DB.OpenQueryDef("MSysUserMemberships")

      QD![UserName] = User()

      Set DS = QD.CreateDynaset()

      DS.MoveLast

      DS.MoveFirst

      For Counter = 1 To DS.RecordCount

         Groups = Groups & IIf(Len(Groups) > 0, ",", "") &

DS![Name]

         DS.MoveNext

      Next Counter

      DS.Close

      DB.Close

      CurrentUsersGroups = Groups

   End Function

To run the function where the SYSTEM.MDA file is located in

the ACCESS directory on the C drive, type the following in

the module's Immediate window and press ENTER:

   ? CurrentUsersGroups("C:\ACCESS\SYSTEM.MDA")

If you are logged into the Microsoft Access system as the

Admin user, and

you have not changed the default groups to which the Admin

user belongs,

you will receive the following list when the above function

is run:

   Admins,Users

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, pages 88-

90, 198-199,

311-312, 352-354, and 390-391

Microsoft Access "Introduction to Programming," version 1.0,

Chapter 8,

"Manipulating Data," pages 137-138

Additional reference words: 1.00 1.10 security


INF: Sample Function to Return Users in Current System

 Article Number: Q109722

 CREATED: 06-JAN-1994

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.00 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

------------------------------------------------------------

---------

SUMMARY

This article describes a sample Access Basic function to use

to

return a list of users in the current Microsoft Access

system.

Notes

-----

 - The technique described below relies on the use of system

tables

   stored with your database. These tables are undocumented

and are

   subject to change in future versions of Microsoft Access.

 - This article assumes that you are familiar with Access

Basic and with

   creating Microsoft Access applications using the

programming tools

   provided with Microsoft Access. For more information on

Access Basic,

   please refer to the "Introduction to Programming" manual.

MORE INFORMATION

The following function returns a comma-separated list of

users in the

current Microsoft Access system database. The function takes

one argument

that specifies the complete path and filename for the

SYSTEM.MDA file you

want to query.

NOTE: In the following sample code, an underscore (_) is

used as a line-

continuation character.  Remove the underscore when re-

creating this code

in Access Basic.

   Function CurrentUsers (SysDB As String)

      Dim DB As Database

      Dim DS As Dynaset

      Dim CurrUser As String, Users As String

      Dim Counter As Integer

      On Error GoTo FileError

      Set DB = OpenDatabase(SysDB)

      Set DS = DB.CreateDynaset("MSysUserList")

      DS.MoveLast

      DS.MoveFirst

      For Counter = 1 To DS.RecordCount

         Users = Users & IIf(Len(Users) > 0, ",", "") &

DS![Name]

         DS.MoveNext

      Next Counter

      DS.Close

      DB.Close

      CurrentUsers = Users

      Exit Function

   FileError:

      MsgBox "The Following Error Occurred:" & Chr$(13) &

Chr$(10) &_

      Chr$(13) & Chr$(10) & Error$

      Exit Function

   End Function

To run this function on a system where the SYSTEM.MDA file

is located in

the ACCESS directory on the C drive, type the following in

the module's

Immediate window, and then press ENTER:

   ? CurrentUsers("C:\ACCESS\SYSTEM.MDA")

If the Microsoft Access system has no users added to it, you

will

receive the following list:

   admin,Creator,Engine,guest

REFERENCES

==========

Microsoft Access "Language Reference," versions 1.0 and 1.1,

pages 88-90,

198-199, 311-312, and 390-391

Additional reference words: 1.00 1.10 security


INF: How to Determine Windows and DOS Versions

 Article Number: Q109723

 CREATED: 06-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to use the GetVersion() Windows API function

to return the version numbers of Microsoft Windows and DOS running on the

computer.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

The following example demonstrates how to use the GetVersion() Windows

API function in the KERNEL.EXE dynamic link library (DLL) included with

Windows:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   '====================================

   ' Global Declarations

   '====================================

   Option Explicit

   Declare Function GetVersion Lib "Kernel" () As Long

   Function SysVersions ()

      Dim ver As Long, WinVer As Long, DosVer As Long

      Dim WindowsVersion As String, DosVersion As String

      ver = GetVersion()

      WinVer = ver And &HFFF&

      WindowsVersion = Format((WinVer Mod 256) + _

         ((WinVer \ 256) / 100), "Fixed")

      DosVer = ver \ &H10000

      DosVersion = Format((DosVer \ 256) + _

         ((DosVer Mod 256) / 100), "Fixed")

      MsgBox "Windows Version: " & WindowsVersion _

         & Chr(13) & "DOS Version: " & DosVersion

   End Function

The GetVersion() function returns a value that is a DWORD (double word),

which translates into a long integer (32-bit value) in Access Basic. The

low-order word returns the major (low byte) and minor (high byte) Windows

version number, and the high-order word returns the major (high byte) and

minor (low byte) DOS version number.

REFERENCES

==========

Microsoft Windows Software Development Kit "Programmer's Reference

Volume 2: Functions," pages 469-470

Additional reference words: 1.00 1.10 2.00


INF: How to Hide the Combo Box Drop-Down Arrow on a Form

 Article Number: Q109724

 CREATED: 06-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article demonstrates a method to hide the drop-down arrow on a combo

box until the combo box is selected.

MORE INFORMATION

The following steps demonstrate how to hide the drop-down arrow on a combo

box when the combo box is not selected:

1. Open the sample database NWIND.MDB.

2. Open the Orders form in Design view.

3. Place a rectangle control on the form. Size and move the rectangle

   control so that it completely covers the drop-down arrow on the

   Salesperson combo box.

4. From the View menu, select Palette. Select a color in the Fill line

   to match the form's background color.

5. View the form in Form view.

The drop-down arrow on the Salesperson combo box will only be visible when

the combo box is selected.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 9, "Designing

Forms," pages 235-245, version 1.1, pages 239-249

Additional reference words: 1.00 1.10 2.00 hide combo box


INF: How to Find Attached Table's Database Name

 Article Number: Q109725

 CREATED: 06-JAN-1994

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article describes how to use the FindFirst method on a dynaset of

the MSysObjects table to find the path and filename of the database that

contains an attached table.

Notes

-----

 - The technique described below relies on the use of system tables

   stored with your database. These tables are undocumented and are

   subject to change in future versions of Microsoft Access.

 - This article assumes that you are familiar with Access Basic and with

   creating Microsoft Access applications using the programming tools

   provided with Microsoft Access. For more information on Access Basic,

   please refer to the "Introduction to Programming" manual.

MORE INFORMATION

The following example demonstrates how to use the FindFirst method to

find the path and filename of the database that contains an attached

table:

1. Create a new database.

2. From the File menu, choose Attach Table.

3. Select Microsoft Access in the Data Source box and then choose OK.

4. Select the sample database NWIND.MDB in the File Name box and then

   choose OK.

5. Select Categories in the Tables In NWIND.MDB box and then choose

   Attach. Choose OK, and then choose Close.

6. Create a new module with the following sample code:

      '********************

      ' MODULE DECLARATIONS

      '********************

      Option Explicit

      Function AttachedDBName (TableName As String)

         Dim DB As Database

         Dim DS As Dynaset

         Set DB = CurrentDB()

         Set DS = DB.CreateDynaset("MSysObjects")

         DS.FindFirst "[name] = '" & TableName & "'"

         If Not DS.NoMatch Then

            AttachedDBName = DS![database]

         Else

            AttachedDBName = ""

         End If

      End Function

7. To run the function, type the following in the module's Immediate

   window and press ENTER:

   ? AttachedDBName("Categories")

The function returns the path and filename of the database that contains

the attached table.

REFERENCES

==========

Microsoft Access "User's Guide," versions 1.0 and 1.1, Chapter 4,

"Importing, Exporting, and Attaching," pages 60-72

Additional reference words: 1.00 1.10 table name


PRA: Attached Btrieve Table Rounds Time Values

 Article Number: Q109726

 CREATED: 06-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you enter a time value such as 06:37:00 in a field in an attached

Btrieve table, the time value is changed when you exit the field. In this

example, the time value might be changed to 06:36:59.

CAUSE

This problem occurs because of differences in the way that Btrieve and

Microsoft Access store time values. Btrieve stores time values in integer

(binary) format, while Microsoft Access stores them in floating-point

(decimal) format. The conversion of decimal fractions to binary fractions

is a mathematically inexact process, and rounding errors can occur.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1, and 2.0. We are researching this problem and will post new

information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Btrieve is manufactured by Novell, Inc., a vendor independent of Microsoft;

we make no warranty, implied or otherwise, regarding this product's

performance or reliability.

Additional reference words: 1.00 1.10 2.00 ISAM


INF: How to Fill an Array Using Access Basic

 Article Number: Q109727

 CREATED: 06-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes two methods of filling an array using Access

Basic. The first method fills an array when the number of elements in the

array is known. The second method fills an array when the number of

elements in the array is not known.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

This example demonstrates how to fill a one-dimensional array when the

number of elements is known:

1. Open the sample database NWIND.MDB.

2. Create a new module with the following sample code:

      Option Explicit

      Function FillOneDimArray ()

         Dim i As Long

         Dim DB As Database, SS As Snapshot

         Dim RecordCount As Long

         On Error GoTo ErrorHandler

         Set DB = CurrentDB()

         Set SS = DB.CreateSnapshot("Employees")

         ' Get number of records.

         SS.MoveLast

         RecordCount = SS.RecordCount

         ' Create the (zero-based) array.

         ' Address elements starting from row 0 rather than 1.

         ReDim AnArray(RecordCount - 1)

         ' Fill the array.

         SS.MoveFirst

         For i = 0 To RecordCount - 1

            AnArray(i) = SS.[Last Name]

            SS.MoveNext

         Next i

         ' Print the array contents to the Immediate window.

         For i = 0 To RecordCount - 1

            Debug.Print AnArray(i)

         Next i

         SS.Close

         DB.Close

         Exit Function

      ErrorHandler:

         MsgBox Error

         Exit Function

      End Function

3. Choose Immediate Window from the View menu. Type the following

   in the Immediate window and press ENTER:

      ? FillOneDimArray()

The following will be printed to the Immediate window:

   Davolio

   Fuller

   Leverling

   Peacock

   Buchanan

   Suyama

   King

   Callahan

   Dodsworth

The next example demonstrates how to fill an array when the number of

elements is not known. A Dynaset will be used to fill the array. Records

can be added to or removed from the Dynaset while the array is being

filled:

1. Open the sample database NWIND.MDB.

2. Create a new module with the following sample code:

      Function FillIndefArray ()

         Dim DB As Database, DS As Dynaset, Count As Integer

         Dim AnArray()

         Dim i As Long

         Set DB = CurrentDB()

         Set DS = DB.CreateDynaset("Employees")

         ' Create the (zero-based) array with only one row.

         ' NOTE: The Preserve keyword allows the size of the array

         ' to be adjusted without the contents being destroyed.

         ' Adjusting the size of an array using Preserve can

         ' cause your code to go significantly slower. It is better

         ' to create an array with a known number of elements prior

         ' to filling it.

         Count = 0

         ReDim Preserve AnArray(0)

         ' Fill the array.

         DS.MoveFirst

         Do Until DS.eof

            ' Fill the array row with the last name.

            AnArray(Count) = DS![Last Name]

            ' Increase the number of elements in the array

            ' by one to accommodate the next record.

            ReDim Preserve AnArray(UBound(AnArray) + 1)

            Count = Count + 1

            DS.MoveNext

         Loop

         ' Remove the remaining empty array row.

         ReDim Preserve AnArray(UBound(AnArray) - 1)

         DS.Close

         ' Print the array contents to the Immediate window.

         For i = 0 To Count - 1

            Debug.Print AnArray(i)

         Next i

      End Function

3. From the View menu, choose Immediate Window. Type the following in

   the Immediate window, and then press ENTER:

      ? FillIndefArray()

The following will be printed to the Immediate window:

   Davolio

   Fuller

   Leverling

   Peacock

   Buchanan

   Suyama

   King

   Callahan

   Dodsworth

REFERENCES

==========

Microsoft Access "Introduction to Programming," version 1.0, Chapter 3,

"Access Basic Essentials," and Chapter 4, "Debugging Your Access Basic

Code"

Additional reference words: 1.00 1.10 2.00


INF: How to Create Raised or Sunken Text in Forms and Reports

 Article Number: Q109728

 CREATED: 06-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access has commands to create a raised or sunken effect for text

boxes and labels, but does not have commands to create these effects for

text.

This article describes how to create raised and sunken text on a form or

report.

MORE INFORMATION

This method for creating a raised or sunken effect uses three labels. The

three labels are stacked on one another. Two of the labels are slightly

offset from the other to create the shadow and highlight effects that are

necessary to create a raised or sunken appearance.

How to Create Raised Lettering

------------------------------

The following steps describe how to create lettering with a raised

appearance:

 1. Start Microsoft Access and create a new, blank form.

 2. Change the form's color to light gray. To do this, open the Palette

    by choosing Palette from the View menu. Then, click an empty area

    of the form, and select the light gray box in the Palette's Fill row

    in version 1.x, or the Back Color row in version 2.0.

 3. Create a new label on the form and enter the text "Test" (without

    the quotation marks) in it.

 4. Select the Clear box in the Palette's Fill row in version 1.x, or the

    Back Color row in version 2.0, so that the two other labels (created

    later) can be seen.

 5. Set the label's FontSize property to 28 and its FontName property

    to Times New Roman (this is optional, and can be changed to any

    font size and name you want). Resize the control to fit the text if

    necessary.

 6. Change the label's ControlName property to Main.

 7. Note the Top and Left properties for the label. You will need to

    use these settings later when you create the two other labels.

 8. Select the label and make a copy of it by choosing Duplicate from the

    Edit menu.

 9. Change the duplicate label's ControlName property to Left.

10. Change the new label's Top and Left properties to be .07 greater than

    the Top and Left properties of the Main label. For example, if the Main

    label's Top property is set to .5, set the Left label's Top property

    to .57

11. Change the Left label's text color in version 1.x, or Forecolor in

    version 2.0, to white using the Palette.

12. From the Layout menu in version 1.x, or the Format menu in version 2.0,

    choose Send To Back.

13. Select the Main label, and then choose Duplicate from the Edit menu.

14. Change the new label's ControlName property to Right. Set its Top

    and Left properties to be .01 greater than those of the Main label.

15. Change the Right label's text color in version 1.x, or Forecolor in

    version 2.0, to dark gray using the Palette.

16. From the Layout menu in version 1.x, or the Format menu in version 2.0,

    choose Send To Back.

17. Select the Main label and change its text color (or Forecolor) to light

    gray using the Palette.

18. View the form in Form view.

The text "Test" should appear as raised text.

How to Create Sunken Lettering

------------------------------

To create sunken lettering, follow steps 1-18 above, but reverse the text

colors of the Left and Right labels in steps 11 and 15. Set the Left

label's text color to dark gray in step 11, and set the Right label's text

color to white in step 15.

Note that you can also create a raised or sunken effect for the entire

label by choosing Raised or Sunken from the Palette's Appearance row.

REFERENCES

==========

"Inside Microsoft Access," October 1993, Vol. 1, No. 8., pages 1-4

Additional reference words: 1.00 1.10 2.00 3D 3-D


INF: Sample Function to Reverse a String

 Article Number: Q109729

 CREATED: 06-JAN-1994

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article demonstrates an Access Basic function called ReverseString()

that you can use to reverse the characters in a string, and describes how

to use the ReverseString() function to sort records in a query with the

results of the function.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic," in version 2.0.

MORE INFORMATION

The ReverseString() function will return a string with the characters

reversed from the original argument string. For example, if the string

"ABCD" were passed to the function, the string "DCBA" would be returned.

The following example demonstrates how to create and use the

ReverseString() function:

1. Open the sample database NWIND.MDB.

2. Create a new module with the following code:

      Option Explicit

      Function ReverseString (MyString As String)

          Dim StringReversed As String

          Dim MyStringLength As Integer, X

          MyStringLength = Len(MyString)

          For x = 1 To MyStringLength

            StringReversed = Mid(MyString, x, 1) & StringReversed

          Next x

          ReverseString = StringReversed

      End Function

3. Create the following new query based on the Categories table:

      Query: Query1

      ------------------------------------------

      Field: Category ID

         Show: (selected)

      Field: Expr1: ReverseString([Category ID])

         Sort: Ascending

         Show: (not selected)

      Field: Category Name

         Show: (selected)

4. From the Query menu, choose Run.

The following items will be returned in the query datasheet:

   Category ID     Category Name

   ------------------------------

   COND            Condiments

   PROD            Produce

   SEAF            Seafood

   CONF            Confections

   GRAN            Grains/Cereals

   DAIR            Dairy Products

   BEVR            Beverages

   MEAT            Meat/Poultry

The returned records are sorted in ascending order on the Category ID

field, but the field is sorted from right to left, rather than from left

to right, as usual.

REFERENCES

==========

Microsoft Access "Introduction to Programming," version 1.0, Chapter

3, "Access Basic Essentials," pages 24-26

Microsoft Access "Language Reference," version 1.0, "Len Function,"

pages 277-278

Additional reference words: 1.00 1.10 2.00 sorting reverse backwards


PRB: Network Problems May Cause "Segment Load Failure" Error

 Article Number: Q109730

 CREATED: 06-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You receive a "Segment Load Failure" error message or another memory-

conflict error message.

CAUSE

This type of error can occur if Microsoft Access is running on a network or

is accessing data on a network, and the network server stops functioning

correctly.

A segment load failure implies that there was a problem moving information

from secondary storage, such as a network server disk, to main memory. If a

network server is no longer functioning correctly, expected information may

no longer be available to Microsoft Access.

RESOLUTION

The following suggestions may help you to diagnose the problem:

 - Make a backup of all critical data and run disk diagnostic software,

   such as the MS-DOS CHKDSK command, to check the integrity of the

   workstation and server disk drives.

 - If the workstation has a complete Microsoft Access installation, quit

   and then restart Microsoft Access on the workstation and see if it

   operates correctly without using the network for any services. If the

   problem continues with Microsoft Access operating in isolation, begin

   checking the workstation for memory conflicts.

 - If the database is being accessed off a network server, consider

   copying it to the local workstation to isolate whether the problem

   is workstation or server specific.

 - If the server is required, just start the server and the Microsoft

   Access workstation to test Microsoft Access. If the problem does not

   occur at this point, you can start and diagnose other workstations one

   by one.

REFERENCES

==========

For more information on how to diagnose segment load failures, query on the

following words here in the Microsoft Knowledge Base:

   segment and load and failure and troubleshoot

Additional reference words: 1.00 1.10 2.00


PRB: OnInsert Event Executed by Unbound Controls

 Article Number: Q109732

 CREATED: 06-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

A form's OnInsert event runs when you select an unbound control on it.

CAUSE

The OnInsert event is triggered when a form's dynaset is modified by

any changes to the dynaset. Note that the form must be positioned

on a new record for this behavior to occur.

RESOLUTION

Use other form or control properties to execute the macros you want. Be

aware that the OnInsert property does not check to see whether controls

are bound to the form's record source.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create and save the following new macro called Macro1:

   Macro1      Actions

   ------------------------------

   MsgBox

      Message: OnInsert triggered

      Beep:    Yes

      Type:    None

3. Open the Customers form in Design view.

4. Place an unbound check box on the form.

5. From the Edit menu, choose Select Form. Set the form's OnInsert

   property to Macro1.

6. From the File menu, choose Save As. Save the form as Cust1.

7. Close the form and the macro.

8. Open the Cust1 form in Form view and then choose Data Entry from

   the Records menu.

9. Select the unbound check box.

The message box appears indicating that the form's OnInsert event occurred.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, "OnInsert, OnDelete

Properties," pages 338-339

Additional reference words: 1.00 1.10 oninsert form properties


INF: How to Find the Windows and System Paths

 Article Number: Q109733

 CREATED: 06-JAN-1994

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to use the GetWindowsDirectory() and

GetSystemDirectory() Windows API functions to return the Windows and

Windows System directory paths.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic," in version 2.0.

MORE INFORMATION

The following example demonstrates how to use the GetWindowsDirectory()

and GetSystemDirectory() Windows API functions:

1. Create a new module with the sample code below.

NOTE: You may have some Microsoft Windows API functions defined in an

existing Microsoft Access library; therefore, your declarations may be

duplicates. If you receive a duplicate procedure name error message,

remove or comment out the declarations statement in your code.

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code

in Access Basic.

   '**********************************

   'Declarations section of the module

   '**********************************

   Option Compare Database

   Option Explicit

   Declare Function GetWindowsDirectory% Lib "Kernel" (ByVal lpbuffer _

      As String, ByVal nsize As Integer)

   Declare Function GetSystemDirectory% Lib "Kernel" (ByVal lpbuffer _

      As String, ByVal nsize As Integer)

   'Returns the path to the Windows directory as a string.

   Function GetWinDir () As String

      Dim lpbuffer As String * 144

      Dim Length%

      Length% = GetWindowsDirectory(lpbuffer, Len(lpbuffer))

      GetWinDir = Left(lpbuffer, Length%)

   End Function

   'Returns the path to the Windows System directory as a string.

   Function GetSysDir () As String

      Dim lpbuffer As String * 144

      Dim Length%

      Length% = GetSystemDirectory(lpbuffer, Len(lpbuffer))

      GetSysDir = Left(lpbuffer, Length%)

   End Function

2. From the View menu, choose Immediate Window. Type the following in

   the Immediate window, and then press ENTER:

      ? GetWindDir()

   The Windows directory path will be returned.

3. Type the following in the Immediate window, and then press ENTER:

      ? GetSysDir(0

   The Windows System directory path will be returned.

Additional reference words: 1.00 1.10 2.00 path system windows api ab


INF: Trapping for Library Being Opened Before Database

 Article Number: Q109738

 CREATED: 06-JAN-1994

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

If you try to open a Microsoft Access library without first opening a

database, the following error message is displayed:

   A Run-Time error occurred in Database: <Library Name>.

   You don't have permission to view the Modules in this Database.

This article discusses a technique for handling this situation using error

trapping in Access Basic.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools

provided with Microsoft Access. For more information on Access Basic,

please refer to the "Introduction to Programming" manual.

MORE INFORMATION

You can have a function in your Library determine whether a database is

open by trapping for an error. For example, if a function in the library

tries to open a form without a database first being opened, error number

2046 will be returned with the error message "Command Not Available:

OpenForm."

You can trap this error message and display a more useful error message

using the method demonstrated in the following sample error handler:

   On Error GoTo Errhand

   Errhand:

      'Display error number with error meaning

      MsgBox "Error # - " & Str(Err) & " - " & Error$

      If Err = 2046 Then

         'Display user-customized error message

         MsgBox "Please open a database first"

         Exit Function

      End If

REFERENCES

==========

Microsoft Access "Introduction to Programming," version 1.0, Chapter 6,

"Handling Run-Time Errors," pages 69-78

For more information on libraries, search for "library databases" then

"Customizing MSACCESS.INI Settings" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10


INF: Microsoft Access and Untested Networks

 Article Number: Q109739

 CREATED: 06-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - Microsoft Access Distribution Kit version 1.1

 - Microsoft Access Developer's Toolkit version 2.0

---------------------------------------------------------------------

SUMMARY

This article describes some of the anomalies that can occur when you are

using Microsoft Access with networks that have not been tested with

Microsoft Access. These networks include DEC Pathworks, Sun PC-NFS, IBM

PC-LAN Server, and others.

MORE INFORMATION

Microsoft Access has been tested and verified as supportable on the

following networks: Microsoft LAN Manager, Windows for Workgroups, Novell

NetWare versions 2.x and 3.x, Artisoft Lantastic, and Banyan VINES.

Many other network types (including IBM PC-LAN Server, DEC Pathworks, and

Sun PC-NFS) have experienced erratic behavior and only limited success with

Microsoft Access. Irregular behaviors on these network types can include:

 - An inability to install Microsoft Access to a network drive

 - An inability to run the Workstation Setup after a successful Admin

   Setup

 - An inability to open a multiuser file (non-exclusively)

 - Multiple users cannot update a record correctly

 - Unexplained database corruption or data loss

Some of these behaviors are quite serious. We want to protect our

customers' valuable data, and the best way to do this is to support

Microsoft Access only on networks that we have tested it with. We cannot

support Microsoft Access on non-tested networks.

However, just because we have not tested Microsoft Access with a

particular network does not mean that the network will not work with

Microsoft Windows. Microsoft Windows has been tested with far more

networks than has Microsoft Access. It is a good idea, before purchasing

any product, to check with the product's manufacturer as to the product's

compatibility with your network.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.1, Appendix D

Additional reference words: 1.00 1.10 2.00


INF: How to List Users in a Given Group

 Article Number: Q109740

 CREATED: 06-JAN-1994

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article describes a sample Access Basic function to list

users belonging to a given group in your Microsoft Access system.

Notes

-----

 - The technique described below relies on the use of tables stored with

   your SYSTEM.MDA file. These tables are undocumented and are subject to

   change in future versions of Microsoft Access. Use of the system tables

   is not supported by Microsoft.

 - This article assumes that you are familiar with Access Basic and with

   creating Microsoft Access applications using the programming tools

   provided with Microsoft Access. For more information on Access Basic,

   please refer to the "Introduction to Programming" manual.

MORE INFORMATION

The following example demonstrates how to create and use the sample

function Which_Users() to list the users in a group:

1. Create a new module. Add the following Declarations:

   NOTE: In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

      Option Explicit

      Declare Function GetPrivateProfileString% Lib "Kernel"_

         (ByVal lpApplicationName$, ByVal lpKeyName$, ByVal lpDefault$,_

         ByVal lpReturnedString$, ByVal nSize%, ByVal lpFileName$)

2. Add the following function:

   Function Which_Users ()

      Dim SqlStr$, GroupName$, Message$, SysDB$

      Dim lpReturnedString$, nSize%, GetInfo%

      Dim MyDB As Database, MyDyna As Dynaset

      Dim MySnap As Snapshot

      On Error GoTo Empty

      GroupName$ = InputBox("Please Enter a Group Name", "Group")

      If GroupName$ = "" Then

         MsgBox "You Must Enter a Name", 16, "Error"

         Exit Function

      End If

      lpReturnedString$ = Space$(255)

      nSize% = Len(lpReturnedString$)

      GetInfo% = GetPrivateProfileString("Options", "SystemDB", "", _

         lpReturnedString$, nSize%, "MSACCESS.INI")

      SysDB$ = lpReturnedString$

      Message$ = UCase(GroupName$) & " Has the Following Members:" &_

         Chr(13) & Chr(10)

      Set MyDB = OpenDatabase(SysDB$)

      Set MySnap = MyDB.CreateSnapshot("MSysAccounts")

      SqlStr$ = "[Name]= '" & GroupName$ & "'"

      MySnap.FindFirst SqlStr$

      If MySnap.NoMatch Then

         MsgBox UCase(GroupName$) & " Is Not A Defined Group"

         MySnap.Close

         MyDB.Close

         Exit Function

      Else

         MySnap.Close

      End If

      SqlStr$ = "SELECT MSysAccounts.Name FROM MSysAccounts AS B,_

         MSysGroups, MSysAccounts, "

      SqlStr$ = SqlStr$ & "B INNER JOIN MSysGroups ON B.SID =_

         MSysGroups.GroupSID, "

      SqlStr$ = SqlStr$ & "MSysGroups INNER JOIN MSysAccounts ON_

         MSysGroups.UserSID = MSysAccounts.SID "

      SqlStr$ = SqlStr$ & "WHERE ((B.Name= '" & GroupName$ & "'));"

      Set MyDyna = MyDB.CreateDynaset(SqlStr$)

      If MyDyna.RecordCount = 0 Then

         MsgBox UCase(GroupName$) & " Has No Members"

         MyDyna.Close

         MyDB.Close

         Exit Function

      End If

      MyDyna.MoveFirst

      Do While Not MyDyna.eof

         Message$ = Message$ & Chr(13) & Chr(10) & MyDyna.[Name]

         MyDyna.MoveNext

      Loop

      MsgBox Message$

      MyDyna.Close

      MyDB.Close

      Exit Function

   Empty:

      If Err = 3021 Then

         MsgBox UCase(GroupName$) & " Is not a Valid Group", 16, "Error"

      Else

         MsgBox "An Unexpected Error (#" & Err & ") Occurred:" & _

            Chr(13) & Chr(10) & Error(Err), 16, "Error"

      End If

      Exit Function

      Resume

   End Function

3. From the View menu, choose Immediate Window.

4. Type the following in the Immediate window and press ENTER:

      ?Which_Users()

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 25, "Administering a

Database System," pages 612-614, version 1.1, pages 616-618

For more information on using external functions, search for "declare

external procedure" then "Declare Statement" using the Microsoft Access

Help menu.

Additional reference words: 1.00 1.10


PRB: Incorrect File Destinations Listed in README.TXT

 Article Number: Q109814

 CREATED: 10-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

docerr

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

The "Microsoft Access Files" section of the README.TXT file that ships with

Microsoft Access lists the files that come with Microsoft Access and their

destinations on your hard disk. However, two of the files are listed with

incorrect destinations. The correct destinations for these files is as

follows:

   File Name      Destination Listed in README.TXT   Actual Destination

   --------------------------------------------------------------------

   MSAJU110.DL$   WINDOWS\SYSTEM                     \ACCESS

   CTL3D.DL$      WINDOWS                            \WINDOWS\SYSTEM

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10 docerr


PRB: Queries Sent to Remote SQL Server Run Slowly

 Article Number: Q109815

 CREATED: 10-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

A query sent to a remote SQL Server from Microsoft Access seems to run very

slowly compared to other methods of querying SQL data.

CAUSE

This behavior can be due to either of the following causes:

 - A parameter used in the query is not explicitly defined, causing

   Microsoft Access to send the entire query to SQL Server.

   Microsoft Access automatically takes care of all implicit data type

   conversions internally, whether you are running a query against native

   Microsoft Access tables or attached tables. However, you will find that

   your remote queries run much slower than you expect when you force

   Microsoft Access to interpret query parameter data types, because it

   cannot be certain what implicit type conversions the remote server

   provides. As a result, Microsoft Access will not send the entire query

   to the remote server, but instead will locally process the parts of the

   query having parameters, resulting in slower than expected query

   performance.

 - You are referencing a function or command that is unknown to SQL in your

   query criteria.

   Since SQL Server does not know how to process user-defined Access Basic

   functions and some built-in Access Basic commands and functions, it

   cannot evaluate them. As a result, Microsoft Access must locally

   evaluate them, which can hinder query speed. This applies to all

   functions not known by SQL, such as the Access Basic IIf() function.

   Note that this behavior applies only when a function unknown to SQL is

   used in your query criteria. It does not apply when such a function is

   used in the query's output, except for aggregates such as StDev() that

   have no SQL equivalent.

RESOLUTION

Make sure to explicitly define all the query parameters before running the

query, so that Microsoft Access can send the entire query to the server.

To explicitly define parameters, choose Parameters from the Query menu, and

then enter the names and data types of all the parameters used in the

query. The "Employee Sales by Country (Parameter)" query in the sample

database NWIND.MDB demonstrates this method.

Also make sure to use only functions and commands known to SQL in your

query criteria, or, if possible, provide additional query restrictions to

send to the server. This limits the amount of data returned to Microsoft

Access for local user-defined function evaluation. For example, the

following query will return all records that are not null:

   Like MyFunction(Forms]![Formname]![Fieldname],*)

Since the sample query above contains MyFunction(), a function unknown to

SQL, the query has to be performed locally. Instead, you can get the same

results by using the following query, which uses only functions known to

SQL:

   Like [Fieldname] or [Fieldname] Is Null

Note that "Forms!Formname!Fieldname" is effectively a query parameter, and

should be explicitly declared. It can be declared as:

   Name=Forms!Formname!Fieldname, Type=<yourtype>

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

REFERENCES

==========

Microsoft Access "User's Guide," pages 182-185

Additional reference words: 1.00 1.10 Queries


INF: How to Correctly Back Up Multiuser Databases

 Article Number: Q109816

 CREATED: 10-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

In order to back up a multiuser database correctly, you must make sure that

you have exclusive access to the database. If you back up a database while

others are using it, you risk damaging the backup database.

MORE INFORMATION

You must have exclusive access to a database in order to back it up

correctly. If you back up a database that is being modified by other users,

your backup copy of the database may be damaged or corrupted. When you open

such a backup database in Microsoft Access, you may receive the error

message "database is corrupted." If you repair and compact the database,

you may find that data in the database is truncated.

The only way to ensure the integrity of your backup database is to achieve

a static copy of the database. You must have exclusive access to all the

tables in the database at the same time in order to do so. Once you have

exclusive access to the database, you can copy or export the database, and

then archive the copy or export.

Additional reference words: 1.00 1.10 2.00


PRA: Network Setup (/N) Fails After Network Error

 Article Number: Q109817

 CREATED: 10-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

If your network experiences a problem while you are running the Microsoft

Access network installation (SETUP /N) you will receive an error message in

Microsoft Access Setup. After you choose the Cancel button you will receive

an error message stating that the system was previously set up, even though

the installation was not completed successfully.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10 Setup


INF: Sample Function to Open a Form to a Particular Record

 Article Number: Q109818

 CREATED: 10-JAN-1994

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes a sample Access Basic function you can use to open a

form to a particular record using the InputBox() function.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic," in version 2.0.

MORE INFORMATION

To create the sample function OpenFormWithInput(), enter the following

Declarations and function in a module:

  '==================================

  'Declarations section

  '==================================

  Option Compare Database   'Use database order for string comparisons

  Option Explicit

  '==================================

  'Code section

  '==================================

  Function OpenFormWithInput ()

  Dim Msg, Title, Defvalue, Answer

      Msg = "Enter a Customer ID (ALWAO, BABUJ, EASTC, FOODI, etc.)."

      Title = "OPEN CUSTOMERS FORM"

      Defvalue = "ALWAO"

      Answer = InputBox(Msg, Title, Defvalue)

      If Answer <> "" Then

         DoCmd OpenForm "Customers", , , "[Customer ID]='" & Answer & "' "

  Else

         DoCmd OpenForm "Customers"

      End If

  End Function

The OpenFormWithInput() function will open the form with the record whose

Customer ID matches the value entered in the input box as the only record

in its dynaset. If you change "=" to ">=" in the DoCmd OpenForm line in the

function, the form will open to the record you want and display subsequent

records to the chosen one as well.  For example, if "BABUJ" was the

customer entered in the input box, Customer ID "ALWAO" would not be

available, but "WOLVH" would.

To call the function, attach it to a command button's OnPush property, or

attach it to the form's OnOpen property. Choosing the input box's Cancel

button will cause the form to open at the default record with all of the

records available.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 22, "Using Macros

with Forms," pages 532-534, version 1.1, pages 536-537

Microsoft Access "Language Reference," version 1.0, "Input, Input$

Functions," pages 257-258, "OpenForm Action," pages 348-351

Additional reference words: 1.00 1.10 2.00


PRB: Cannot Save a Blank Record in a Table or Form

 Article Number: Q109819

 CREATED: 10-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You cannot save a blank, new record in a table or form.

CAUSE

Microsoft Access requires some form of data entry in the blank, new record

in order to create a new record.

RESOLUTION

To add a blank record to a table, press SPACE BAR in any field in the

table.

To add a blank record to a form, press SPACE BAR in any field whose

ControlSource property points to a field in the underlying record source. A

SetValue or SendKeys macro action directed at the bound control will also

work.

STATUS

This behavior is by design.

MORE INFORMATION

When you are adding new records, Microsoft Access does not recognize that a

new record is being created until a field in the record has been "dirtied,"

or has received some input from an external source. That external source

can be a keyboard entry (other than the TAB or ENTER keys), or it can be

the result of a SendKeys or SetValue macro action. Note that default values

for fields do not qualify as external input, and have no effect on

triggering a new record in a table or form.

Steps to Reproduce Behavior

---------------------------

Microsoft Access version 2.0:

1. Open, in Design view, the Products table in the sample database

   NWIND.MDB.

2. Change the Product Name field's AllowZeroLength property from No

   to Yes.

3. Save the table and then switch it to Datasheet view.

4. From the Records menu, choose Data Entry. The insertion point will

   be positioned at the first field in a blank record.

5. Tab through all the fields twice. Note that the record indicator does

   not increment, indicating that you are still on the same record, and

   that the record has not been saved.

6. Tab to the Product Name field, and then press SPACE BAR.

7. Tab through the remaining fields until you come back to the Product Name

   field. Note that the record indicator has been updated by one.

Microsoft Access version 1.x:

1. Open, in Datasheet view, the Products table in the sample database

   NWIND.MDB.

2. From the Records menu, choose Data Entry. The insertion point will

   be positioned at the first field in a blank record.

3. Tab through all the fields twice. Note that the record indicator does

   not increment, indicating that you are still on the same record, and

   that the record has not been saved.

4. Tab to the Product Name field, and then press SPACE BAR.

5. Tab through the remaining fields until you come back to the Product Name

   field. Note that the record indicator has been updated by one.

REFERENCES

==========

For more information about adding records, search for "adding records"

using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 dirty


PRB: ReportWizard Truncates Fields

 Article Number: Q109820

 CREATED: 10-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you create a report using a Report Wizard, some of the report's

controls are not large enough to display all the data in the controls. This

causes the data in the controls' source fields to appear truncated when you

print or preview the report. The amount of truncation depends on the type

of printer being used.

RESOLUTION

Increase the size of affected controls so that all the data in the controls

can be displayed, or choose a smaller font size for the report.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create a new table with a text field with a field size of 25.

2. Type "abcdefghijklmnopqrstuvwxy" (without quotation marks) in the

   new table.

3. Use the Report Wizard to create a new report based on the Table1 table.

   Select Single Column and Executive style.

4. Preview the report. Note the truncated field on the report.

Additional reference words: 1.00 1.10 2.00 truncation wizard


INF: How to Print Book Style Page Numbers

 Article Number: Q109821

 CREATED: 10-JAN-1994

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Microsoft Access does not have a built-in format to print page numbers on

a report in "bookstyle" format, where odd page numbers are printed on the

right side of the page and even page numbers are printed on the left side

of the page. This article describes how to print a report with bookstyle

page numbering.

MORE INFORMATION

The following example demonstrates how to set up bookstyle page numbering

for a report:

 1. Open the sample database NWIND.MDB.

 2. Create the following new macro, and then save it as Page Setting:

       Condition                Action

       ---------------------------------

       [PageRight] Mod 2 <> 0   SetValue

        ...                     SetValue

       [PageRight] Mod 2 = 0    SetValue

       ...                      SetValue

       Page Setting Actions

       ----------------------------

       SetValue

          Item: [PageRight].Visible

          Expression: Yes

       SetValue

          Item: [PageLeft].Visible

          Expression: No

       SetValue

          Item: [PageRight].Visible

          Expression: No

       SetValue

          Item: [PageLeft].Visible

          Expression: Yes

 3. Open the List Of Products By Category report in Design view.

 4. Select the Page text box in the report's page footer section.

 5. Change the Page text box's ControlName property from Page to

    PageRight.

 6. From the Edit menu, choose Copy. Then, from the Edit menu, choose

    Paste. A copy of the PageRight text box will appear.

 7. Drag the new text box to the left side of the page footer.

 8. Change the new text box's ControlName property to PageLeft.

 9. Select the page footer section of the report, and change its

    OnFormat property to the macro Page Setting.

10. Save the report and then preview it.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 11, "Using

Expressions in Forms," page 292, version 1.1, page 296

Microsoft Access "User's Guide," version 1.0, Chapter 20, "Using

Expressions in Reports,"  pages 483-484, version 1.1, pages 487-488

Microsoft Access "Language Reference," version 1.0, "Page Property,"

page 364

Additional reference words: 1.00 1.10 page alternate bookstyle


PRB: MoveSize Action Affects Wrong Window

 Article Number: Q109822

 CREATED: 10-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The MoveSize macro action does not move a form opened by an OpenForm

macro action within the same macro if the Window Mode argument is set to

Dialog. Instead, the MoveSize action waits until the form is closed and

then affects the window that is subsequently selected.

RESOLUTION

Setting the Window Mode argument to Dialog makes your form modal and

pop-up. Instead of using the Dialog Window Mode, set your form's Modal and

PopUp properties to Yes, and open the form with a Window Mode argument of

Normal. The MoveSize action correctly moves and sizes forms set in this

manner.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create the following new macro, and then save it as Move Test:

   Move Test      Action

   -----------------------

                  OpenForm

                  MoveSize

   Actions

   --------------------------

   OpenForm

         Form Name: Customers

         View: Form

         Data Mode: Edit

         Window Mode: Dialog

   MoveSize

         Right: 2 in

         Down: 3 in

3. Run the macro. Note that the form opens but does not move.

4. Close the Customers form.

Note that the Database window moves after the Customers form is closed.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, "Modal Property,"

pages 309-310, "MoveSize Action," pages 315-316, and "OpenForm Action,"

pages 348-351

Additional reference words: 1.00 1.10 2.00 macro movesize form


PRB: Index Example Incorrect in Introduction to Programming

 Article Number: Q109823

 CREATED: 10-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

docerr

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Page 113 of the Microsoft Access "Introduction to Programming" manual

describes the Seek method of finding records. There is an example on that

page that includes the line

   Cust.Index = "[Company Name]"

to set the index. This line results in the error message "'[Company Name]'

is not an index in this table."

RESOLUTION

The line that sets the index should not include brackets. The correct line

should read:

   Cust.Index = "Company Name"

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10 docerr


INF: Sample Function to Replace Special Characters

 Article Number: Q109825

 CREATED: 10-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

When you import a text file that contains tabs or other special

characters into Microsoft Access, the special characters are converted

and displayed as boxes. You cannot use the Find and Replace commands to

find these converted characters. This article describes a sample Access

Basic function you can use to find and replace the converted tabs and

other special characters.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

MORE INFORMATION

The following steps can be used to find and replace converted

special characters:

1. Create a new module and add the following code:

      '************************************************************

      'Declarations section of the module

      '************************************************************

      Option Compare Binary

      Option Explicit

      '============================================================

      'The following function will:

      ' - Find the tabs in a text or memo field

      ' - Call another function to replace the tabs

      '============================================================

      Function FindTabs (WhichField As String) as String

         Dim x As Integer, Text As String

         Dim start As Integer

            start = 1

            x = 1

            Text = WhichField

            Do Until x = 0

               x = InStr(start, Text, Chr(9))

               start = x

               If x > 0 And Not IsNull(x) Then

                  Text = ReplaceTabs(x, Text)

               End If

            Loop

            FindTabs = Text

      End Function

      '==================================================================

      'The following function is called from the FindTabs() function. It

      'accepts two arguments, text and start. The function replaces tabs

      'with %. It returns the updated text.

      '==================================================================

      Function ReplaceTabs(start As Integer, text As String) As String

         Mid(text, start, 1) = "%"

         ReplaceTabs = text

      End Function

2. Create a query based on the table to which the text file was imported.

3. Add the field containing the special characters to the QBE grid.

4. Convert the query to an update query by choosing Update from the Query

   menu.

5. Add the following to the Update To line for the field(s) containing the

   special characters:

      FindTabs([fieldname])

6. Run the query.

REFERENCES

==========

For more information about special characters, search for "ANSI Character"

using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 find/replace recognize


INF: How to Call the Windows Help Search Dialog Box

 Article Number: Q109826

 CREATED: 10-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to call the Windows Help Search dialog box

from within your Microsoft Access application using the WinHelp() and

FindWindow() Windows API function calls.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools

provided with Microsoft Access.

MORE INFORMATION

The following example demonstrates how to activate the Search dialog box

with a sample Access Basic function called OpenHelpSearch(). This example

uses the Microsoft Access Help file:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code

in Access Basic.

1. Enter the following in a new module's Declarations section:

      Option Explicit

      Global Const HELP_PARTIALKEY = &H105

      Declare Function WinHelp Lib "User" (ByVal hWnd As _

         Integer, ByVal lpHelpFile As String, ByVal _

         wCommand As Integer, ByVal dwData As Any) As Integer

      Declare Function HC_FindWindow% Lib "user" Alias "FindWindow" _

         (ByVal lpClassName As Any, ByVal lpCaption As Any)

2. Create two procedures by entering the following code in the module:

      Function OpenHelpSearch ()

         Dim DummyVal$, Temp%

         DummyVal$ = ""

         Temp% = WinHelp(GetAccessHandle(),_

            "c:\Access\msaccess.hlp",_

            HELP_PARTIALKEY, DummyVal$)

      End Function

      Function GetAccessHandle ()

         GetAccessHandle = HC_FindWindow("Omain", 0&)

      End Function

3. Save the module as Search Help.

4. From the Run menu, choose Compile All.

5. Type the following in the module's Immediate window, and then press

   ENTER:

      ? OpenHelpSearch()

When you call the OpenHelpSearch() function, the Windows API WinHelp()

function is called. The OpenHelpSearch() function passes the current

Microsoft Access handle, the name of the Help file, the command

HELP_PARTIALKEY and a null string to the WinHelp() function. You are then

prompted for a topic to search for. Note that you can call the

OpenHelpSearch() function from any command button.

REFERENCES

==========

"Programming Windows: The Microsoft Guide to Writing Applications

for Windows 3," Charles Petzold, Microsoft Press, 1990

"Programmer's Reference Library: Microsoft Windows 3.1 Guide to

Programming Reference," Volumes 1-6, Microsoft Press, 1992

Additional reference words: 1.00 1.10 2.00


PRB: List Box Column Property Gets Incorrect Row Information

 Article Number: Q109827

 CREATED: 10-JAN-1994

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you select a row from a multicolumn list box or combo box, controls

that reference the Column property of the list box or combo box retrieve

data from a different row in the list box or combo box.

CAUSE

The list or combo box's BoundColumn property does not point to a field

with unique values.

RESOLUTION

The list or combo box's BoundColumn property must point to a field that

contains unique values. If the BoundColumn property does not point to a

field with unique values, Microsoft Access will return information for

the first row with a matching BoundColumn value when you select a row in

the list box or combo box.

For example, the Type field in the sample table below does not contain

unique values. If the Type field is used for the BoundColumn property, a

text box referencing the second column will return Apple rather than

Grape when you select the third row.

   Type    Description

   -------------------

   Fruit   Apple

   Fruit   Orange

   Fruit   Grape

If you use the Description column for the BoundColumn property, the

problem will not occur, since the Description column contains unique

vaues.

Another way to resolve this problem would be to add a counter field to

the underlying table, and then use the counter field for the BoundColumn

property.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Create the following table:

      Table: Table1

      --------------------------

      FieldName: Manufacturer

         DataType: Text

      FieldName: Stock Number

         DataType: Number

         FieldSize: Long Integer

         Indexed: Yes

      FieldName: Description

         DateType: Text

      Table Properties: Table1

      ------------------------

      PrimaryKey: Stock Number

2. View the table in Datasheet view. Add the following data to the

   table:

      Manufacturer   Stock Number   Description

      -----------------------------------------

      IB Co          1              Mouse

      IB Co          2              Printer

      IB Co          3              Hard Drive

      ComCo          4              PC

3. Create the following new, unbound form:

      Form: Test1

         ControlSource: <leave empty>

      List box: Manufacturer

         RowSourceType: Table/Query

         RowSource: Table1

         ColumnCount: 3

         BoundColumn: 1

         Width: 3

      Text box: Stock Number

         ControlSource: =[Manufacturer].Column(1)

      Text box: Description

         ControlSource: =[Manufacturer].Column(2)

4. View the form in Form view.

5. Select the first row in the list box. Note that the Stock Number

   and Description boxes correctly display "1" and "Mouse."

6. Select the third row in the list box. Note that the Stock Number and

   Description boxes still display the information from the first row.

7. Select the fourth row in the list box. The Stock Number and

   Description boxes will display the correct information for the

   fourth row.

If you change the BoundColumn property of the Manufacturer list box to 2

instead of 1, the text boxes on the form will display the correct

information for all the rows in the list box, since the second column

contains unique values.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 9, "Designing

Forms," pages 233-245

Microsoft Access "User's Guide," version 1.1, Chapter 9, "Designing

Forms," pages 237-249

Additional reference words: 1.00 1.10


INF: Using PrtDevMode Property to Set Print Setup Dialog Box

 Article Number: Q109828

 CREATED: 10-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

This article describes the PrtDevMode property. While this property is

documented in the Microsoft Access Distribution Kit (ADK) documentation,

the information applies to the retail product as well.

MORE INFORMATION

The PrtDevMode property sets or returns the device mode information

specified in the Print Setup dialog box for a datasheet, form, report, or

module.

The PrtDevMode property setting is a 64-byte structure that mirrors the

DEVMODE structure defined in the Microsoft Windows Software Development Kit

(SDK). The PrtDevMode property has the following members:

 - DeviceName: A 32-character string that specifies the name of the device

   the driver supports--for example, "HP LaserJet IIISi" in the case of the

   Hewlett-Packard LaserJet IIISi. Each driver has a unique string.

 - SpecVersion: An integer that specifies the version number of the DEVMODE

   structure in the SDK. For Microsoft Windows version 3.1, this value

   should be 0x30A.

 - DriverVersion: An integer that specifies the printer driver version

   number assigned by the printer driver developer.

 - Size: An integer that specifies the size, in bytes, of the DEVMODE

   structure. (This value does not include the optional dmDriverData member

   for device-specific data, which can follow this structure.) If an

   application manipulates only the driver-independent portion of the data,

   you can use this member to find out the length of this structure without

   having to account for different versions.

 - DriverExtra: An integer that specifies the size, in bytes, of the

   optional dmDriverData member for device-specific data, which can follow

   this structure. If an application does not use device-specific

   information, you should set this member to 0.

 - Fields: A Long value that specifies which of the remaining members in

   the DEVMODE structure have been initialized. It can be any combination

   (or it can be none) of the following values:

      Constant         Value

      --------------------------

      DM_ORIENTATION   &H0000001

      DM_PAPERSIZE     &H0000002

      DM_PAPERLENGTH   &H0000004

      DM_PAPERWIDTH    &H0000008

      DM_SCALE         &H0000010

      DM_COPIES        &H0000100

      DM_DEFAULTSOURCE &H0000200

      DM_PRINTQUALITY  &H0000400

      DM_COLOR         &H0000800

      DM_DUPLEX        &H0001000

      DM_YRESOLUTION   &H0002000

      DM_TTOPTION      &H0004000

   A printer driver supports only those members that are appropriate for

   the printer technology.

 - Orientation: An integer that specifies the orientation of the paper. It

   can be either 1 (portrait) or 2 (landscape).

 - PaperSize: An integer that specifies the size of the paper to print on.

   You can set this member to 0 if the length and width of the paper are

   specified by the PaperLength and PaperWidth members, respectively.

   Otherwise, the PaperSize member can be set to one of the following

   predefined values:

      Value   Meaning

      -------------------------------------------

      1       Letter (8.5 x 11 in.)

      2       Letter Small (8.5 x 11 in.)

      3       Tabloid (11 x 17 in.)

      4       Ledger (17 x 11 in.)

      5       Legal (8.5 x 14 in.)

      6       Statement (5.5 x 8.5 in.)

      7       Executive (7.25 x 10.5 in.)

      8       A3 (297 x 420 mm)

      9       A4 (210 x 297 mm)

      10      A4 Small (210 x 297 mm)

      11      A5 (148 x 210 mm)

      12      B4 (250 x 354)

      13      B5 (182 x 257 mm)

      14      Folio (8.5 x 13 in.)

      15      Quarto (215 x 275 mm)

      16      11 x 17 in.

      18      Note (8.5 x 11 in.)

      19      Envelope #9 (3.875 x 8.875 in.)

      20      Envelope #10 (4.125 x 9.5 in.)

      21      Envelope #11 (4.5 x 10.375 in.)

      22      Envelope #12 (4.25 x 11 in.)

      23      Envelope #14 (5 x 11.5 in.)

      24      C size sheet (17 x 22 in.)

      25      D size sheet (22 x 34 in.)

      26      E size sheet (34 x 44 in.)

      27      Envelope DL (110 x 220 mm)

      28      Envelope C5 (162 x 229 mm)

      29      Envelope C3 (324 x 458 mm)

      30      Envelope C4 (229 x 324 mm)

      31      Envelope C6 (114 x 162 mm)

      32      Envelope C65 (114 x 229 mm)

      33      Envelope B4 (250 x 353 mm)

      34      Envelope B5 (176 x 250 mm

      35      Envelope B6 (176 x 125 mm)

      36      Envelope (110 x 230 mm)

      37      Envelope Monarch (3.875 x 7.5 in.)

      38      6-3/4 Envelope (3.625 x 6.5 in.)

      39      US Std Fanfold (14.875 x 11 in.)

      40      German Std Fanfold (8.5 x 12 in.)

      41      German Legal Fanfold (8.5 x 13 in.)

      256     User-defined

 - PaperLength: An integer that specifies the paper length in tenths of a

   millimeter. This member overrides the paper length specified by the

   PaperSize member, either for custom paper sizes or for devices such as

   dot-matrix printers that can print on a variety of paper sizes.

 - PaperWidth: An integer that specifies the paper width in tenths of a

   millimeter. This member overrides the paper width specified by the

   PaperSize member.

 - Scale: An integer that specifies the factor by which the printed output

   is to be scaled. The apparent page size is scaled from the physical page

   size by a factor of Scale/100. For example, a letter-size paper with a

   Scale value of 50 would contain as much data as a page measuring 17 by

   22 inches because the output text and graphics would be half their

   original height and width.

 - Copies: An integer that specifies the number of copies printed if the

   printing device supports multiple-page copies.

 - DefaultSource: An integer that specifies the default bin from which the

   paper is fed. This member can be one of the following values:

      Value   Meaning

      ---------------------------------------

      1       Upper or only one bin

      2       Lower bin

      3       Middle bin

      4       Manual bin

      5       Envelope bin

      6       Envelope manual bin

      7       Automatic bin

      8       Tractor bin

      9       Small-format bin

      10      Large-format bin

      11      Large-capacity bin

      14      Cassette bin

      256     Device-specific bins start here

 - PrintQuality: The printer resolution. Following are the four predefined

   device-independent values:

      Value   Meaning

      -------------------------

      -4      High resolution

      -3      Medium resolution

      -2      Low resolution

      -1      Draft resolution

 - Color: An integer that defines whether a color printer is to render

   color or monochrome output. Possible values are:

      Value   Meaning

      ------------------

      1       Color

      2       Monochrome

 - Duplex: An integer. For a printer capable of duplex printing, specifies

   whether the output is printed on both sides of the paper. This member

   can be set to one of the following values:

      Value   Meaning

      ------------------

      1       Simplex

      2       Horizontal

      3       Vertical

Only drivers that are fully updated for Windows version 3.0 and later and

that export the ExtDeviceMode function use the DEVMODE structure. An

application can retrieve the paper sizes and names supported by a printer

by calling the DeviceCapabilities() function with the DC_PAPERS,

DC_PAPERSIZE, and DC_PAPERNAMES values.

Drivers can add device-specific data immediately following the DEVMODE

structure.

The following example demonstrates how to use the PrtDevMode property to

specify the number of copies to print for a report:

   Function SetCopies (MyReport As String, Copies As Integer)

      Dim dm As zwtDevModeStr

      Dim DevMode As zwtDeviceMode

        DoCmd Echo False

      DoCmd OpenReport MyReport, A_DESIGN

      If Not IsNull(Reports(MyReport).PrtDevMode) Then

         dm.rgb = Reports(MyReport).PrtDevMode

         LSet DevMode = dm

         DevMode.dmCopies = Copies

         LSet dm = DevMode

         Reports(MyReport).PrtDevMode = dm.rgb

         DoCmd SetWarnings False

         DoCmd DoMenuItem 7, A_FILE, 2

         DoCmd Close A_REPORT, MyReport

         DoCmd SetWarnings True

      End If

      DoCmd Echo True

   End Function

The next example demonstrates how to set the paper size for a report:

   Sub SetPaperSize (MyReport As String, MyPaperSize As Integer)

      Dim dm As zwtDevModeStr

      Dim DevMode As zwtDeviceMode

           DoCmd Echo False

      DoCmd OpenReport MyReport, A_DESIGN

      If Not IsNull(Reports(MyReport).PrtDevMode) Then

         dm.rgb = Reports(MyReport).PrtDevMode

         LSet DevMode = dm

         DevMode.dmPaperSize = MyPaperSize

         LSet dm = DevMode

         Reports(MyReport).PrtDevMode = dm.rgb

         DoCmd SetWarnings False

         DoCmd DoMenuItem 7, A_FILE, 2

         DoCmd Close A_REPORT, MyReport

         DoCmd SetWarnings True

      End If

           DoCmd Echo True

   End Sub

REFERENCES

==========

Microsoft Access "The Secrets of AccessWizards," pages 21-26 (NOTE: This

manual is available from Customer Service at 1 (800) 426-9400. It is part

number 077-050-039, and costs $9.95.)

Additional reference words: 1.00 1.10 PtrIss

2.0,


INF: Sample Function to Provide Password for Attached Tables

 Article Number: Q109829

 CREATED: 10-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.1 and 2.0

---------------------------------------------------------------------

SUMMARY

When you first attach an external table you have the option to store the

User ID and password for the table locally. If you do not store the ID and

password locally you will be prompted later for the ID and password when

the table is opened (either manually or programmatically).

This article describes a sample function you can use in Microsoft Access

versions 1.1 and 2.0 to eliminate the login prompt when the table is

opened.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic" in version 2.0.

MORE INFORMATION

The following steps demonstrate how to eliminate the login prompt when you

open an attached table:

1. You must first provide your login information. To do this, use one of

   the four standard ODBC dialog boxes, or create your own custom login

   box.

2. Use the sample function below (or one similar to it) to establish

   the connection.

   NOTE: In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

      Function Establish_Connection ()

         Dim db As Database, Dim dbcurr As Database, Dim ds As Dynaset

         Set dbcurr = CurrentDB()

         Set db = OpenDatabase("", False, False,"ODBC;DSN=_

          <servername>;UID=<UserID>;PWD=<Password>;DATABASE=_

          <database name>;")

         Set ds = db.CreateDynaset("<any table existing in the _

          database defined by DATABASE above>")

      End Function

   Substitute your own server name, password, database name, and table name

   in the function above.

When this function is run Microsoft Access will establish a connection with

the server specified in the function. The Connection Manager will then

store the connection information, enabling you to open other attached

tables on that server without being prompted for the login information each

time. The Connection Manager will retain the login information until you

quit Microsoft Access.

Additional reference words: 1.00 1.10 2.00 Attaching


INF: Sample Function to Find File Associations

 Article Number: Q109931

 CREATED: 10-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article demonstrates a sample Access Basic function that you can use

to obtain the executable filename associated with a document filename by

calling the Microsoft Windows API function FindExecutable().

MORE INFORMATION

The following sample function requires a path string parameter and a

filename string parameter. The function returns the path of the associated

file.

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   ' *** Declaration Section ***

   Option Explicit

   Declare Function FindExecutable% Lib "Shell" (ByVal lpszFile$, _

      ByVal lpszDir$, ByVal lpszResult$)

   Function GetAssociation (Path As String, FileName As String)

      Dim Result As String, X As Integer

      Result = Space$(256)

      X = FindExecutable(FileName, Path, Result)

      GetAssociation = Result

   End Function

To find the path and name of the executable file associated with a file

called MYDB.MDB that is located in the root directory on the D drive you

could type the following in an Immediate window:

   ? GetAssociation ("D:\", "MYDB.MDB")

The function would return

   D:\ACCESS.100\MSACCESS.EXE

if the MYDB.MDB file was associated with the MSACCESS.EXE executable file

located in the ACCESS.100 directory on the D drive.

REFERENCES

==========

Microsoft Windows Software Development Kit "Programmer's Reference,

Volume 2: Functions," Version 3.1, pages 303-305

Additional reference words: 1.00 1.10 2.00


PRB: Cannot Make Small Adjustments to Width with EGA Driver

 Article Number: Q109932

 CREATED: 10-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you are using an EGA video driver, you cannot make small adjustments

to the width of a form or report in Design view by dragging the object's

right border. When you try to do so, the object's width will change by a

large amount. If you try to decrease the width of an object that is 18

inches wide by dragging the right border, the border will snap to the

nearest control.

RESOLUTION

Change the object's width by modifying its Width property in the property

sheet, instead of by dragging its border.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

NOTE: You must have an EGA video driver installed in the Microsoft Windows

Control Panel to reproduce this problem.

1. Open the sample database NWIND.MDB.

2. Open the Add Products form in Design view.

3. Try to increase the form width to 5 inches by dragging the right

   border. The form's width will increase several inches beyond the 5 inch

   setting.

4. Drag the right border to increase the form's width to 18 inches.

5. Drag the right border back to 17 inches. The form width will return to

   the nearest control (approximately 4.25 inches).

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 187-212

Microsoft Access "User's Guide," version 1.1, pages 191-216

Additional reference words: 1.00 1.10 resize


PRB: ReportWizard or FormWizard List Box Empty in ADK
PRB: ReportWizard or FormWizard List Box Empty in ADK [B_WAccADK]

 Article Number: Q109933

 CREATED: 10-JAN-1994

 MODIFIED: 25-MAR-1994

 VERSION(S): 1.10

------------------------------------------------------------

---------

The information in this article applies to:

 - Microsoft Access version 1.1

 - Microsoft Access Distribution Kit version 1.1

------------------------------------------------------------

---------

SYMPTOMS

The list box to select a ReportWizard or FormWizard is empty

when you are

running a Microsoft Access Development Kit (ADK) database

application.

CAUSE

The list box to select a ReportWizard or FormWizard is

filled by a

subprocedure in the WIZARD.MDA file that references the

MSACCESS.INI file

instead of the application's custom .INI file. Computers

that do not have a

full retail version of Microsoft Access installed do not

have an

MSACCESS.INI file.

RESOLUTION

There are two ways to resolve this problem:

 - Distribute a file named MSACCESS.INI with your custom

application. This

   file must be located in the Windows directory, and must

contain a [Form

   Wizards] and a [Report Wizards] section as follows:

      [Form Wizards]

      Single-Column=zwInitWizard, 1

      Tabular=zwInitWizard, 2

      Graph=zwInitWizard, 6

      Main/Subform=zwInitWizard, 7

      [Report Wizards]

      Single-Column=zwInitWizard, 3

      Groups/Totals=zwInitWizard, 4

      Mailing Label=zwInitWizard, 5

 - Change the GetWizards subprocedure in the WIZARD.MDA

library to point to

   your application's custom .INI file.

   You must unload the WIZARD.MDA database before you can

edit it. To do

   this, Quit Microsoft Access, and edit the [Libraries]

section of the

   MSACCESS.INI file. Comment out the Wizard entry in the

file, and then

   save and close the file. Restart Microsoft Access and

open the

   WIZARD.MDA database. Locate the GetWizards subprocedure

and then modify

   it to be as follows:

   NOTE: This article assumes that you are familiar with

Access Basic and

   with creating Microsoft Access applications using the

programming tools

   provided with Microsoft Access. For more information on

Access Basic,

   please refer to the "Introduction to Programming" manual.

   NOTE: In the following sample code, an underscore (_) is

used as a line-

   continuation character. Remove the underscore when re-

creating this code

   in Access Basic.

      Private Sub GetWizards (szWizSect As String, _

         cWizards As Integer, rgszWizards() As String, _

         rgszLpfn() As String, rgszArg() As String)

         Const szIni = "MyApp.INI"

   After making these changes Quit Microsoft Access, and

edit the

   [Libraries] section of the MSACCESS.INI file. Remove the

semicolon from

   the beginning of the Wizard entry and then save and close

the file.

More Information

================

Steps to Reproduce Behavior

---------------------------

1. Rename the MSACCESS.INI file to MSACCESS.BAK.

2. Create the following new macro:

      Macro Name          Actions

      ------------------------------

      Macro1              SendKeys

                          DoMenuItem

      Macro1 Actions

      ---------------------------

      SendKeys

         Keystrokes: Suppliers %w

         Wait: No

      DoMenuItem

         Menu Bar: Database

         Menu Name: File

         Command: New

         Subcommand: Report

3. Add a command button to a form to run Macro1.

4. Run your application in the ADK environment.

5. Run the macro. The ReportWizard will start, but the list

box will

   be empty.

REFERENCES

==========

For more information on how to work with Microsoft Access

libraries, query

on the following words here in the Microsoft Knowledge Base:

   create and debug and library

Microsoft Access "Introduction to Programming," version 1.1,

Chapter 1-5

Microsoft Access "The Secrets of AccessWizards," version

1.1, Chapter 1

Additional reference words: 1.10


INF: Table Permissions Changes Not Effective with Open Form

 Article Number: Q109934

 CREATED: 10-JAN-1994

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Removing Read Data permissions on a table does not take effect while a form

based on that table is open in Design view.

No error or warning message is issued while the Permissions dialog box

is being used. The open form will still display data. However the

permission assignment change will not become effective until after the

form is closed.

MORE INFORMATION

Microsoft Access maintains an open connection to the table(s) the form

is based on while it is in Design view.

The purpose of this is so Microsoft Access does not have to reopen the

tables when the form is re-run to optimize performance.

Make sure that reports, forms and queries which use the table being

modified are closed before removing Read Data permissions.

Steps to Reproduce Behavior

---------------------------

 1. Log in as Admin and open the sample database NWIND.MDB as shared.

 2. Add User1 to the Users Group

 3. Make sure that the Users Group has Read Data Permissions

    on the Customers table.

 4. Minimize NWIND.

 5. Open a second instance Microsoft Access and log in as User1.

 6. Create a form bound to the Customers table.

 7. Open the form in Datasheet view, and view the data.

 8. Return to design view of the form.

 9. Minimize this second instance of Microsoft Access

10. Reopen the first instance of Microsoft Access.

11. Revoke the Users Group Read Data permissions for the Customers

    table.

12. Reopen the second instance. Switch to the Datasheet view

    of the form.

Result: Data is displayed even though Read Data permissions for the

underlying table were taken away from User1. If you close the form you

will not be able to reopen it, because the Read Data permissions

revocation will have taken effect.

REFERENCES

==========

Microsoft Access "User's Guide," version 2.0, Chapter 25, "Administering a

Database System," pages 614-627

Additional reference words: 1.00 1.10 2.00 rights


PRA: Print Quality Always Defaults to Highest Mode

 Article Number: Q109935

 CREATED: 10-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

Microsoft Access ignores the print quality set in the Windows Control

Panel and instead defaults to the highest quality print mode available.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Run the Printers utility in the Windows Control Panel.

2. Select a printer, then choose Setup.

3. Choose a printing resolution in the Resolution box that is less than

   the highest available resolution.

4. Start Microsoft Access and open any database.

5. From the File menu, choose Print.

Note that the print quality is set to High.

Additional reference words: 1.00 1.10 PtrIss


INF: No Form Caption in Run-Time Application

 Article Number: Q109937

 CREATED: 10-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access Distribution Kit version 1.1

---------------------------------------------------------------------

SUMMARY

If you build an application to be distributed, make sure to include the

TitleBar statement in the [Run-Time Options] section of your application's

.INI file. If you do not, the title bar in your application will not

display a caption. Additionally, no caption will be displayed when a

table, query, form, or report is maximized.

MORE INFORMATION

The following example demonstrates how to correctly modify the

[Run-Time Options] section of your application's .INI file:

1. Use a text editor such as Notepad to modify the [Run-Time Options]

   section of your application's .INI file to match the following:

      [Run-Time Options]

      TitleBar=This Is My Application

2. Run your application.  Note that the application title bar

   displays the caption:

      This Is My Application

3. Maximize an object such as a table, query, form, or report. Note that

   the application title bar displays the caption:

      This Is My Application - [xxxxxx]

4. Close your application.

5. Modify the [Run-Time Options] section of your application's .INI

   file to match the following:

      [Run-Time Options]

      ;TitleBar=This Is My Application

   The semicolon comments out the line so it is ignored.

6. Run your application again.  Note that the application's title bar is

   empty.

REFERENCES

==========

Microsoft Access "Distribution Kit Guide," version 1.1, "Custom

Initialization (.INI) File," pages 5-7

Additional reference words: 1.10 adk runtime title caption


INF: Sample Function to Insert CR/LF in Fixed-Width Files

 Article Number: Q109938

 CREATED: 10-JAN-1994

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Fixed-width text files imported into Microsoft Access must have a

carriage return/line feed character at the end of each line. This article

describes a sample Access Basic function to add carriage return/line feed

characters to the end of each line in a file.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools

provided with Microsoft Access. For more information on Access Basic,

please refer to the "Introduction to Programming" manual.

MORE INFORMATION

The following sample function will add a carriage return/line feed

character to the end of each line in a file that does not have one. This

function can process files with records larger than 255 bytes.

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code

in Access Basic.

   Option Explicit

   Function AddCRLF (InFile As String, OutFile As String, _

      RecLen As Integer)

      Dim InFileNo As Integer, OutFileNo As Integer, Rec As String

      ' Get an open file handle and open the input file.

      InFileNo = FreeFile

      Open InFile For Input As #InFileNo

      ' Get an open file handle and open the output file.

      OutFileNo = FreeFile

      Open OutFile For Output As #OutFileNo

      ' Process the file.

      Do While Not EOF(InFileNo)

         ' Read one fixed-width record, RecLen in size.

         Rec = Input$(RecLen, InFileNo)

         ' Output the record to the output file.

         ' NOTE: Print automatically places a carriage return/line feed

         ' character at the end of the line.

         Print #OutFileNo, Rec

      Loop

      ' Close the files.

      Close #InFileNo

      Close #OutFileNo

   End Function

To add carriage return/line feed characters to a file in the Microsoft

Access directory called X300.TXT that has 30-byte records, type the

following in the Immediate window:

   ? AddCRLF("C:\ACCESS\X300.TXT", "C:\ACCESS\X300CRLF.TXT", 30)

Note that the output file will be called X300CRLF.TXT.

Additional reference words: 1.00 1.10 Import Fixed Width FreeFile


INF: Creating a Crosstab Query with Multiple Value Fields

 Article Number: Q109939

 CREATED: 10-JAN-1994

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

In a Microsoft Access crosstab query, you can specify only one field

or calculation as the value. Often it is desirable to show more than

one value in the query.

For example, the following shows two columns of information per

company, a count of the number of orders, and the order totals for each

year:

Company Name  1989 Orders  1989 Total  1990 Orders  1990 Total

--------------------------------------------------------------

ABC Company   12           $855.00     15           $1010.25

XYZ Company   1017         $22045.57   1050         $25345.29

This type of query is sometimes called a Multiple Value Field query.

MORE INFORMATION

In order to create a Multiple Value Fields crosstab query, you must

create two separate crosstab queries with fixed column headings for each

value you want to calculate. These two queries can then be joined

together using a Select query to display the desired results.

The following example uses the sample database NWIND.MDB to create a query

that displays results similar to the example above, showing the

number of sales, and total, for each year for each company.

Step One: Create the "Order Total" Crosstab Query

-------------------------------------------------

1. Open the sample database NWIND.MDB and create the following Crosstab

   query based on the Orders, Order Details, and the Customers tables.

   Query: Order Total

   ------------------

   Type: Crosstab Query

   Join: Customers.[Customer ID] <-> Orders.[Customer ID]

   Join: Orders.[Order ID] <-> Order Details.[Order ID]

   Field:  Company Name

      Table Name: Customers

      Total: Group By

      Crosstab: Row Heading

   Field: Expr1: Year([Order Date]) & " " & "Order Total"

      Table Name:

      Total: Group By

      Crosstab: Column Heading

   Field: Expr2: Sum(CCur([Unit Price]*[Quantity]*(1.-[Discount])))

      Table Name:

      Total: Expression

      Crosstab: Value

2. Choose Query Properties from the View menu, select the Fixed Column

   Headings check box and type the following entries in the Fixed Column

   Headings box:

   "1989 Order Total";"1990 Order Total";"1991 Order Total";"1992 Order

   Total"

   NOTE: In Microsoft Access version 2.0, the Fixed Column Headings

   property is called Property Headings.

Step Two: Create the "Order Count" Crosstab Query

-------------------------------------------------

1. Create the following Crosstab query based on the Orders and the

   Customers tables:

   Query: Order Count

   ------------------

   Type: Crosstab Query

   Join: Customers.[Customer ID] <-> Orders.[Customer ID]

   Field: Company Name

      Table Name: Customers

      Total:      Group By

      Crosstab:   Row Heading

   Field:  Year([Order Date]) & " " & "Order Count"

      Table Name:

      Total:      Group By

      Crosstab:   Column Heading

   Field:  Order ID

      Table Name: Orders

      Total:      Count

      Crosstab:   Value

2. Choose Query Properties from the View menu, select the Fixed Column

   Headings check box and type the following entries in the Fixed Column

   Headings box:

   "1989 Order Count";"1990 Order Count";"1991 Order Count";"1992 Order

   Count"

Step Three: Create the "Multiple Values" Query

----------------------------------------------

1. Create the following Select query based on the Order Totals and

   Order Count Crosstab Queries:

   Query: Multiple Values

   ----------------------

   Join: Order Total.[Company Name] <-> Order Count.[Company Name]

   Field:  Company Name

      Table Name: Order Count

      Show: Yes

   Field: 1989 Order Count

      Table Name: Order Count

      Show: Yes

   Field: 1989 Order Total

      Table Name: Order Total

      Show: Yes

   Field: 1990 Order Count

      Table Name: Order Count

      Show: Yes

   Field: 1990 Order Total

      Table Name: Order Total

      Show: Yes

Running the Multiple Values query will result in a table that looks

like the following:

Company Name  1989 Order Count 1989 Order Total 1990 Order Count ...

--------------------------------------------------------------------

Always Open   1                $855.38          4

Andre's       0                0                3

Anthony's     4                $3,364.71        6

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 6, "Designing

Select Queries," pages 150-155

Microsoft Access "User's Guide," version 1.1, Chapter 6, "Designing

Select Queries," pages 154-159

Additional reference words: 1.00 1.10 2.00 crosstab query select


PRB: Starting Analyzer Returns "Unknown Function Name"

 Article Number: Q109940

 CREATED: 10-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTONS

========

When you start the Database Analyzer in Microsoft Access version 1.x, you

receive the error message "Unknown Function Name."

CAUSE

The line specifying the Database Analyzer library is missing or incorrect

in the [Libraries] section of your MSACCESS.INI file. Some of the most

common errors that cause this problem include:

 - You have multiple MSACCESS.INI files on your drive.

 - The Analyzer library line is missing from the [Libraries] section

   of the MSACCESS.INI file.

 - The equal sign (=) is missing from the Analyzer library line in

   the [Libraries] section of the MSACCESS.INI file.

RESOLUTION

There should be only one MSACCESS.INI file on your hard disk. It should

be in your Windows directory. To check for multiple MSACCESS.INI files,

follow these steps:

1. Start File Manager.

2. From the File menu, choose Search.

3. In the Search For box, type "MSACCESS.INI" (without quotation marks).

4. In the Start From box, type the letter of the drive that contains

   your Windows directory. For example, if your Windows directory is

   on drive C, type "C:\" (without quotation marks) in the Start From box.

5. Make sure the Search All Subdirectories checkbox is selected.

6. Choose OK.

A Search Results box will be displayed, showing the locations of all the

MSACCESS.INI files on the drive you specified. Make sure there is only

one copy of the file and that it is in your Windows directory. If there

are other copies of the file, rename them or remove them.

Once you have verified that you only have one MSACCESS.INI file, and that

it is in the Windows directory, follow the steps below to check that the

Analyzer library line in the MSACCESS.INI file is correct:

1. Open the MSACCESS.INI file in any text editor (such as Windows

   Notepad).

2. Locate the [Libraries] section of the file.

3. Modify the [Libraries] section so that it reads as follows:

   [Libraries]

   analyzer.mda=

   wizard.mda=ro

Note that your [Libraries] section may have other lines than those shown

here. The generic [Libraries] section here is for illustration purposes

only. Also note the equal sign (=) at the end of the line. It is

required; do not leave it off or remove it.

If your ANALYZER.MDA file is on a network drive, or in some directory on

your local drive other than the ACCESS directory, make sure to include

the full path to the ANALYZER.MDA file in the [Libraries] section. The

sample [Libraries] section below demonstrates the appropriate Analyzer

library line for an ANALYZER.MDA file located in the MDA directory on

network drive F:

   [Libraries]

   F:\MDA\analyzer.mda=

   F:\MDA\wizard.mda=ro

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

REFERENCES

==========

For more information, refer to the PSSKB.TXT file in Microsoft Access

version 1.0, or the file ANALYZER.TXT in Microsoft Access version 1.1.

This file is located in your ACCESS directory.

Additional reference words: 1.00 1.10 analyzer libraries


INF: Sample Function to Build a Repeating String

 Article Number: Q109941

 CREATED: 10-JAN-1994

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article demonstrates a sample Access Basic function called

Replicate() that you can use to build a string with repeating

characters.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic," in version 2.0.

MORE INFORMATION

The Replicate() function requires two arguments. These arguments are a

string expression and an integer representing the number of times you

want to repeat the string expression. For example, if you supply the

string expression ABC and the integer 3 to the Replicate() function, it

will return the string:

   ABCABCABC

The Replicate() function is similar to the String$() function, except

that the String$() function only repeats the first character of the given

string expression.

To create the Replicate() function, type the following code in a new or

existing module:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

   '******************************************************

   'Declarations Section of Module

   '******************************************************

   Option Explicit

   '======================================================

   ' Purpose: To build a string of replicated characters.

   ' Accepts: A string expression to be replicated.

   '          An integer representing the number of times

   '          the string expression is to be repeated.

   ' Returns: A string.

   '======================================================

   Function Replicate (Number As Integer, StringExpr As String)

      Dim RepString As String, i As Integer

      For i = 1 To Number

         RepString = RepString & StringExpr

      Next i

      Replicate = RepString

   End Function

To test the Replicate() function, type the following in the Immediate

window, and then press ENTER:

   ? Replicate(3,"ABC")

The following will be printed in the Immediate window:

   ABCABCABC

You can substitute any integer and any string expression for the

arguments in the above example.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, "For...Next

Statement," pages 198-199

Additional reference words: 1.00 1.10 2.00 replicate function ab string


INF: SelectObject Action Does Not Display Attached Table Names

 Article Number: Q109942

 CREATED: 10-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

In Microsoft Access version 1.x, when you use a SelectObject macro action

to select an attached table, you must enter the table name manually. The

names of native Microsoft Access tables appear in the list, but the names

of attached tables do not.

MORE INFORMATION

When you use Table as the Object Type argument for a SelectObject macro

action, Microsoft Access displays a list of native tables for you to

select from. Attached tables are not included in the list of tables. To

select an attached table, you must type the table name in the box.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, "SelectObject

Action," pages 431-432

Additional reference words: 1.00 1.10 macro selectobject attached


INF: How to Fill Text Boxes on a Report with Access Basic

 Article Number: Q109943

 CREATED: 10-JAN-1994

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes two methods you can use to populate, or fill,

controls on a bound report when you run the report.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic," in version 2.0.

MORE INFORMATION

Both of the examples below use Access Basic code to fill a control on a

report bound to the Employee List query. The code will fill in the City

field on a report that only contains the Employee ID and Employee Name

fields.

The first example demonstrates how to fill a field using Access Basic

code called from the OnFormat property of the report's detail section:

1. Open the sample database NWIND.MDB.

2. Using the ReportWizard, create a new report based on the Employee

   List query with the following options:

    - Single-Column

    - Include both fields

    - Sort by Employee Name

    - Select Executive style

3. View the report in Design view.

4. Place the following text box in the report's detail section:

      ControlName: City

      ControlSource: <leave empty>

5. Save the report as Fill Report1.

6. Enter the following sample code in a new or existing module:

   Option Explicit

   Function fillrep()

      Dim ds as Dynaset, db as Database

      Set db=CurrentDB()

      set ds=db.CreateDynaset("Employees")

      ds.MoveFirst

      ds.FindFirst "[Employee ID]=" & Reports![Fill Report1]![Employee ID]

      Reports![Fill Report1]![City]=ds![city]

   End Function

7. Modify the report's detail section OnFormat property to be:

      =fillrep()

8. Preview the report. The City fields on the report will be filled by

   the Access Basic code.

The second example demonstrates how to fill a field using Access Basic

code called from a text box's ControlSource property:

1. Open the sample database NWIND.MDB.

2. Using the ReportWizard, create a new report based on the Employee

   List query with the following options:

    - Single-Column

    - Include both fields

    - Sort by Employee Name

    - Select Executive style

3. View the report in Design view.

4. Place the following text box in the report's detail section:

      ControlName: City

      ControlSource: <leave empty>

5. Save the report as Fill Report2.

6. Enter the following sample code in a new or existing module:

   Function fillit()

      Dim ds as Dynaset, db as Database

      Set db=CurrentDB()

      set ds=db.CreateDynaset("Employees")

      ds.MoveFirst

      ds.FindFirst "[Employee ID]=" & Reports![Fill Report2]![Employee ID]

      fillit=ds!city

   End Function

7. Change the ControlSource property of the City text box on the

   report to be:

      =fillit()

8. Preview the report. The City fields on the report will be filled by

   the Access Basic code.

REFERENCES

==========

Microsoft Access "Introduction to Programming," version 1.1, chapter 7

For more information on calling functions, query on the following words

here in the Microsoft Knowledge Base:

   functions and called and from and events and expressions

Additional reference words: 1.00 1.10 2.00 on format ControlSource


PRB: Print Setup Triggers Report's OnClose, OnOpen Properties

 Article Number: Q109944

 CREATED: 10-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you preview a report, choosing the Setup button on the

toolbar and then choosing OK in the Print Setup dialog box activates

the report's OnClose and OnOpen events.

CAUSE

When you choose OK in the Print Setup dialog box, the report is closed

and then reopened with the new printer settings. When the report is

closed and reopened, its OnClose and OnOpen events occur.

RESOLUTION

Since you cannot prevent the OnClose and OnOpen events from occurring when

OK is chosen in the Print Setup dialog box, you may want to hide the

toolbar so that the Setup button is not available.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create two new macros, each with a MsgBox action. Give the first

   macro the message box text "OnClose" (without quotation marks) and

   save it as OnClose Macro. Give the second macro the message box text

   "OnOpen" (without quotation marks) and save it as OnOpen Macro.

3. Open the Invoice report in Design view.

4. Attach the OnOpen Macro macro to the report's OnOpen property. Attach

   the OnClose Macro macro to the report's OnClose property.

5. Preview the report.

6. Click the Setup button on the toolbar.

7. In the Print Setup dialog box, choose OK. A message box with the text

   "OnClose" will be displayed, indicating that the report's OnClose event

   occurred. After you choose OK, a message box with the text "OnOpen" will

   be displayed, indicating that the report has been reopened and its

   OnOpen event triggered.

8. Close the report. Do not save the changes to the report.

Additional reference words: 1.00 1.10


INF: Sample Function to Return Variable's Data Type Name

 Article Number: Q109945

 CREATED: 10-JAN-1994

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The built-in VarType() function returns a value that indicates a

variable's data type. This article describes a sample Access Basic

function you can use to return the data type's name.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic," in version 2.0.

MORE INFORMATION

To create the sample function DataTypeName(), type the following code in

a new or existing module:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code

in Access Basic.

   '******************************************************

   'Declarations Section of Module

   '******************************************************

   Option Explicit

   '======================================================

   ' Purpose: To return the data type name.

   ' Accepts: A data type value.

   '======================================================

   Function DataTypeName (MyValue)

      DataTypeName = Choose(VarType(MyValue) + 1, "Empty", _

         "Null", "Integer", "Long", "Single", "Double", _

         "Currency", "Date", "String")

   End Function

To try the DataTypeName() function, type the following in the module's

Immediate window, and then press ENTER:

   ? DataTypeName(2)

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, "Choose Function,"

page 65, and "VarType Function," page 494

Additional reference words: 1.00 1.10 2.00 function ab datatype vartype


PRB: DoMenuItem Macro to Export Object Returns Error

 Article Number: Q109946

 CREATED: 10-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you run a macro that uses the DoMenuItem action with an Export

command to export an object from your database, you receive the following

error message:

   Command not available: Export

RESOLUTION

To work around this problem, use the TransferText, TransferDatabase, or

TransferSpreadsheet macro action instead of the DoMenuItem action.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB. Create and save a macro with the

   following action:

      Action: DoMenuItem

         Menu Bar: Database

         Menu Name: File

         Command: Export

2. Create a new, unbound, blank form.

3. Drag the macro from the Database window onto the form.

4. View the form in Form view.

5. Click the macro command button on the form.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.0, "DoMenuItem

Action," pages 151-154, "TransferDatabase Action," pages 473-476,

"TransferSpreadsheet Action," pages 476-479, and "TransferText Action,"

pages 479-481

Additional reference words: 1.00 1.10 DoMenuItem Export Transfer


PRB: Cannot Connect DDE from Word 6.0 to Microsoft Access

 Article Number: Q109948

 CREATED: 10-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

 - Microsoft Word version 6.0 for Windows

---------------------------------------------------------------------

SYMPTOMS

When you are running a Mail Merge in Microsoft Word version 6.0 for

Windows, you cannot connect to a Microsoft Access database using dynamic

data exchange (DDE) because the DDE option is not available in the Confirm

Data Source dialog box.

CAUSE

This problem occurs because Microsoft Access and its database extension

(.MDB) is not registered with Microsoft Windows.

RESOLUTION

Follow the steps below to register Microsoft Access and its database

extension with Windows:

1. In Microsoft Windows File Manager, choose Associate from the File

   menu.

2. Type "MDB" (without the quotation marks) in the Files With Extension

   box.

3. Choose the Browse button.

4. Select your Access directory in the Directories box, and then select

   MSACCESS.EXE in the File Name box.

5. Choose OK.

6. Exit and restart Microsoft Windows.

Additional reference words: 1.00 1.10 2.00 Interoperability


INF: How to Repair a Damaged Database

 Article Number: Q109953

 CREATED: 10-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

The Repair and Compact utilities in Microsoft Access are useful tools for

recovering and optimizing Microsoft Access database files.

However, these utilities affect only tables, queries, and indexes. They

cannot affect forms, reports, macros, or modules.

MORE INFORMATION

The Repair Utility

------------------

You can use the Repair utility to help fix databases with certain types

of damage. The Repair utility will attempt to repair only the tables,

queries, and indexes in the database. The Repair utility will not attempt

to repair damaged forms, reports, macros, or modules, but will simply

copy them to the new repaired database.

Compact Utility

---------------

The Compact utility eliminates empty space in an existing database. It does

so by creating a temporary database, exporting all the objects from the

original database into the temporary database, removing the original

database, and then renaming the temporary database to the original

database's name. You also have the option to name the temporary database to

some other name so that you can retain the original database.

Recovering a Damaged Database

-----------------------------

The following steps outline a general method for attempting to repair a

damaged database:

1. Back up the damaged database (.MDB) file.

2. If the damage is in a table, query, or index, run the Repair utility as

   follows:

   a. Close all open databases.

   b. From the File menu, choose Repair.

   c. In the File Name box, select the damaged database and choose OK.

   If the repair is successful, you will receive the message:

      Repair of database '<path><database name>' completed

      successfully.

   If the repair does not succeed you will receive a message stating so.

   This means either that the damage to a table, query, or index is so

   severe that it cannot be corrected, or that the damage is in an object

   that the Repair utility cannot affect.

3. If the damage is in a form or report, the damage can be either in the

   form or report itself, or in one or more controls on the form or report.

   - If the damage is in the form or report itself, the best approach is

     to create a new form or report and then copy the controls from the

     original form or report.

   - If the damage is in a control on the form or report, create a new form

     or report and then re-create the controls on the new form or report.

     It is best to re-create all the controls, since there is no way to

     tell which controls are damaged.

4. If the damage is in a macro or module, the damage can be in the macro

   or module itself, or in the contents of the macro or module.

   - If the damage is in the macro or module itself, create a new macro

     or module and then copy the contents of the original macro or module.

   - If the damage is in the contents of the macro or module, you must

     create a new macro or module and then re-create the contents of the

     original macro or module.

If you cannot repair the database with these steps, the database is

probably damaged beyond repair. If this is the case, you should restore

your last backup database, or re-create the database.

REFERENCES

==========

Microsoft Access "User's Guide," pages 636-639

Additional reference words: 1.00 1.10 2.00 Repairing Compacting Fixing


PRA: MS Graph Not Registered Correctly in Network Setup

 Article Number: Q109954

 CREATED: 10-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

After you install Microsoft Access to a network drive, you receive the

following error message when you try to use Microsoft Graph within

Microsoft Access:

   Can't start object's source application. Use the Windows

   Registration Info Editor (REGEDIT.EXE) to verify that the

   application is properly installed.

CAUSE

When you install Microsoft Access to a network drive within a Microsoft

Windows session that is running from a network drive as well, the

Microsoft Access Setup program does not insert correct information about

the location of Microsoft Graph in the REG.DAT file.

RESOLUTION

There are two methods for correcting this problem. The first method is to

run the Windows Registration Information Editor with the /V switch to

modify the settings for Microsoft Graph.

Modify the following two lines in the REG.DAT file so that they contain

the correct drive and path for the shared GRAPH.EXE file:

   MSGraph\protocol\StdExectute\server=<drive>:\<path>\GRAPH.EXE

   MSGraph\protocol\StdFileEditing\server=<drive>:\<path>\GRAPH.EXE

NOTE: The two lines above are only examples; you must modify them to

point to the location of the shared GRAPH.EXE file.

The second method is to modify Setup files so that an icon is created

when you run Setup that can be used to automatically correct the REG.DAT

file to point to the shared GRAPH.EXE file. This method is useful in that

all future workstation installations from the network will be correct:

 1. Move to the directory that contains the shared copy of GRAPH.EXE. It

    is usually in an MSAPPS\MSGRAPH directory near the shared copy of

    Microsoft Windows.

 2. Copy the MSGRAPH.REG or MSGRAPH3.REG file to a new file called

    MSGRFIX.REG.

 3. Open the MSGRFIX.REG file in Windows Notepad. Modify all the lines

    in the file that point to the GRAPH.EXE file to point to the

    correct drive and path for the shared copy of the file.

 4. Save and then close the MSGRFIX.REG file.

 5. Move to the network MSACCESS\INSTALL directory.

 6. Copy the STFSETUP.IN_ file to a new file called STFSETUP.ORG. The

    STFSETUP.ORG file is a backup file.

 7. Open the STFSETUP.IN_ file in Windows Write (the file is too large

    to open with Notepad). When you are prompted to convert the file to

    Write format, choose No Conversion.

 8. Move to the [ProgGroup Script] section of the file. Locate the line

    that begins with:

       CreateProgManItem $(AppName), "Microsoft Access Readme"...

 9. Add a new line after the line listed above. The new line should read

    as the sample line below, but modify the drive and path to point to

    the MSGRFIX.REG file created in step 2:

    NOTE: In the following sample line, an underscore (_) is used as a

    line-continuation character. Remove the underscore when re-creating

    this line.

       CreateProgManItem $(AppName), "MS Graph Fix", _

          "F:\PUBLIC\MSAPPS\MSGRAPH\MSGRFIX.REG", , O

10. Save and then close the STFSETUP.IN_ file.

11. Run the Microsoft Access Setup program with the /N switch again

    (SETUP /N). The Setup program will create a new icon called

    MS Graph Fix.

12. Double-click the MS Graph Fix icon. The REG.DAT file will be

    updated to point to the correct location for the shared copy

    of the GRAPH.EXE file.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.

Additional reference words: 1.00 1.10


INF: Copying Query that Cannot Be Opened in Design View

 Article Number: Q109955

 CREATED: 10-JAN-1994

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

If a query's SQL statement is too long, you cannot open the query in Design

view and you receive the error message:

   Expression is too long.

This article describes a sample Access Basic function you can use to

retrieve a copy of the query's SQL statement to use as a basis for re-

creating the query.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic," in version 2.0.

MORE INFORMATION

The following example demonstrates how to create and use the sample

Access Basic function Print_SQL():

 1. Open the database that contains the query you want to retrieve.

 2. Enter the following code in a new or existing module:

       Function Print_SQL(QueryName As String)

          Dim db As Database, q As QueryDef

          Set db = CurrentDB()

          Set q = db.OpenQueryDef(QueryName)

          Debug.Print q.sql

       End Function

 3. Compile the function.

 4. To test the function, type the following in the module's Immediate

    window, and then press ENTER. Make sure to substitute the name of

    your query for <QueryName>:

       ? Print_SQL("<QueryName>")

    The SQL-command version of the query will be printed in the Immediate

    window.

 5. If you want to use the query being displayed in the Immediate window

    as the basis for a new query, select the entire SQL command in the

    Immediate window, then choose Copy from the Edit menu.

 6. Create a new, unbound query.

 7. From the View menu, choose SQL.

 8. If there is any text in the SQL window, delete it.

 9. From the Edit menu, choose Paste.

10. The SQL command will appear in the SQL window. Make any necessary

   changes to the SQL command to shorten it, then choose OK. Your query

   will appear in the query grid.

REFERENCES

==========

Microsoft Access "Introduction to Programming," version 1.1, Chapter 8,

"Manipulating Data," page 132

Additional reference words: 1.00 1.10 2.00 recreate query sql


INF: How to Compare Unequal Data with Query Criteria

 Article Number: Q109956

 CREATED: 10-JAN-1994

 MODIFIED: 06-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access allows equi-joins and outer joins between tables. These

joins show only data that is equal between the joined tables.

This article describes how to create a query to show unequal (less than or

greater than) data comparisons using the query grid's Criteria row.

MORE INFORMATION

The following example demonstrates how to find out if a set of buildings

has square footage greater than or equal to the square footage requirements

of a a set of companies:

1. Create the following new tables:

      Table: Clients

      ----------------------------------

      FieldName: Client Name

       DataType: Text

       Field Size: 50

      FieldName: Min Sq Footage Required

       DataType: Number

       Field Size: Long Integer

      Table: Buildings

      ------------------------

      FieldName: Building Name

       DataType: Text

       Field Size: 50

      FieldName: Sq Footage

       DataType: Number

       Field Size: Long Integer

      FieldName: Address

       DataType: Text

       Field Size: 50

2. Enter the following data for the Clients table:

      Client Name       Min Sq Footage Required

      -----------------------------------------

      ABC Company       10000

      Cats, Inc.        2500

      XYZ Company       5000

3. Enter the following data for the Buildings table:

      Building Name   Sq Footage   Address

      ---------------------------------------------

      Paragon Towers  4500         123 South Street

      The Emporium    10000        East Avenue

      Twin Peaks      20000        401 4th Place

      Pyramid         1200         Lakeshore Drive

4. Create a new query based on both tables. Drag all of the fields from

   both tables onto the query grid.

5. In the Criteria row for the Sq Footage column enter the following:

      >=[Min Sq Footage Required]

6. Run the query.

The results of the query will be:

   Client       Min Sq Footage  Building        Sq

   Name         Required        Name            Footage  Address

   ----------------------------------------------------------------------

   ABC Company  10000           The Emporium    10000    East Avenue

   ABC Company  10000           Twin Peaks      20000    401 4th Place

   Cats, Inc.   2500            Paragon Towers   4500    123 South Street

   Cats, Inc.   2500            The Emporium    10000    East Avenue

   Cats, Inc.   2500            Twin Peaks      20000    401 4th Place

   XYZ Company  5000            The Emporium    10000    East Avenue

   XYZ Company  5000            Twin Peaks      20000    401 4th Place

Only buildings that have square footage greater than or equal to the

minimum required by each company satisfy the expression in the Criteria row

in the query.

Another way to achieve the same result would be to enter

   <=[Sq Footage]

in the Criteria row of the Min Sq Footage Required column in the query.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, pages 104-106

Additional reference words: 1.00 1.10 2.00 Queries


INF: Questions and Answers About .LDB Files

 Article Number: Q109957

 CREATED: 10-JAN-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

Q: What is an .LDB file and what is it used for?

A: The .LDB file maintains lock information about a database, and

   each user who opens the database has an entry in it. The .LDB file

   contains the computer and user names of all users currently

   accessing a database in a multiuser (network) environment. No

   other information is read from or written to the .LDB file.

   Microsoft Access uses this information to tell which records are

   locked in a database, and who has them locked, to prevent possible

   file contention errors and database corruption by multiple users.

   However, the .LDB file does not give Microsoft Access information

   on who has a database opened exclusively, since this is handled by

   SHARE.EXE (or VSHARE.386 in Windows 3.1). Those programs do not

   return information to Microsoft Access about who has the database

   open.

Q: Can I find out the structure of the .LDB file?

A: The format of the .LDB file is not published and is subject to

   change or elimination in future releases of Microsoft Access.

   Therefore, code written to manipulate it or read its current

   format may not work correctly if the .LDB file is eliminated or its

   format changed in a future release.

Q: Is the information in the .LDB file accessible to users or

   programmers?

A: No. The information in the .LDB file is only used internally by

   Microsoft Access and is not designed to be used by users or

   programmers.

Q: Where and when is an .LDB file created?

A: An .LDB file is created when you open a database. The .LDB file

   must reside in the same directory as that database. If an .LDB file

   isn't present, and Microsoft Access requires it, it attempts to

   create one in the same directory as the database.

   Normally, the .LDB file must be in a directory where the user has

   read-write privileges. However, it is possible to open a database

   in a directory or device where a user has read-only privileges.

   To do this, select both the Read Only and the Exclusive check boxes

   in the Open Database dialog box. The Open Database dialog box can

   be found by selecting Open Database from the File menu. The

   combination of read-only and exclusive means that users will not be

   updating any database information, so record-locking isn't

   required. Since record-locking isn't required, Microsoft Access

   does not attempt to open or create an .LDB file.

   This technique also works with directories where the user has read-

   write privileges and will improve performance if database updating

   isn't required.

Q: If you move a database, do you also need to move its .LDB file?

A: It isn't necessary to move the .LDB file, since Microsoft Access

   attempts to re-create the .LDB file if it is not present.

   A potential problem can occur if the database is placed in a

   directory where some users have directory read-only privileges and

   other users have directory read-write privileges.

   When a read-only user opens a database, no information is written

   to the .LDB file, since that user is not allowed to write any

   information to the database. When a read-write user opens a

   database, their name and computer information are written to the

   .LDB file.

   If both of these users (read-only and read-write) open a database

   and read the same record, a file conflict occurs if the read-write

   user attempts to update the record, because an update action would

   conflict with the read-only user. When a file conflict occurs,

   Microsoft Access pulls data from the .LDB file for what it thinks

   is the read-only user and uses this data in the file conflict error

   message given to the read-write user. However, since the read-only

   user's name and computer weren't written to the .LDB file, and since

   previously used .LDB files contain the names of previous read-write

   users, Microsoft Access reads old, outdated user information from

   the .LDB file and subsequently uses it in the error message instead

   of valid user information.

   To protect against this problem, the database should first be

   opened (and thus the .LDB file created) by one of the read-write

   users before any read-only users open the database.

Q: Can I erase the .LDB file?

A: You can erase the .LDB file if no one currently has it open.

   However, unless the database is opened as read-only and exclusive,

   Microsoft Access will re-create the file the next time the database

   is opened.

   In fact, if you get strange user names reported (such as old user

   names or garbage) when a lock conflict occurs, your .LDB file is

   most likely damaged. If you suspect this, it is best to erase your

   old .LDB file and let Microsoft Access automatically create a new

   one for you.

Q: What is the maximum size the .LDB file can be?

A: The maximum size is 16K, with each active user taking 64 bytes.

Q: When is information written to the .LDB file?

A: Information is only written to the .LDB file once, when a user

   opens a database and the .LDB file is created, and active user

   information is written to it. After that point, Microsoft Access

   only locks portions of the .LDB file and does not read from it or

   write to it.

Q: How does Microsoft Access use the information in the .LDB files?

A: Microsoft Access uses .LDB file information to determine who has

   which files (or records in a file) locked. If Access detects a lock

   conflict with another user, it reads the .LDB file to get the

   computer and user name of the user who has the file or record

   locked. However, the state of the information in the .LDB file has

   no bearing on the state of the database. If the .LDB file is

   completely corrupt, everything in the database will still work

   correctly (although user names reported in lock conflicts might

   look strange).

   In most lock conflict situations, you get a generic "Write

   conflict" error message that allows you to save the record, copy it

   to the clipboard, or drop the changes you made. In some

   circumstances, however, you get the error message:

      Couldn't lock table <table name>; currently in use by user

      <user name> on computer <computer name>.

Q: How can I find out which users are accessing my database?

A: Microsoft Access does not provide direct functionality to identify

   users accessing a database. The level and type of functionality in

   this area differs, and depends largely on the operating system and

   network software.

   For example, Microsoft Lan Manager provides an Audit API function

   set that can be used to create and manage real-time audit files.

   These audit files keep track of server operations and the users who

   perform them. These API functions can be manipulated through Access

   Basic to provide user information.

   Some operating systems (such as Windows for Workgroups, which comes

   with a tool called NetWatch) give you the ability to identify

   users logged onto a shared network directory. However, NetWatch

   cannot indentify users currently accessing a given file.

REFERENCES

==========

Microsoft Lan Manager "A Programmer's Guide," version 2.0, Chapter 8,

"Information APIs," pages 234-236

For more information about .LDB files, search for "LDB files" then "Locking

Information Files" using the Microsoft Access version 2.0 Help menu.

Additional reference words: 1.00 1.10 2.00 Q&A lockfile


PRA: Sent Keys Lost if Microsoft Access Yields Processor

 Article Number: Q109958

 CREATED: 10-JAN-1994

 MODIFIED: 31-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

If you use the SendKeys statement in Access Basic to fill a dialog box and

Microsoft Access yields the computer's processor to another Windows process

before the dialog box appears, the sent characters will be lost.

One situation where this might occur would be filling a report name in the

Print dialog box when you are printing a report to a file.

RESOLUTION

To minimize the chance of losing sent keys, make your queries as short as

possible. When a query takes a long time to run, Windows has more time to

interrupt the task to serve another Windows process. By shortening your

queries, you give Windows less time to interrupt.

If this problem occurs when you are printing to a file, try printing

directly to the file through your printer driver. If your printer driver

supports this, set it to print your report directly to a file instead of

using Microsoft Access to do this.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1, and 2.0. We are researching this problem and will post new

information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Using the Windows Control Panel, set up a printer to print to

   the port FILE.

2. Start Microsoft Access and open the sample database NWIND.MDB.

3. Open the "Employee Sales by Country (Parameter)" query and remove the

   parameters from the Shipped Date field in the query grid.

4. Drag the Employee ID field to the query grid and then type "1"

   (without the quotation marks) in its Criteria row.

5. Create the following new macro:

      SendKeys

         Keystrokes: text.txt

         Wait: No

      SendKeys

         Keystrokes: {enter}

         Wait: No

      OpenReport

         Report: Employee Sales By Country

         Mode: Print

6. Set the report Employee Sales by Country to print to the printer

   on port FILE.

7. Save and then run the query. In Microsoft Access version 1.x, the sent

   keys work correctly. In version 2.0, the sent keys are lost.

8. Remove the Employee ID field from the query and run the macro again.

   Note that the sent keys are lost.

Additional reference words: 1.00 1.10 2.00 Programming AB Timeout


INF: How to Use Criteria Queries Without Join Lines

 Article Number: Q109959

 CREATED: 10-JAN-1994

 MODIFIED: 28-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

Join lines between tables are used to clarify relationships among data in

the joined tables, and to sort and order the data. However, there are some

situations where it is not necessary to have join lines between tables.

This article demonstrates a situation where it is not necessary to have a

join line between tables.

MORE INFORMATION

The sample database NWIND.MDB contains a table called Orders that has a

column called Order Date. To see all the orders placed from January 1,

1991, to February 1, 1991, you would have to use a query, since there are

no join properties for unequal (greater than or less than) comparisons.

One way to see the orders from January 1, 1991, to February 1, 1991, is to

create a table that holds the beginning and ending dates of the period you

want to see, then create a query comparing the fields in that table against

the Order Date column in the Orders table. The following example

demonstrates how to do this:

1. Open the sample database NWIND.MDB.

2. Create the following new table:

      Table: Date Range

      ----------------------

      FieldName: Start Date

         DataType: Date/Time

      FieldName: End Date

         DataType: Date/Time

3. Enter the following data in the Date Range table:

      Start Date: 01-Jan-91

      End Date: 01-Feb-91

4. Create a new query based on the Orders and Date Range tables.

5. Drag all the fields from the Orders table to the query grid.

6. Enter the following in the Criteria row of the Order Date column:

      >=[Date Range].[Start Date] And <=[Date Range].[End Date]

7. Run the query.

The query will result in a dynaset containing 34 records.

There are other ways of accomplishing this task. One other way is to run a

parameter query, so that you are prompted for the beginning and ending date

each time you run the query. The drawback to this method is that the

beginning and ending dates are not saved, and must be entered each time you

run the query. However, you can work around this drawback by using a form

to prompt for the beginning and ending date, and then storing the values in

the Date Range table. The next time you open the form the values last used

will be displayed, and can be changed if necessary.

REFERENCES

==========

For more information on passing values from a form to a parameter query,

query on the following words here in the Microsoft Knowledge Base:

   passing and value and form and parameter and query

Additional reference words: 1.00 1.10 2.00 Queries


INF: Create a Function to Capitalize Single Words and Phrases

 Article Number: Q110391

 CREATED: 20-JAN-1994

 MODIFIED: 21-JAN-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

There is no built-in format or function in Microsoft Access that

capitalizes the first character of a word or set of words, as does the

Proper function in Microsoft Excel. However, you can create your own

Proper function in Access Basic. This article provides the code to

create a multiple-word Proper function.

There are two variations of the Proper function:

 - One is used in the AfterUpdate property of a control on a form,

   primarily for data entry.

 - The other is used in calculated query fields, calculated controls

   on forms and reports, macro SetValue expressions, and Access Basic

   expressions.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools

provided with Microsoft Access. For more information on Access Basic,

please refer to the "Introduction to Programming" manual.

MORE INFORMATION

   '**********************************************************

   'Declarations section of the module

   '**********************************************************

      Option Explicit

   '==========================================================

   'The following function is designed for use in the AfterUpdate

   ' property of Form controls.

   'Features:

   '   1. Leading spaces do not affect the function's performance.

   '   2. "O'Brian" and 'Wilson-Smythe' will be properly capitalized.

   'Limitations:

   '   1. It will change 'MacDonald' to 'Macdonald'.

   '   2. It will change 'van Buren' to 'Van Buren'.

   '   3. It will change 'John Jones III' to 'John Jones Iii'.

   '==========================================================

      Function Proper (Field)

      Dim Temp$, C$, OldC$, i As Integer

      If IsNull(Field) Then

         Exit Function

      Else

         Temp$ = CStr(LCase(Field))

         OldC$ = " "  ' Initialize this to a single space (Chr$(32))

                      ' because the first letter needs to be

                      ' capitalized, but has no preceding letter.

         For i = 1 To Len(Temp$)

            C$ = Mid$(Temp$, i, 1)

            If C$>="a" And C$<="z" And (OldC$<"a" Or OldC$>"z") Then

               Mid$(Temp$, i, 1) = UCase$(C$)

            End If

            OldC$ = C$

         Next i

         Field = Temp$

      End If

   End Function

How to Use This Function in the AfterUpdate Property of a Control

-----------------------------------------------------------------

1. Create a form based on a table or query.

2. Type the following in the AfterUpdate property of a text box

   control:

      =Proper(<control name>)

   For example, if the ControlName is [Full Name], type the following:

      =Proper([Full Name])

How to Modify This Function for Expressions and Calculated Controls

-------------------------------------------------------------------

1. Enter the code shown above to create the Proper function.

2. Modify the following section of code

   If IsNull(Field) Then

      Exit Function

   to read as follows:

   If IsNull(Field) Then

      Proper = Field

3. Modify the following section of code

      Field = Temp$

   End If

   to read as follows:

      Proper = Temp$

   End If

Examples

--------

The examples below all require the second version of the Proper()

function.

1. Using Proper() in a Query:

   Field: Full Name:Proper([Last Name] & " " & [First Name])

   This will concatenate the first and last names and capitalize the

   first letter of each.

2. Using Proper() in a calculated control on a Form or Report:

   TextBox

   -------

   ControlName: AddressP

   ControlSource: =Proper([Address])

   NOTE: In calculated fields, the ControlName must be unique.

3. Using Proper() in a Macro:

   Action: SetValue

   Item: Screen.ActiveControl

   Expression: Proper(Screen.ActiveControl)

NOTE: This macro can be called from the AfterUpdate property of a

control on a form. It effectively does the same job as the first

version of the Proper() function.

For information on creating a single-word Proper function, query on

the following words in the Microsoft Knowledge Base:

   create and proper and function

REFERENCES

==========

"Access Basic Language Reference," version 1.0, part 2, "A-Z

Reference"

Additional reference words: 1.00 1.10


PRB: Query Information Lost Switching to SQL-Specific Query

 Article Number: Q111777

 CREATED: 17-FEB-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SYMPTOMS

When you switch a query from a normal query type (Select, Delete, Append,

and so on) to a SQL-specific query type (Union, Pass-Through, or Data

Definition), you lose all the existing information, such as added tables or

expressions, in the query.

If you add information to a SQL-specific query and then switch the query to

a normal query type, you will lose any SQL information in the query.

CAUSE

When you switch from a normal Query window to a SQL-specific Query window,

Microsoft Access clears the Query Design window. Microsoft Access also

clears the Query Design window when you switch from a SQL-specific Query

window to a normal Query window.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. Open the Catalog query in Design view. Note the added tables and the

   information in the query grid.

3. From the Query menu, choose SQL Specific, then choose any of the

   three SQL-specific query types shown.

4. Type the SQL command SELECT in the Query window.

5. From the Query menu, choose Select. Note that the original query

   information is gone.

6. From the Query menu, choose SQL Specific, and then choose the

   query type you chose in step 3. Note that the SELECT statement is

   gone.

7. Close the query without saving the changes you made.

Additional reference words: 2.00 Queries


INF: How to Use the ColumnWidth Property

 Article Number: Q111778

 CREATED: 17-FEB-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes the ColumnWidth property, which applies to fields,

or columns, in Datasheet view. In Microsoft Access version 1.1, this

property is documented in the "The Secrets of Access Wizards" manual which

is included with the Microsoft Access Distribution Kit. In Microsoft Access

version 2.0, this property is documented in the online Help system.

MORE INFORMATION

The ColumnWidth property applies to fields, or columns, in Datasheet view.

It is an integer that represents the column width in twips. You can specify

a width, or use one of the following predefined settings:

   Setting   Description

   -----------------------------------------------------------------

    0        Hides the column

   -1        Sizes the column to the default width (default setting)

   -2        Sizes the column to fit the visible text

Note that you can also set this property by choosing the Column Width

command from the Layout menu in Microsoft Access version 1.x, or from the

Format menu in Microsoft Access version 2.0, in Datasheet view.

If you set a field's ColumnWidth property to 0 to hide the field, that

field's ColumnHidden property will be set to -1. If you set the field's

ColumnHidden property to 0 to show the field, the field's ColumnWidth

property will be restored to the setting it had before the field was

hidden. If you hid the field by setting its ColumnWidth property to 0, the

ColumnWidth property will be set to -1, which is the default width. Note

that the ColumnWidth property for a field is not available when the field's

ColumnHidden property is set to -1.

Microsoft Access evaluates the properties for a table or query in Datasheet

view when the table or query is first opened in Datasheet view. If the

table or query is open in Datasheet view when you change a field's

ColumnWidth property using Access Basic, the changes will not take effect

until you close and then reopen the table or query in Datasheet view.

In Microsoft Access version 1.x, in order to change the ColumnWidth

property of a field on a form, the form must be open in Design view. If the

form is not open in Design view, the property is read-only. In Microsoft

Access version 2.0, the form can be open in any view, and changes to the

ColumnWidth property will take effect immediately.

The following example demonstrates how to set the ColumnWidth property for

the Customers form in Datasheet view. This setting will change the Address

column's width to 1.5 inches (2160 twips):

   Forms![Customers]![Address].ColumnWidth = 2160

REFERENCES

==========

Microsoft Access Distribution Kit, "The Secrets of Access Wizards," version

1.1, page 12

Additional reference words: 1.00 1.10 2.00


PRB: Cannot Open Datasheet as a Pop-Up or Modal Form

 Article Number: Q111779

 CREATED: 17-FEB-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

A form in Datasheet view opens as a normal form rather than a modal or pop-

up form, although you have set its Modal or PopUp properties to Yes. If an

OpenForm macro action with a Dialog Window Mode argument is used to open

the form in Datasheet view, the form will open as a modal, pop-up form.

CAUSE

Only forms that open in Form view can be made to be modal or pop-up.

RESOLUTION

If you need to have a form in Datasheet view displayed as a modal or pop-up

form, consider placing the datasheet form as a subform in an unbound main

form. The main form can be displayed in Form view as a modal or pop-up

form. This also gives you the ability to add other features to your form,

such as a Close command button, that you could not add otherwise.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

Opening the Form with a Macro:

1. Open the sample database NWIND.MDB.

2. Create and then run the following new macro:

      OpenForm

         Form Name: Employees

         View: Datasheet

         Window Mode: Dialog

Note that the form opens in Form view as a modal, pop-up form, rather than

opening in Datasheet view.

Setting the Form's Modal and PopUp Properties:

1. Open the sample database NWIND.MDB.

2. Open the Employees form in Design view and set the following

   properties:

      DefaultView: Datasheet

      Modal: Yes

      Popup: Yes

3. Save and then close the form.

4. In the Database window, select the Employees form and then choose

   Open. Note that the form opens in Datasheet view but is not modal or

   pop-up.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 10, "Creating Forms

Based On More than One Table," pages 272-274

Microsoft Access "User's Guide," version 1.1, Chapter 10, "Creating Forms

Based On More than One Table," pages 278-280

Additional reference words: 1.00 1.10 2.00


PRB: Cannot Use SQL Pass-Through Command for Subreport

 Article Number: Q111780

 CREATED: 17-FEB-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SYMPTOMS

You receive the error message

   Can't use a subform or subreport bound to a crosstab query

   in which the column headings can vary

when you try to use a SQL-specific pass-through query as the RecordSource

for a subreport.

CAUSE

Reports require a list of fields to create a subreport, and a list of

fields is not stored in a SQL pass-through query.

STATUS

This behavior is by design.

REFERENCES

==========

For more information on SQL pass-through commands, search for "Pass-

Through" then "Pass-Through Command" using the Microsoft Access Help menu.

Additional reference words: 2.00 Queries


PRB: Rounding Errors Using Floating-Point Numbers

 Article Number: Q111781

 CREATED: 17-FEB-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SYMPTOMS

When you calculate using floating-point numbers, the result is not always

what you expect. For example, if you use the CInt() (convert to integer)

function in the calculation

   CInt(3.555 * 100)

you get 356 as the result, as you expect. However, the calculation

   CInt(4.555 * 100)

results in 455, instead of 456 as you expect.

CAUSE

Errors similar to the example above occur in any programming language that

uses floating-point numbers. This is because decimal fractions do not

always have exact binary equivalents, which can result in rounding errors.

RESOLUTION

There are several methods you can use to avoid rounding errors when you are

using floating-point numbers:

 - If you are using Single numbers, convert them to Doubles and use

   formatting to hide the extra digits. If there are any rounding errors,

   they will occur at the end of the numbers where they will not affect

   the visible data.

 - Use the Currency data type. If you use currency values of four decimal

   places or less, rounding errors will not occur since these values are

   actually scaled integers rather than floating-point numbers. In Access

   Basic code, use the at sign (@) character to use a Currency data type.

   For example, the calculation

      CInt(4.555@ * 100)

   results in a value of 456.

 - Break the calculation into two or more steps. When you list a

   calculation in one long line, Access Basic stores the intermediate

   values internally. For example, in the calculation

      CInt(4.555 * 100)

   the value 455.5 is temporarily stored and used in the CInt()

   function. If you break the calculation into the two steps

      x = 4.555 * 100

      CInt(x)

   you avoid this internal storage and thus avoid the floating-point

   rounding error.

Additional reference words: 2.00 AB Roundoff


INF: List of Categories and Examples from SOLUTION.MDB

 Article Number: Q111782

 CREATED: 17-FEB-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

The Solutions sample application (SOLUTION.MDB) included with Microsoft

Access version 2.0 contains many examples of common tasks that you can use

to help you design your database applications. This article lists all the

available categories and examples in the Solutions sample application.

MORE INFORMATION

These are the categories and examples in the Solutions sample application.

Each category is followed by all the examples for that category:

   Build a Microsoft Windows interface

   -----------------------------------------------------------

    - Change tool bars in response to events

    - Close all database objects when you exit the application

    - Create a custom menu bar for a form

    - Create a main menu form

    - Create a startup form

    - Create a tool bar that has custom buttons

    - Create an About dialog box

    - Create an informational form that users can turn off

    - Get information from a user in a dialog box

   Sample forms

   ----------------------------

    - About Solutions

    - Add All To List

    - Add Category

    - Edit Products

    - Employee Sales Dialog Box

    - Enter or Edit Products

    - Find Customers

    - Limit List Contents

    - Reattach NWIND

    - Sales Totals

    - Show Totals

    - Solutions

    - Solutions Intro

    - Startup

   Work with forms and controls

   ------------------------------------------------------------------

    - Capitalize one or more letters in a field automatically

    - Change the color of a control based on the value in the control

    - Change the color of a section and control at run time

    - Clear the values in unbound text boxes and a subform

    - Control when you go to a new record

    - Create a form in which you can edit but not enter records

    - Create a form in which you can enter or edit data

    - Create a main menu form

    - Create a startup form

    - Create an About dialog box

    - Create an informational form that users can turn off

    - Get information from a user in a dialog box

    - Remove the minimize and maximize buttons from a form

    - Update a list to show current data

   Get more mileage from combo boxes, list boxes, subforms and subreports

   ----------------------------------------------------------------------

    - Add "(all)" to a list

    - Add a new record to a list

    - Find a record based on a value you select from a list

    - Limit the contents of a list based on the value selected from an

      option group

    - Limit the contents of a list based on the value selected in

      another

    - Show totals in a subreport

    - Update a list after you change its contents

    - Use a custom function in a form's SELECT statement

    - Use criteria from the main form to set the subform's RecordSource

      property

    - Use two subforms on a form

   Query by form

   --------------------------------------------------------------------

    - Find a record based on a value you select from a list

    - Find records based on values in one or more fields

    - Show progressively more detail about a subject

    - Use a custom function in a subform's SELECT statement

    - Use criteria from the main form to set the subform's RecordSource

      property

    - Use part of a value to specify criteria

    - Use two subforms on a form

   Using queries with forms and reports

   --------------------------------------------------------------------

    - Create a crosstab query for a report

    - Create a SELECT statement for a form based on user input

    - Limit the contents of a list based on the value selected from an

      option group

    - Limit the contents of a list based on the value selected in

      another

    - Use a custom function in a form's SELECT statement

    - Use a parameterized query in an event procedure

    - Use a totals query as the record source for a subform

    - Use criteria from the main form to set the subform's RecordSource

      property

   Sample reports

   ----------------------

    - Customer Phone List

    - Employee Sales

    - Invoice

    - Sales Averages

    - Sales Letter

    - Shipping Log

   Create advanced reports

   --------------------------------------------------------

    - Create a crosstab report with dynamic column headings

    - Create a form letter

    - Create a multiple-column report

    - Create a multiple-fact crosstab report

    - Create a report for a preprinted form

   Control what you print on reports

   ----------------------------------------------------------------

    - Draw a circle around data to accentuate it

    - Hide a section when it falls at the top of a page

    - Hide and show controls based on the value in another control

    - Hide and show sections that print on a preprinted form

    - Print "Continued" at the bottom of a preprinted form

    - Print report criteria that was entered in a dialog box

    - Print the first and last entries on a page in the page header

      Repeat a group name at the top of a column or page

   Calculate totals on reports

   -------------------------------------------------------

    - Calculate row and column totals on a crosstab report

    - Show totals in a subreport

   Use multiple databases

   ---------------------------

    - Attach tables at startup

Additional reference words: 2.00 Designing


INF: How to Get Red, Green, or Blue Components from RGB Value

 Article Number: Q112061

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes a sample user-defined Access Basic function,

GetRGB(), that returns the red, green, or blue component from an RGB color

value. Note that this behavior is the opposite of the Access Basic function

RGB().

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access

Basic," in version 2.0.

MORE INFORMATION

RGB color values are mathematical combinations of red, green, and blue

components. The intensities of these components can range from 0 to 255.

For example, the RGB color value for white is 16777215, which has component

intensities of 255 for red, green, and blue.

The following example demonstrates how to use the GetRGB() function to

return the RGB color components from the RGB color value in the Order

form's detail section BackColor property:

1. Open the sample database NWIND.MDB.

2. Create a new module and add the following line to the Declarations

   section:

      Option Explicit

3. Create the following function in the module:

      '-----------------------------------------------------------------

      'PURPOSE: Returns red/green/blue color from RGB color value.

      'ACCEPTS: RGB color value as Long, and component number as integer

      '         that represents the component color to return (1=red,

      '         2=green, 3=blue).

      'RETURNS: The intensity of the color component (0 - 255) as an

      '         integer or -1 indicating that an argument was invalid.

      '-----------------------------------------------------------------

      Function GetRGB (RGBval As Long, Num As Integer) As Integer

         ' Check if Num, RGBval are valid.

         If Num > 0 And Num < 4 And RGBval > -1 And RGBval < 16777216 Then

           GetRGB = RGBval \ 256 ^ (Num - 1) And 255

         Else

           ' Return True (-1) if Num or RGBval are invalid.

           GetRGB = True

         End If

      End Function

4. Save the module as MyUtilities and then close it.

5. Create the following macro with the actions listed:

      Action   Comment

      --------------------------------

      MsgBox   Display red component

      MsgBox   Display green component

      MsgBox   Display blue component

      MsgBox Action

      -------------------------------------------------------------------

      Message: =GetRGB(Forms![Orders].Section(0).Backcolor,1) & ": Red"

      Message: =GetRGB(Forms![Orders].Section(0).Backcolor,2) & ": Green"

      Message: =GetRGB(Forms![Orders].Section(0).Backcolor,3) & ": Blue"

6. Save the macro as GetRGB and then close it.

7. Open the Orders form in Form view.

8. From the Database window, run the GetRGB macro.

Note that you can change the BackColor property of the detail section of

the Orders form and then run the macro again to see the results change.

REFERENCES

==========

Microsoft Access "Language Reference," versions 1.0 and 1.1, pages 403-404

For more information about the RGB() function, search for "RGB" then "RGB

Function" using the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00 video screen


INF: New ODBC Driver for Microsoft Access Version 2.0

 Article Number: Q112062

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

A new ODBC driver ships with Microsoft Access version 2.0 and will

be installed only with Microsoft Access version 2.0.

MORE INFORMATION

The Microsoft Access 2.0 driver for Microsoft Office that allows Microsoft

Word version 6.0 for Windows and Microsoft Excel version 5.0 to use

Microsoft Access version 2.0 data ships with Microsoft Access version 2.0.

This ODBC driver works only with Word and Microsoft Excel, and will not

work with Visual C++.

This driver will automatically be installed if you have already installed

the version 1.x driver with Word or Microsoft Excel, or if you have Office

Professional version 4.3.

When you install this driver, Setup creates a data source for Word. To use

the query tool with Microsoft Excel, you must set up your own data source.

While the new ODBC driver will allow you to access both version 1.x and

2.0 databases, you will probably want to use the version 1.x driver for

accessing 1.x databases because you will not be able to use the new

features in the 2.0 driver with 1.x databases.

REFERENCES

==========

For more information on the ODBC driver and setting up data sources, see

the DRVACC2.HLP file located in your \WINDOWS\SYSTEM directory.

Additional reference words: 2.00


INF: How to Add a User to a Group with CreateUser Method

 Article Number: Q112063

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

To add a user to an existing group with Access Basic code, you must use the

CreateUser method twice: once to create the new user for that Microsoft

Access session, and again to create the user for the group.

MORE INFORMATION

The following sample Access Basic function called CUser() demonstrates how

to create a user named MyName for the Users group:

1. Open or create a module and enter the following:

   NOTE: In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscore when re-creating this code

   in Access Basic.

      Function CUser (uname As String, upin As String, upwd As String,_

       gname As String)

         Dim u  As User, w As WorkSpace, g As Group

         Set w = dbengine.workspaces(0)          'The default workspace.

         Set u = w.CreateUser(uname, upin, upwd) 'Create a user for the

                                                 'Access session.

         w.users.Append u                        'Add user to workspace.

         w.users.Refresh

         Set g = w.groups(gname)

         Set u = g.CreateUser(uname)             'Create a user for a

                                                  group.

         g.users.Append u                        'Add new user to group.

         g.users.Refresh

      End Function

2. From the View menu, choose Immediate Window.

3. Type the following in the Immediate window, and then press ENTER:

      ? CUser ("MyName","1234","MyName","Users")

4. From the Security menu, choose Permissions, and then select the List

   Users option button.

Note that the new user appears in the Users/Group Name box.

REFERENCES

==========

For more information about the CreateUser method, search for "CreateUser"

then "CreateUser Method" using the Microsoft Access Help menu.

Additional reference words: 2.00 Programming AB


INF: How to Create a Cyclic Tab Order in a Form

 Article Number: Q112064

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes a technique that you can use to create a cyclic tab

order on a form, so that pressing TAB in the last control on a form moves

you back to the first control on the form (instead of moving you to the

first control on the next record), and pressing SHIFT+TAB in the first

control on a form moves you to the last control on the form.

MORE INFORMATION

The following example demonstrates how to create a cyclic tab order on the

Customers form in the sample database NWIND.MDB. This technique uses two

transparent command buttons, one at the top and one at the bottom of the

form's tab order. When you press TAB in the last control, or SHIFT+TAB in

the first control, you run a macro attached to the OnEnter property of the

transparent command button at the top or bottom of the form's tab order.

1. Create a macro called CyclicCustomers with the following actions:

      MacroName   Action

      ---------------------------------------

      GotoFirst   GotoControl

                     ControlName: Customer ID

      GotoLast    GotoControl

                     ControlName: Fax

2. Open the Customers form in Design view and add the following two

   command buttons with no labels:

      Command Button

      ------------------------------------

      ControlName: btnGotoLast

         OnEnter: CyclicCustomers.GotoLast

         Transparent: Yes

      Command Button

      -------------------------------------

         ControlName: btnGotoFirst

         OnEnter: CyclicCustomers.GotoFirst

         Transparent: Yes

   NOTE: Make these buttons very small, and position them so that users of

   the form are unlikely to choose them accidentally.

3. Set the form's OnOpen property to:

      OnOpen: CyclicCustomers.GotoFirst

   This is necessary since the btnGotoLast button will be the first control

   in the form's tab order. If you do not set the form's OnOpen property to

   CyclicCustomers.GotoFirst, the first command button will be selected

   when the form is opened, moving the focus to the last control on the

   form.

4. From the Edit menu, choose Tab Order.

5. Scroll to the bottom of the list of control names to find the new

   btnGotoLast and btnGotoFirst controls. Select the btnGotoLast control

   and drag it to the top of the list. btnGotoFirst should remain at the

   bottom of the list.

6. View the form in Form view. The first Customer ID in the Customers

   table is displayed.

7. Press SHIFT+TAB. The Fax field (the last field in the form) is selected.

8. Press TAB. The Customer ID field is selected.

Additional reference words: 1.00 1.10 2.00


INF: New Version Argument for DoMenuItem in Version 2.0

 Article Number: Q112065

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

Since the menu structure has changed from Microsoft Access version 1.x to

Microsoft Access version 2.0, there is a new argument for the DoMenuItem

action. The new argument, version, lets you use code written for either

version 1.x or 2.0 databases. Note that this new argument is the fifth

argument for the DoMenuItem action, and is only available in Access Basic.

MORE INFORMATION

The new version argument takes either of two constants: A_MENU_VER1X or

A_MENU_VER20. The default for this argument is A_MENU_VER1X.

If you write code in Microsoft Access version 2.0 and you want to use

version 2.0 menu commands, set this argument to A_MENU_VER20.

The syntax for the DoMenuItem action is:

   DoCmd DoMenuItem menubar, menuname, command [,subcommand][,version]

The following example using the above syntax chooses Paste from the Edit

menu in form Design view in Microsoft Access 2.0:

   DoCmd DoMenuItem A_FORMBAR, A_EDITMENU, A_PASTE, ,A_MENU_VER20

REFERENCES

==========

For more information about the DoMenuItem action, search for "DoMenuItem"

then "DoMenuItem Action" using the Microsoft Access Help menu.

Additional reference words: 2.00 AB Programming


INF: Troubleshooting Tips for Error Values

 Article Number: Q112103

 CREATED: 01-MAR-1994

 MODIFIED: 06-APR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SYMPTOMS

You see any of the following error values in a field on a table, query,

form, or report:

   #Error, #Num!, #Name?, #Div/0!, #Deleted, or #Locked

CAUSE

Microsoft Access places an error value in a field when it cannot find

necessary information, execute an expression, or store a value within the

limits for the field.

RESOLUTION

The sections below explain what the error values mean, and list some

reasons why Microsoft Access might display them:

#Error

------

This value means that Microsoft Access cannot evaluate the expression. For

example, you may have supplied incorrect or too few arguments for an

aggregate function, used a parameter query as the domain for an aggregate

function, or the expression may contain a circular reference.

The following three examples demonstrate possible causes for the #Error

value:

   Aggregate function:

      =DAvg("[Sales]","Employe")

In the above example, the table name should be "Employee," not "Employe."

   Circular reference: (Query)

      FirstName: [FirstName] & " " & [LastName]

The alias FirstName is also part of the expression in the example above.

   Circular reference: (Forms and Reports)

      Name: FirstName

      ControlSource: =[FirstName] & " " & [LastName]

The text box name is also part of the expression in this example.

In a table or form, this error can also occur when the DefaultValue

property setting for a field or control is not appropriate for the DataType

or FieldSize property setting, or when an expression includes a bound

control defined using the Trim() function and the underlying field contains

no data. The following example demonstrates a field whose DefaultValue

property setting is not appropriate for its FieldSize setting:

   Field: State (Text, FieldSize = 2)

   DefaultValue: ="Cal" (3 characters)

In a query, this error can occur when the value of a calculated field is

greater than the value allowed by the field's FieldSize property setting.

For example, if you add or multiply two Integer values and the resulting

Integer is greater than the value permitted in an Integer field, Microsoft

Access displays the #Error value in the field. The following example

demonstrates a value that is larger than is permitted for the field:

   Field: Age (Integer, current record value = 50)

   Expr1: [Age] * 1000

#Num!

-----

This error value means that the value in the field is too large (either

positively or negatively) to be stored in the field, based on the field's

DataType or FieldSize property setting.

#Name?

------

This error means that the name entered as the source of the value in the

field is invalid. The name may be misspelled, you may have omitted the

equal sign (=) before the expression, or the source itself may have been

deleted.

The following example demonstrates a missing equal sign (=) in an

expression:

   ControlSource: [FirstName] & " " & [LastName]

   Should be: =[FirstName] & " " & [LastName]

The next example demonstrates an invalid ControlSource property name:

   ControlSource: =[FirstNam] & " " & [LastName]

   Should be =[FirstName] & " " & [LastName]

When you are referring to a control on a subform or subreport, you must

refer to it via the main form or report using the following syntax:

   =Forms![<MainFormName>]![<SubFormName>].Form![<ControlName>]

   -or-

   =Reports![<MainReportName>]![<SubReportName>].Report![<ControlName>]

<MainFormName> or <MainReportName> is the name of the form or report that

contains the subform or subreport.

<SubFormName> or <SubReportName> is the name of the subform or subreport.

Note that this name does not have to be the same name as the name of the

subform or subreport itself. To verify this name, check the Name property

of the subform or subreport.

<ControlName> is the name of the control on the subform or subreport. To

verify this name, check the Name property of the control.

Some other causes for the #Name? error value include:

 - A field name on the form or report does not match the name of the field

   in the underlying table.

 - A control name is the same as one of the fields on the underlying table.

 - An expression designed to calculate a sum for a control might include a

   Sum() function. (The Sum() function can be used to calculate sums only

   for fields, not for controls.)

#Div/0!

-------

This value means that you are trying to divide a number by zero, either

directly in an expression (for example, 8/0), or by using a value from a

field whose value is zero.

#Deleted

--------

This value means that the record being referred to has been deleted.

#Locked

-------

The value can be caused by any of the following situations:

 - The record has been locked by another user and Microsoft Access cannot

   read the data.

 - There are two or more instances of Microsoft Access running on the

   same computer. Microsoft Access treats each open copy of the database as

   a separate user.

 - Access Basic code has opened a recordset and has a lock on a record.

It is important to note that Microsoft Access uses "page locking" instead

of "record locking." Microsoft Access stores records in groups of 2048

bytes, called pages. A single page may hold only one record, or it may hold

many records. If each record only requires 200 bytes, then up to 10 records

might be stored on a page. When Microsoft Access places a lock on a record,

it locks that record's page. If there are 10 records on the page, then all

10 records on that page will be locked.

Additional reference words: 2.00


INF: Using Microsoft Access 2.0 Databases with Visual Basic

 Article Number: Q112104

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

 - Microsoft Visual Basic version 3.0

---------------------------------------------------------------------

SUMMARY

This article describes how to use Microsoft Access version 2.0 databases

in Visual Basic version 3.0.

MORE INFORMATION

Microsoft Visual Basic version 3.0 includes dynamic-link libraries (DLLs)

that you can use to communicate with the Microsoft Access Jet database

engine version 1.1 (Jet 1.1) that is used by Microsoft Access version 1.1.

Jet 1.1 is also included with Visual Basic version 3.0 and can be freely

distributed with applications created with it; there is no need to purchase

Microsoft Access to obtain Jet 1.1.

You can use the DLLs in Visual Basic 3.0 to create Jet 1.1 applications.

However, these DLLs will not communicate with the Microsoft Access Jet

database engine version 2.0 (Jet 2.0) that is used in Microsoft Access

version 2.0. Visual Basic version 3.0 includes Jet 1.1 only; it does not

include Jet 2.0. Jet 2.0 consists of the MSAJT200.DLL file, plus the

various ISAM DLLs (PDX200.DLL, XBS200.DLL, and so on).

So that you can use Microsoft Access version 2.0 databases in Visual Basic

version 3.0, a "compatibility layer," or series of files, was created to

replace these DLLs. For example, the compatibility layer directly replaces

the VBDB300.DLL file with a new version with the same name. When you use

the compatibility layer in conjunction with Jet 2.0, you can use Microsoft

Access version 2.0-created databases.

Note that it is not necessary to use the compatibility layer and Jet 2.0

combination to create database applications with Visual Basic 3.0; you can

continue to use the DLLs included with Visual Basic 3.0 as before with no

problem, as well as Jet 1.1 databases. Also, you can continue to use your

current Jet 1.1 applications, even if you convert to Microsoft Access

version 2.0, since it can still read Jet 1.1 databases. Just do not convert

your Jet 1.1 databases to Jet 2.0 if you do not want to use the

compatibility layer.

The compatibility layer is required only if you want to create applications

that use Jet 2.0 and the new features it contains, such as:

 - Data-definition queries

 - Engine-level validation

 - Programmatic access to security

 - DAO (data access objects)

 - Cascading deletes

 - Temporary queries

The compatibility layer and Jet 2.0 will be available in the Microsoft

Access Developer's Toolkit (ADT) version 2.0. The compatibility layer only

(without the Jet files) will be available in the Microsoft Office

Developer's Kit (ODK).

Additional reference words: 2.00 Interoperability


INF: Microsoft Access and ORACLE ODBC Drivers

 Article Number: Q112105

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access version 2.0 contains an ODBC driver for connecting to SQL

Server. However, Microsoft Access 2.0 does not contain the Oracle 6 ODBC

driver because customer research showed that relatively few people used the

Oracle driver that was shipped with Microsoft Access version 1.1.

If you have the Oracle ODBC driver supplied with Microsoft Access version

1.1, however, you can use it with Microsoft Access version 2.0. The Oracle

ODBC driver included with Microsoft Access version 1.1 supports Oracle 6

functionality and Oracle 6 functionality in Oracle 7, but does not support

full Oracle 7 functionality. If you want full Oracle 7 functionality, both

Oracle and Q+E have Oracle 7 ODBC drivers available that can be used with

Microsoft Access version 2.0.

To obtain the Oracle 6 driver, you can purchase the Microsoft ODBC Drivers

fulfillment kit. This kit contains the latest versions of ODBC drivers for

Microsoft SQL Server and Oracle 6, and other drivers as they become

available. To order the kit, send $5.25 + $5.00 shipping (+ local sales

tax, if applicable) to:

   Microsoft Access for Windows Supplemental Offers

   PO Box 3022

   Bothell, WA 98041

Additional reference words: 2.00 Importing Exporting Attaching


INF: How to Use DAO to Assign or View Permissions

 Article Number: Q112106

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

In Microsoft Access version 2.0, programmers can assign permissions to

database objects programmatically using data access objects (DAO). Securing

a database involves several steps, including:

1. Creating group accounts.

2. Creating user accounts.

3. Assigning users to groups.

4. Assigning permissions on database objects to users and groups.

5. Encrypting the database, if desired.

This article demonstrates the fourth step, assigning permissions on

database objects to users and groups.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Building Applications" manual, Chapter 3, "Introducing Access

Basic."

MORE INFORMATION

To assign permissions for an object, you must reference the UserName and

Permissions properties of the objects document. All database objects can

be treated as documents in a container. For example, given the DB variable

assignment

   Dim DB As Database

   Set DB = DBEngine.Workspaces(0).Databases(0)

a table called Table1 can be referred to using DAO as follows:

   DB.Containers("Tables").Documents("Table1")

However, it is usually easier to assign and work with object variables:

   Dim DB as Database, DOC as Document

   Set DB = DBEngine.Workspaces(0).Databases(0)

   Set DOC = DB.Containers("Tables").Documents("Table1")

You can directly reference the UserName and Permissions properties

of the Table1 document like this:

   UserNameVariable = DOC.UserName

   PermissionsVariable = DOC.Permissions

   -or-

   DOC.UserName = "MyUser"

   DOC.Permissions = DB_SEC_FULLACCESS

Reading Permissions Information

-------------------------------

To read the permissions that a given user has on an object, simply set

the UserName property of the document to the name of the user or group

you want to inquire on, and then read the value of the Permissions

property.

The following example shows how to read the permissions for the user John

on form MyMainForm:

   Dim DB as Database, DOC as Document, HisPermissions as Long

   Set DB = DBEngine.Workspaces(0).Databases(0)

   Set DOC = DB.Containers("Forms").Documents("MyMainForm")

   DOC.UserName = "John"

   HisPermissions = DOC.Permissions

This example shows how to read the permissions for the group Supervisors on

the report SalarySummary:

   Dim DB as Database, DOC as Document, GroupPermissions as Long

   Set DB = DBEngine.Workspaces(0).Databases(0)

   Set DOC = DB.Containers("Reports").Documents("SalarySummary")

   DOC.UserName = "Supervisors"

   GroupPermissions = DOC.Permissions

Note that whether you are inquiring on a group or a user, you still set the

UserName property. There is no GroupName property for a document.

Assigning Permissions Information

---------------------------------

To assign permissions for a user on an object, set the UserName property

of the document to the name of the user or group, and then set the

Permissions property of the document to the appropriate value.

Generally, you should use the predefined constants when you are assigning

permissions. For a complete list of the predefined constants, search for

"Security: Constants" using the Microsoft Access Help menu.

The following example shows how to assign Full permissions for the user

Martha on the table Employees:

   Dim DB as Database, DOC as Document

   Set DB = DBEngine.Workspaces(0).Databases(0)

   Set DOC = DB.Containers("Tables").Documents("Employees")

   DOC.UserName = "Martha"

   DOC.Permissions = DB_SEC_FULLACCESS

The next example shows how to assign Open/Run and Modify Design permissions

for the group Developers on the form Customers:

   Dim DB as Database, DOC as Document

   Set DB = DBEngine.Workspaces(0).Databases(0)

   Set DOC = DB.Containers("Forms").Documents("Customers")

   DOC.UserName = "Developers"

   DOC.Permissions = DB_SEC_FRMRPT_EXECUTE+DB_SEC_FRMRPT_WRITEDEF

Methods to Programmatically View and Assign Permissions

-------------------------------------------------------

Method 1:

This method uses a sample subroutine called AssignPerms to update all the

objects in a database. To assign permissions for a user on all the objects

in a database, you can move through all the documents in all the

collections in the database. The following sample subroutine demonstrates

one way of moving through all the documents in a database and changing the

permissions on them:

   Sub AssignPerms (GrpUsrName as String, NewPerm as Long)

      Dim DB as Database, I as Integer, J as Integer

      Set DB = DBEngine.Workspaces(0).Databases(0)

      For I = 0 to DB.Containers.Count - 1

         For J = 0 to DB.Containers(I).Documents.Count - 1

            DB.Containers(I).Documents(J).UserName = GrpUsrName

            DB.Containers(I).Documents(J).Permissions = NewPerm

         Next J

      Next I

  End Sub

You could call this subroutine from within Access Basic code, passing

the group or user name and the Permissions value you want to assign.

For example, to revoke all permissions on all objects from the Guests

group, call AssignPerms as follows:

   AssignPerms "Guests", DB_SEC_NOACCESS

To assign full permissions on all objects to the Managers account,

call AssignPerms like this:

   AssignPerms "Managers", DB_SEC_FULLACCESS

Method 2:

This method uses two sample functions, GetPermissions() and

SetPermissions(), to display and assign the permissions for a user or

group on the database object you specify.

To create the sample functions, first enter the following text in the

Declarations section of a module:

   Option Compare Database

   Option Explicit

   Global Const SUCCESS_SUCCESS = 0

Then enter the following code in the module:

    ****************************************

    FUNCTION: GetPermissions()

    Inputs:  UserGrpName - name of a user or group account

             ObjClass    - name of an object container

             ObjName     - name of an object document

    Returns: Value of Permissions property or error number

             that was generated.

    ****************************************

   Function GetPermissions& (UserGrpName$, ObjClass$, ObjName$)

      On Error GoTo Err_GetPermissions

       Set DB to the current database, and set the DOC variable

       .. to the object specified in the arguments.

      Dim DB As Database, DOC As Document

      Set DB = DBEngine.Workspaces(0).Databases(0)

      Set DOC = DB.Containers(ObjClass).Documents(ObjName)

       Set the UserName property of the document to the

       .. user or group you want to obtain the permissions for.

      DOC.UserName = UserGrpName

       Get the permissions value.

      GetPermissions = DOC.Permissions

   Bye_GetPermissions:

      Exit Function

   Err_GetPermissions:

       If an error occurs, display the message and terminate the

       .. function, returning the error number.

      MsgBox Err & " " & Error$

      GetPermissions = Err

      Resume Bye_GetPermissions

   End Function

    ****************************************

    FUNCTION: SetPermissions()

    Inputs:  UserGrpName - name of a user or group account

             ObjClass    - name of an object container

             ObjName     - name of an object document

             NewPerm     - new Permissions value

    NewPerm will typically be set by adding together the constants

    predefined for the security options. For a list of the

    constants search Help on "Permissions Property."

    Returns: SUCCESS_SUCCESS or the error number that was generated.

    ****************************************

   Function SetPermissions& (UserGrpName$, ObjClass$, ObjName$,_

      NewPerm&)

      On Error Goto Err_SetPermissions

       Set DB to the current database, and set the DOC variable

       to the object specified in the arguments.

      Dim DB As Database, DOC As Document

      Set DB = DBEngine.Workspaces(0).Databases(0)

      Set DOC = DB.Containers(ObjClass).Documents(ObjName)

       Set the UserName property of the document to the

       .. user or group you want to assign the permissions for.

      DOC.UserName = UserGrpName

       Set the permissions property to the value passed as

       .. an argument to the function.

      DOC.Permissions = NewPerm

      SetPermissions = SUCCESS_SUCCESS

   Bye_SetPermissions:

      Exit Function

   Err_SetPermissions:

       If an error occurs, display the message and terminate the

       .. function, returning the error number.

      MsgBox Err & " " & Error$

      SetPermissions = Err

      Resume Bye_SetPermissions

   End Function

These functions can be called anywhere you can use an expression in

Microsoft Access, including from within Access Basic code, in the

Field, Criteria, or Update To row of a query, or the ControlSource

property of a form or report control.

The following example shows how to call the GetPermissions() function from

another Access Basic function:

   Dim ObjProp as Long

   ObjProp = GetPermissions("User1","Tables","Table1")

This function call would return the permissions value for User1 on the

table object Table1.

The next example shows how to call the GetPermissions() function from the

ControlSource property of a control on a form or report with controls that

contain the user name, object class, and object name that you want to list

the permissions for:

   ControlName: ObjProp

   ControlSource: =GetPermissions(Me!UsrName, Me!ObjClass, Me!ObjName)

To assign full permissions for the Admins group to a table called

MyTable, you could call the SetPermissions() function as follows:

   Dim RETVAL as Long

   RETVAL = SetPermissions("Admins","Tables","MyTable", DB_SEC_FULLACCESS)

REFERENCES

==========

For more information about using DAO to create group and user accounts, and

about how to assign users to group accounts, query on the following words

here in the Microsoft Knowledge Base:

   DAO and Security and CreateGroup or CreateUser

Additional reference words: 2.00


INF: How to Index an Existing Field with DAO

 Article Number: Q112107

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article demonstrates how to create a compound (multiple-field) index

in an existing table using data access objects (DAO).

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Building Applications" manual, Chapter 3, "Introducing Access

Basic."

MORE INFORMATION

An Index object contains the fields that are being indexed, and usually

contains only a single field. The Index object created in the example below

will have two fields appended to it, creating a multiple-field index.

The example below demonstrates how to create a multiple-field index with

DAO:

 1. Open the sample database NWIND.MDB.

 2. Create the following new table:

    Table: Interviews

    --------------------------

    FieldName: CustomerID

       DataType: Number

       FieldSize: Long Integer

    FieldName: InterviewerID

       DataType: Number

       FieldSize: Long Integer

    FieldName: Appointment

       DataType: Date/Time

 3. Save the table as Interviews without creating a primary key, then

    close it.

 4. Create a new module and enter the following Declaration:

       Option Explicit

 5. Create the following function in the module:

       '---------------------------------------------------------------

       'PURPOSE: Adds a multiple-field index to a table.

       'ACCEPTS: Nothing.

       'RETURNS: Nothing.

       '---------------------------------------------------------------

       Function AddMultiIndex ()

          Dim DB As Database, TDef As TableDef

          Dim Idx As Index, Fld As Field

          Set DB = DBEngine.Workspaces(0).Databases(0)

          ' Open the table definition.

          Set TDef = DB.TableDefs("Interviews")

          ' Create an index called PrimaryKey for this TableDef

          ' .. and turn on the Primary and Required properties.

          Set Idx = TDef.CreateIndex("PrimaryKey")

          Idx.Primary = True

          Idx.Required = True

          Idx.Ignorenulls = False

          ' Create an index field with the same name as a table field,

          ' .. then append it to the index.

          Set Fld = Idx.CreateField("CustomerID")

          Idx.fields.Append Fld

          '   Do the second field the same way.

          Set Fld = Idx.CreateField("InterviewerID")

          Fld.Attributes = DB_DESCENDING

          Idx.fields.Append Fld

          '   Append the index to the TableDef.

          TDef.indexes.Append Idx

       End Function

 6. Save the module as DAOaddMultiIndex.

 7. From the View menu, choose Immediate Window.

 8. Type the following in the Immediate window, then press ENTER:

       ? AddMultiIndex()

 9. Close the Immediate window and the module.

10. Open the Interviews table in Design view. Note the compound

    primary key on the CustomerID and InterviewerID fields.

REFERENCES

==========

For more information about Index objects, search for "Index" then "Index

Object, Indexes Collection" using the Microsoft Access Help menu.

Additional reference words: 2.00


INF: How to Create an SQL Pass-Through Query in Access Basic

 Article Number: Q112108

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article demonstrates how to create an SQL pass-through (SPT) query in

Access Basic. You can use SPT queries to pass SQL statements directly to an

ODBC data source, avoiding the need to attach tables.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Building Applications" manual, Chapter 3, "Introducing Access

Basic."

MORE INFORMATION

You can use SPT queries to send commands directly to an ODBC database

server (such as Microsoft SQL Server). Using Access Basic, you can write a

function that will create an SPT query. When you run the query, it will

send commands directly to the ODBC database server for processing.

The following example demonstrates how to create an SPT query in Access

Basic:

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

1. Create the following sample Access Basic code:

      '-----------------------------------------------

      ' Declarations Section

      '-----------------------------------------------

      Option Explicit

      '-----------------------------------------------

      ' FUNCTION: CreateSPT()

      ' PURPOSE:

      '   Creates an SQL pass-through query using Access Basic using the

      '   supplied arguments:

      '      SPTQueryName: the name of the query to create

      '      SQLString: the query's SQL string

      '      ConnectString: the ODBC connect string, this must be at

      '         least "ODBC;"

      '-----------------------------------------------

      Function CreateSPT (SPTQueryName As String, SQLString As String, _

                  ConnectString As String)

         Dim mydatabase As Database, myquerydef As QueryDef

         Set mydatabase = DBENGINE.Workspaces(0).Databases(0)

         Set myquerydef = mydatabase.CreateQueryDef(SPTQueryName)

         myquerydef.connect = ConnectString

         myquerydef.sql = SQLString

         myquerydef.Close

      End Function

2. To call this function, type the following in the Immediate window:

      ? CreateSPT("MySptQuery", "sp_help", "ODBC;")

This will create the query MySptQuery and add it to the list of queries in

the Database window. When you run MySptQuery it will prompt you for the

ODBC connect string and run the stored procedure sp_help, which returns a

list of tables from the SQL Server.

To create an SPT query called Test that would return a list of all the

records from the Authors table located on the Red server in the Pubs

database, you would type

   ? CreateSPT("Test", "Select * from authors",_

        "ODBC;DSN=Red;Database=Pubs;USID=JOE;PWD=JOE")

in the Immediate window. This example also includes the UserId and password

(both "Joe") arguments in the ODBC connect string. Note that if you do not

supply at least "ODBC;" as the connect string, you will receive the

following error message:

   Syntax error in SELECT statement.

REFERENCES

==========

For more information about ODBC connect strings, query on the following

words here in the Microsoft Access Knowledge Base:

   ODBC and Connect and Usid

For more information about the syntax of SQL pass-through queries, please

consult the documentation for your server.

Additional reference words: 2.00 SPT


PRB: Cannot Use Counter to Determine If Record Is New Record

 Article Number: Q112109

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SYMPTOMS

The status of the counter field cannot be used to determine if the current

record is the new record.

CAUSE

In Microsoft Access version 1.x, the counter field was null until the

record was saved (that is, you moved to the next record, or chose Save

Record from the File menu). Therefore, if you checked the counter field

(using the IsNull function) and it was null, then the record being edited

was a new one. If not, then it was an existing record. The usual method was

to put the following expression in the form's BeforeUpdate property:

   IsNull([<counterfieldname>])

In Microsoft Access version 2.0, however, the counter field is updated as

soon as you begin inserting a new record, which invalidates the method

described above.

RESOLUTION

To determine if the current record is a new record using a counter field in

Microsoft Access version 2.0, you can check the OldValue property. OldValue

will return null for a new record.

To do this, use the following expression in the form's BeforeUpdate

property:

   IsNull([<counterfieldname>].OldValue)

For another technique that does not require the use of a counter field,

query on the following words here in the Microsoft Knowledge Base:

   Determine and New and Record and Bookmark

REFERENCES

==========

For more information about the OldValue property, search for "OldValue"

then "OldValue Property" using the Microsoft Access Help menu.

Additional reference words: 2.00 Forms


PRB: Cannot Enforce Referential Integrity in Relationship

 Article Number: Q112111

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SYMPTOMS

You cannot enforce referential integrity when you are defining a

relationship between tables.

CAUSE

There are several reasons why you might not be able to enforce referential

integrity when you define a relationship, including the following:

 - Existing data in the tables violates referential integrity. For example,

   you have a child record that does not have a matching parent in the

   primary table.

 - You can define a relationship with an attached table, but Microsoft

   Access will not enforce referential integrity between two tables unless

   both tables are in the same database and the database user has

   permissions to create the relationship in that database.

 - You started dragging from the wrong table or field. You must drag the

   primary key field (or uniquely indexed field) from the primary table to

   the related table. For example, to enforce referential integrity between

   the Customers and Orders tables in the sample database NWIND.MDB, you

   must drag the Customer ID field (primary key) from the Customers table

   to the Customer ID field in the Orders table. If you did not start

   dragging from the primary table, choose Cancel in the Relationships

   dialog box and start again.

 - You chose the correct fields, but they are not appropriately indexed.

   Before adding relationships, open the primary table in Design view and

   set a primary key or create a unique index for the fields you want to

   use in an enforced relationship.

 - Although you can create relationships using queries as well as tables,

   referential integrity is not enforced with queries.

MORE INFORMATION

Referential integrity is a set of rules that preserves the defined

relationships between tables when you enter or delete records. If you

enforce referential integrity, you cannot add a record to a related table

when there is no associated record in the primary table, change a value in

a primary table that would result in an orphan record in a related table,

or delete a record from a primary table when there is a matching related

record.

If you select the Cascade Update Related Fields or Cascade Delete Related

Records option for a relationship, Microsoft Access will change or delete

related records to ensure that the referential integrity rules are enforced

when you change or delete records.

REFERENCES

==========

For more information about referential integrity, search for "referential

integrity" then "Defining Relationships Between Tables" using the Microsoft

Access Help menu.

Additional reference words: 2.00 Tables RI Relationships


INF: How to Optimize Microsoft Access Version 2.0 Queries

 Article Number: Q112112

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article contains tips you can use to help you optimize your Microsoft

Access version 2.0 query performance.

MORE INFORMATION

This article assumes that all the tables in your application are local. If

your application uses attached tables the information in this article still

applies, but there are additional performance issues that pertain to

attached tables that can impact query performance. For more information

about improving performance using remotely attached tables, query on the

following words here in the Microsoft Knowledge Base:

   ODBC and Optimizing and Tables

The Query Optimizer

-------------------

The Microsoft Jet Database engine contains several components, but the most

important to queries (and the most complex) is the Optimizer. The Optimizer

is "cost-based," meaning that it assigns a time cost to each query task and

then chooses the least expensive list of tasks to perform that generates

the desired result set. The longer a task takes to perform, the more costly

or expensive it is considered to be.

To decide which query strategy to use, the Optimizer uses statistics. These

statistics are based on the number of records in a table, the number of

data pages in a table, the location of the table, whether or not indexes

are used, and so on. Based on these statistics, the Optimizer chooses the

best internal query strategy for dealing with a particular query.

Statistics calculations are done whenever a query is compiled. A query is

compiled whenever you save any changes made to it or to any of the tables

underlying the query. If you have added a significant number of rows to

your table since a query was last compiled, you should open and save the

query to cause it to recompile and thus update the statistics.

You can improve the statistics and thereby reduce overhead search time and

enable the Optimizer to make your queries run faster by using the tips

described below.

Tips to Impove Query Performance

--------------------------------

 - Compact your database. To do this, choose Compact Database from the File

   menu when no database is open. Compaction can speed up queries because

   it writes all the data in a table into contiguous pages on the hard

   disk. Scanning sequential pages is much faster than scanning fragmented

   pages.

 - Avoid expressions in query output. Exressions in query output can cause

   query optimization problems if the query is used as the input to another

   query. In the example below, query Q1 is used as the input for query Q2:

      Q1: SELECT IIF([MyColumn]="H","Hello","Goodbye") AS X

          FROM MyTable;

      Q2: SELECT *

          FROM Q1 WHERE X="HELLO";

   Since the IIF() expression in Q1 cannot be optimized, Q2 also cannot be

   optimized. If an expression gets buried deeply enough in a query tree,

   you can forget that it is there. As a result, your entire string of

   queries cannot be optimized.

   A better way to write the example query above is:

      Q1: SELECT *

          FROM MyTable WHERE MyColumn = "H";

   If expressions are necessary in the output, try to place them in a

   control on a form or report.

 - Place GROUP BY clauses in the same table as aggregates. This is an issue

   when you are joining two tables. For example, if you join two tables on

   the Customer Name field and then run a query that performs a GROUP BY

   operation on the Customer Name field, make sure that both the GROUP BY

   field (Customer Name) and the field that is in the aggregate (Sum,

   Count, and so on) come from the same table.

 - When you are creating a "totals" query, use the GROUP BY clause on as

   few fields as possible. The more fields in the GROUP BY clause, the

   longer the query takes to execute.

 - If possible, place a GROUP BY clause on a table and then join it to

   another table, rather than joining the two tables and doing the GROUP BY

   in the same query as the join. For example, instead of this query:

     Q1: SELECT Orders.[Company ID], Count(Orders.[Order ID]) AS

         [CountOfOrder ID]

         FROM Customers INNER JOIN Orders ON Customers.[Customer ID] =

         Orders.[Customer ID]

         GROUP BY Orders.[Company Name];

   Break the query into two separate queries, such as:

      Q1: SELECT Customers.[Company ID]

          FROM Customers

          GROUP BY Customers.[Company ID];

      Q2: SELECT Orders.[Customer ID], Count(Orders.[Order ID]) AS

          [CountOfOrder ID]

          FROM Q1 INNER JOIN Orders ON Q1.[Customer ID] =

          Orders.[Customer ID]

          GROUP BY Orders.[Customer ID];

 - When you are joining tables, try to index the fields on both sides of a

   join. This can speed query execution by allowing the query optimizer to

   use more sophisticated internal join strategy.

 - Index fields as much as possible. If a database is not updated

   frequently, then an index should be placed on all fields that are used

   in a join or in a restriction. With the use of Rushmore query

   optimization technology in Microsoft Access version 2.0, the Microsoft

   Jet database engine is able to take advantage of multiple indexes on a

   single table, which makes indexing multiple fields advantageous.

 - Try to construct your queries so that Rushmore technology can be used to

   help optimize them. Rushmore is a data-access technology that permits

   sets of records to be queried very efficiently. With Rushmore, when you

   use certain types of expressions in query criteria, your query will run

   much faster.

   Rushmore does not automatically speed up all of your queries. You must

   construct your queries in a certain way for Rushmore to be able to

   improve them. For more information about how to optimize queries with

   Rushmore technology, search for "Rushmore technology" then "Optimizing

   Queries with Rushmore Technology" using the Microsoft Access Help menu.

 - Use COUNT(*) rather than COUNT([Column Name]) to determine the number of

   records in a table. This is because there are special optimizations in

   the Microsoft Jet database engine that allow COUNT(*) to be executed

   much faster than COUNT([Column Name]).

REFERENCES

==========

For more information about optimizing Microsoft Access performance in

general, search for "optimizing performance" then "Optimizing Microsoft

Access Performance" using the Microsoft Access Help menu.

Additional reference words: 2.00 General Speeding Improving


INF: How to Optimize Microsoft Access Version 2.0 Performance

 Article Number: Q112117

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article contains tips for optimizing the performance of Microsoft

Access version 2.0. Much of this information is taken from the Microsoft

Access 2.0 Help file.

Note that the optimal setting for each item may vary with the type of

computer you run Microsoft Access on. It is usually best to change only one

setting at a time and then monitor database performance for improvement.

MORE INFORMATION

To optimize the general performance of Microsoft Access version 2.0:

 - Use the Add-in Manager to uninstall library databases that contain

   Wizards, builders, and other add-ins you do not want. This

   reduces Microsoft Access memory consumption and load time.

 - Make more memory available by closing applications and terminate-

   and-stay-resident (TSR) programs that you are not using. Usually,

   these applications are loaded from the AUTOEXEC.BAT and

   CONFIG.SYS files.

 - Make sure your Microsoft Windows virtual memory (swap file)

   setting is large enough, and of type "permanent" rather than

   "temporary." In general, the virtual memory setting plus available

   RAM should be no less than 25 MB. It should be more if you will be

   running several memory intensive applications simultaneously.

   To check or change the virtual memory setting, start Microsoft

   Windows Control Panel. Double-click the 386 Enhanced icon, then

   choose Virtual Memory. To change the setting, choose Change. Make

   sure to select Permanent in the Type box. Choose OK to save your

   changes. Please see the Microsoft Windows "User's Guide" for more

   detailed information on virtual memory settings.

 - Periodically run a disk defragmentation utility such as MS-DOS

   version 6.0 Defrag to keep files in contiguous clusters on your hard

   disk, making file access quicker in general. If you do not

   defragment your hard disk, the time it takes for MS-DOS to retrieve

   your files may increase since it may have to go to several physical

   locations on the disk to retrieve the entire file.

 - Use 32-bit disk access, and 32-bit file access in Windows 3.11 and

   later. In Windows Control Panel, click the 386 Enhanced icon,

   choose the Virtual Memory button, then choose the Change button.

   Make sure the Use 32-Bit Disk Access check box is selected. Select the

   Use 32-Bit File Access option, if it is available in your version

   of Windows.

 - Increase the RAM on your computer. Microsoft Access requires a minimum

   of 6 MB, but additional RAM improves performance.

 - Make the WinCacheSize parameter for SMARTDrive (or similar settings

   for other disk caches) in your CONFIG.SYS file no larger than

   necessary for effective caching. For computers with limited RAM,

   try completely disabling software caching such as SMARTDrive.

 - Do not use any of your RAM for a RAM disk.

 - Set the Buffers parameter in your CONFIG.SYS file to at least 40.

 - When you are opening databases that are not in a multiuser environment,

   select the Exclusive check box in the Open Database dialog box.

 - When you are using databases that other users do not need to share,

   install Microsoft Access and all your databases on your local hard disk

   rather than on a network server.

 - Create only as many indexes as necessary. Although indexes can speed

   access to data, it is possible to "over index" a table so that it is

   slow adding, deleting, and updating records.

 - Create indexes for joined fields.

 - In a multiple-field index, use only as many fields in the index as

   necessary.

 - Use Rushmore query optimization in your queries whenever possible. For

   detailed information on how to do this, search for "Rushmore technology"

   then "Optimizing Queries with Rushmore Technology" using the Microsoft

   Access Help menu.

 - If you have a wallpaper (full-screen background) bitmap on your Windows

   desktop, replace it with a solid color or pattern bitmap, or no bitmap

   at all. For a standard VGA display, this can free about 256K of RAM. For

   a 1024 x 768 pixel display with 256 colors, this can free about 750K of

   RAM. (Your actual RAM savings depends on your video display.)

REFERENCES

==========

For more information about optimizing Microsoft Access performance,

search for "optimizing performance" using the Microsoft Access Help menu.

Additional reference words: 2.00 General Speeding Improving


INF: Overview of Conversion Issues from Version 1.1 to 2.0

 Article Number: Q112120

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

When you convert your Microsoft Access version 1.x databases to version 2.0

format, you may have to make some modifications to make sure your databases

will perform correctly.

MORE INFORMATION

There are some differences in the formats of Microsoft Access version 1.x

and version 2.0 databases. These differences may cause unexpected results

when you are using converted databases. Details of the database format

changes from version 1.x to 2.0 are listed in Appendix C of the Microsoft

Access 2.0 "Building Applications" manual.

The Convert Database command on the File menu, available only when you do

not have a database open, can be used to convert databases from version 1.x

format to version 2.0 format. When you convert a database from version 1.x

to version 2.0 format, all database objects are converted. The following

sections describe how the various database objects are converted:

Tables

------

Tables are automatically converted to version 2.0 database format. Tables

that were attached in version 1.x can still be used, but you should refresh

all attachments to take advantage of Microsoft Access 2.0's ability to send

conversion functions (such as CLng(), CStr(), and so on) to the server

rather than processing them locally.

Use the Attachment Manager Add-in in Microsoft Access 2.0 to refresh all

the attachments, rather than deleting and re-attaching each attachment as

in Microsoft Access 1.x. If an attachment is deleted, all the properties

set in the current database for that attachment are lost. To use the

Attachment Manager Add-in, choose Add-ins from the File menu, then choose

Attachment Manager.

Queries

-------

Microsoft Access automatically compiles queries before running them. The

first time you run a query in version 2.0, the compiled format of the query

will be discarded and it will be recompiled. Then, the new compiled format

will automatically be saved.

Forms and Reports

-----------------

Forms and reports are converted temporarily into memory as they are opened.

As a result, you can gain a small performance increase if you open and then

resave all of your pre-existing forms and reports in Microsoft Access

version 2.0, so that Microsoft Access does not have to convert them as you

use them.

Macros

------

Macros are not converted. The format for macros is not changed in

Microsoft Access version 2.0.

Modules

-------

The internal format of modules is changed in Microsoft Access version 2.0.

Version 2.0 automatically converts modules when they are loaded into

memory. However, the converted code is not saved until you save the module.

For that reason, you are prompted to save a converted module the first time

you close it whether you make changes to it or not. If the converted module

is not saved, the conversions are lost. This prompt occurs every time an

unconverted module is closed until you save it.

Default Values and Validation Rules

-----------------------------------

Some default value expressions and validation rules, valid in version

1.x databases, may not be valid in version 2.0 databases.

In Microsoft Access version 2.0, validation rules are evaluated starting at

the table level. Validation rules in forms or elsewhere are evaluated in

addition to table-level validation. At the table level, version 2.0 does

not allow the following in validation rules:

 - User-defined functions

 - Microsoft Access domain functions, such as DCount()

 - Total (aggregate) functions, such as Sum()

 - References to other fields for field validation (for record

   validation, references to other fields in the table are allowed)

 - CurrentUser() or Eval() functions

During the conversion process, a table named ConvertErrors will be

created and filled with descriptions of any default value expressions

or validation rules that were not converted. It may be necessary to

check all data objects for "#Name?" errors.

Changes to Reserved Words and Function Names

--------------------------------------------

There are many new reserved words and function names. "Reserved" means that

the word or function name has special significance to Microsoft Access

version 2.0 and cannot be used as a user-specified control name, function

name, and so on. The Microsoft Access Help system and Appendix C of the

Microsoft Access 2.0 "Building Applications" manual lists new reserved

words. General rules include:

 - Form controls cannot have the name "form." Also, a report control

   cannot have the name "report."

 - Controls in a form or report cannot have the same name as a

   section.

 - Object names that conflict with reserved words can be qualified by

   enclosing the object name with square brackets, such as:

   "[Move].visible" instead of "Move.visible".

SendKeys Action or Statement

----------------------------

If you use the SendKeys statement or action to fill in dialog boxes or

choose commands from menus, the changes in some version 2.0 dialog boxes

and menus may require you to recode the statement. Because changes are

likely to occur with each version of Microsoft Access, it is a good idea to

try to avoid using SendKeys when possible. See Appendix C of the "Building

Applications" manual for tips on avoiding the use of SendKeys.

Security

--------

If a version 1.x database is secured, it will remain secure whether it is

opened using version 1.x or version 2.0. However, Microsoft Access 2.0

cannot be used to change or add permissions in the database, even by the

administrator, until the database is converted to version 2.0.

When you install Microsoft Access 2.0 it creates its own workgroup

file (SYSTEM.MDA). If Microsoft Access version 2.0 is installed in the

same directory as version 1.x, the version 1.x SYSTEM.MDA file will be

renamed SYSTEM1X.MDA.

To make changes to the security of a converted database, you must use a

version 2.0 SYSTEM.MDA that has identical groups and users (and identical

PIDs) as the original SYSTEM.MDA.

NOTE: PIDs (Personal IDs) in Microsoft Access version 2.0 are the

equivalent of PINs (Personal ID Numbers) in version 1.x

How to Create a Secure Workgroup:

1) Use the 2.0 Workgroup Administrator tool to create a new workgroup.

   This is a Version 2.0 SYSTEM.MDA file.

2) Re-create all the users and group accounts using the same names and PID

   numbers that were used in Microsoft Access version 1.x.

How to Convert a Secure 1.x Database to 2.0 Format:

NOTE: In a secure workgroup, only users with Modify Design permissions to

all of the objects can convert a version 1.x format to version 2.0 format.

Also, you must assign Modify Design permissions to the version 1.x database

in Microsoft Access version 1.x using the version 1.x workgroup.

1. Make sure that no one is using the version 1.x database.

2. Log on to Microsoft Access 2.0 as a member of the Admins group who is

   not the Admin user.

3. From the File menu, choose the Convert Database command.

4. Select the version 1.x database you want to convert. You will be

   prompted for the version 2.0 database name.

   NOTE: The Convert Database command will force you to choose a new name

   for the database. This lets you keep a backup copy of your version 1.x

   database, as once you have converted a database from version 1.x to

   version 2.0 you CANNOT convert it back to version 1.x.

5. Have your users join the new version 2.0 workgroup (SYSTEM.MDA) by

   using the Workgroup Administrator tool.

   NOTE: You can also accomplish this by modifying the MSACC20.INI file

   in your Windows directory. In the [Options] section of the file,

   change the SystemDB entry to point to the version 2.0 SYSTEM.MDA

   file. The [Options] section of the file will be similar to the example

   below:

      [Options]

      SystemDB=<microsoft access path>\SYSTEM.MDA

Verifying Conversion

--------------------

To determine if a database was converted from Microsoft Access version 1.x

to version 2.0 with the Convert Database command correctly, check the

V1xNullBehavior property. This property is not available if the database

was converted by Access Basic code. It is available only if the database

was converted using the Convert Database command on the File menu.

The sample function below uses the V1xNullBehavior property to determine if

a database was converted from Microsoft Access version 1.x to version 2.0

with the Convert Database command. The flag variable IsConverted holds the

function's result. If IsConverted is True (-1,) then the database was

converted with the Convert Database command.

   Function IsConverted (checkdb As String)

      On Error GoTo NotFound

      Dim MyDatabase As Database, V1xNull As Integer

      Set MyDatabase = DBEngine.Workspaces(0).OpenDatabase(checkdb)

      V1xNull = MyDatabase.properties.V1xNullBehavior

      IsConverted = True

      MyDatabase.Close

      Exit Function

   NotFound:

      If Err = 3024 Then

         MsgBox "Could not find database."

      Else

         IsConverted = False

         MyDatabase.Close

      End If

      Exit Function

   End Function

To use this function, type the following in a module's Immediate window,

and then press ENTER:

   ? IsConverted("<yourdatabasename>.MDB")

Note that a native version 2.0 database will return a 0 when used with this

function.

To check which version of Microsoft Access a SYSTEM.MDA file was created

with, use the following sample Access Basic function:

   Function CheckSysDbVer (sysdbname As String) As String

      Dim d As Database

      Set d = DBEngine(0).OpenDatabase(sysdbname)

      CheckSysDbVer = d.version

      d.Close

   End Function

To use this function, type the following in a module's Immediate window and

then press ENTER:

   ? CheckSysDbVer("<microsoft access path>\SYSTEM.MDA")

Conversion Errors

-----------------

If the process of converting a 1.x database to version 2.0 results in any

unexpected errors or problems, such as a general protection (GP) fault or

Microsoft Access closing itself, try running the Repair command (from the

File menu) in Microsoft Access version 1.x on the version 1.x database.

Then, try to convert the database again. Some version 1.x databases may

have slight errors that go undetected until you try to convert the database

in version 2.0, because version 2.0 is better at detecting database

problems.

REFERENCES

==========

Microsoft Access "User's Guide," version 2.0, Chapter 1

Microsoft Access "Building Applications," version 2.0, Appendix C

For more information about converting databases, search for "Convert

Database" then "Convert Database Command" using the Microsoft Access Help

menu.

Additional reference words: 2.00 permission upgrading upgrade


INF: Changes in Security in Version 2.0

 Article Number: Q112121

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article describes the changes in the Microsoft Access security model

from version 1.x to version 2.0.

MORE INFORMATION

The security model is essentially unchanged from version 1.x to version

2.0. The following internal items are changed in version 2.0 security:

 - The SID column of the MSysACEs table is no longer directly readable

   through the Microsoft Access user interface. This prevents users

   from directly reading the user SIDs and using them to breach

   security. To view and update permissions, you must use Access Basic.

 - In Microsoft Access version 1.x, users had permission to open any

   database that was not protected by the file system. In Microsoft

   Access version 2.0, there are two new database-level permissions to

   control this: Run/Open and Open Exclusive. You can use the Run/Open

   permission to lock unauthorized users out of your database entirely.

   You can use the Open Exclusive permission to prevent users from

   inadvertently locking each other out of multiuser applications by

   opening the database exclusively.

   As in Microsoft Access 1.x, once a user has opened a database there is

   no way, using the user interface, to prevent that user from creating new

   objects in the database. However, you can use Access Basic code to

   prevent users from creating new tables or queries in a database by

   revoking permissions on the Tables Container object.

 - The Microsoft Access 2.0 Setup program uses only the user and company

   names as seeds for the Admins group's SID. The version 1.x Setup program

   uses the user and company names, as well as the serial number from the

   installation disks.

 - Query permissions can cross database boundaries. This means you can use

   owner's permissions security with attached tables, as well as with local

   tables. The Run With Owner's Permissions query property in version 1.x

   has been replaced in version 2.0 by a query property called

   RunPermissions that can be set to User's or Owner's.

 - There was a known and documented hole in Microsoft Access version 1.x

   security whereby an unauthorized user could read a SID from a database

   and paste it over a SID in the MSysAccounts table in the SystemDB,

   thereby masquerading as a different user. The following changes were

   made to version 2.0 security to correct this problem:

    - System tables in version 2.0 are not updatable.

    - The SID columns in the MSysACEs and MSysObjects tables are

      unreadable in version 2.0.

    - The file encryption algorithm is enhanced. SIDs are readable by

      members of the Admins group only, and are not writable at all in

      version 2.0.

   Microsoft Access version 2.0 can run version 1.x databases, but they are

   still vulnerable to the version 1.x security hole. This is so that sites

   can run a mixed environment, with some users running Microsoft Access

   version 2.0 and others running Microsoft Access version 1.x. Microsoft

   Access version 2.0 cannot make changes to security in a version 1.x

   database unless the database is converted to version 2.0 format.

   Administrators of version 1.x sites that are upgrading to version 2.0

   should be aware that in order to prevent unauthorized users from

   exploiting the version 1.x security hole to break into a secure version

   2.0 system, it is necessary to re-create user and group accounts with

   the new longer PIDs, and to reassign permissions. If this is not done,

   it is possible for an unauthorized user to read a user's SID from an old

   version 1.x copy of the database and paste it over their own account's

   SID using Microsoft Access version 1.x and a version 1.x SystemDB. If

   the users' SIDs are re-created using Microsoft Access version 2.0, there

   is no way for an unauthorized user to ever read a user's SID.

   If you are not concerned about the possibility of an unauthorized user

   exploiting the 1.x security hole to break into a secure version 2.0

   system (perhaps because you are using security only to protect well-

   meaning users from inadvertently destroying data or applications, rather

   than protecting yourself from unauthorized intrusion), then you do not

   need to re-create your user and group accounts. Version 2.0 security

   will work properly with the old SIDs. Although the security in Microsoft

   Access version 2.0 is enhanced to protect your databases from unwanted

   intrusion, Microsoft recommends that you convert your databases to use

   version 2.0 security.

   When you are using the Microsoft Access 2.0 Upgrade disks to upgrade an

   existing version 1.0 or 1.1 installation to version 2.0, a new SystemDB

   is created. The old SystemDB is not changed in any way. If you want to

   use your old SystemDB and your old SIDs, use the Workgroup Administrator

   to join your old workgroup.

 - In Microsoft Access version 1.x, the Guests group is given read

   permissions on all objects by default. In Microsoft Access 2.0, the

   Guests group has no default permissions on newly created objects.

Additional reference words: 2.00 Security


INF: Using Version 1.1 Databases in Version 2.0

 Article Number: Q112122

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article describes several issues involved in using Microsoft Access

version 1.x databases in Microsoft Access version 2.0.

MORE INFORMATION

 - When you open an unconverted Microsoft Access 1.x database in Microsoft

   Access 2.0, you will receive the message:

      Database <database name> was created by a previous version of

      Microsoft Access. You won't be able to save changes made to object

      definitions in this database.

   You cannot make any design changes to database objects created in

   version 1.x until you convert the database to version 2.0. Note that

   database objects may behave differently in version 2.0 because of new

   and changed features.

   You can open and use unconverted databases in version 2.0. However, if

   you want to make design changes to them, use Microsoft Access version

   1.x.

 - You cannot change permissions in version 1.x databases using Microsoft

   Access version 2.0. However, if you use a version 1.x SYSTEM.MDA file

   with Microsoft Access 2.0, the existing security scheme will operate

   properly.

   You can use Microsoft Access version 1.x to make security changes to the

   version 1.x database, but make sure to use the version 1.x SYSTEM.MDA

   file.

 - You can update fields on the one side of a one-to-many join. If you want

   to restrict the updating of fields on the one side, base a form on a

   query and set the Locked properties of the controls bound to the one

   side to Yes. This design change can only be made using version 1.x.

 - A combo or list box displays data as it is formatted in the control's

   underlying table or query. However, if the row source is a SQL SELECT

   statement, no formatting is applied.

   If you want the data in a combo or list box to be formatted, apply a

   format expression to the field in the query.

 - If you attempt to open an object in a version 1.x database whose name

   contains a backquote character (`) in version 2.0, you will receive

   the error message:

      Couldn't find object <objectname>

   While the backquote character (`) is permitted in object names in

   version 1.x, it violates standard naming conventions in version 2.0. In

   addition to the backquote (`), you cannot use a period (.), an

   exclamation point (!), or brackets ([]) in object names in version 2.0.

   Use Microsoft Access 1.x to rename objects in the version 1.x database

   to remove these characters.

 - The CTRL+F4 key combination closes only MDI windows (such as the

   Database window) in version 2.0. Use ALT+F4 to close pop-up windows. In

   Microsoft Access 1.x, CTRL+F4 closes both pop-up windows and MDI

   windows. This behavior is changed in version 2.0 to be consistent with

   Microsoft Windows behavior.

   This means that you should open your version 1.x databases in Microsoft

   Access version 1.x and change all occurrences of {^F4} to {%F4} in all

   SendKeys actions in macros and Access Basic code.

 - SendKeys actions to change menus, dialog boxes and property sheets do

   not necessarily produce the same results in version 2.0 as they do in

   version 1.x, since the File, Edit, Layout, and Format menus are changed

   in version 2.0. The Paste Special, Options and Security dialog boxes are

   changed as well. Several changes and additions to object property sheets

   also affect how SendKeys actions set properties.

   The following items describe how to accommodate these changes:

    - Open your version 1.x databases in Microsoft Access version 1.x and

      replace all SendKeys actions in macros and code that reference

      changed menus with DoMenuItem actions.

    - Set and change security using data access objects (DAO) instead of

      SendKeys. This requires that you first convert the database to

      version 2.0 database format.

    - Set properties at run time instead of using code that opens objects

      in Design view, changes properties, then opens the same objects in

      Form view. This requires that you first convert the database to

      version 2.0 database format.

    - Use the GetOption and SetOptions methods instead of SendKeys to

      change options. This requires that you first convert the database to

      version 2.0 database format.

   Since changes like these can occur with each new version of

   Microsoft Access, it is best to avoid using the SendKeys action

   whenever possible.

 - Tables are the only objects that you can export to a Microsoft Access

   1.x database from a Microsoft Access 2.0 database. You cannot export any

   other object from a version 2.0 database to a version 1.x database.

   Objects in a version 1.x database opened in version 2.0 can be exported

   to a version 2.0 database. However, this process converts those objects

   to version 2.0 objects.

   You can attach a version 1.x table using version 2.0. You cannot attach

   a version 2.0 table using version 1.x.

 - In version 1.x, validation rules for bound controls override validation

   rules for bound fields in the underlying table. In version 2.0, the

   validation rules for the field and bound control are combined.

   For example, in version 1.x, if the field validation rule requires the

   value of a numeric field to be greater than 100, and the validation rule

   for a bound control on a form requires the value to be less than 75, an

   entry of 50 in the bound control is allowed.

   The same entry would not be allowed in version 2.0, since the field and

   bound control validation rules are combined, and there is no number that

   is both less than 75 and greater than 100.

   It is recommended that you review all of your form and field validation

   rules and change them where conflicts occur.

REFERENCES

==========

For more information about converting version 1.x databases to version 2.0

format, search for "Convert Database" then "Convert Database Command" using

the Microsoft Access Help menu.

For more information about DAO, search for "DAO" then "Objects and

Collections Reference" using the Microsoft Access Help menu.

Additional reference words: 2.00 Compatibility Converting


INF: Location of Database Window Different in v. 2.0

 Article Number: Q112123

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

The Database window in Microsoft Access version 2.0 appears in a different

position on the screen than it does in Microsoft Access version 1.x. This

behavior is by design, so that there will be enough room on the left side

of the Database window for a custom toolbar.

This article describes how to use the MoveSize macro action to place the

Database window in version 2.0 in the same position on the screen as it

appears in version 1.x.

MORE INFORMATION

The following steps demonstrate how to use the MoveSize macro action to

position the Database window:

1. Start Microsoft Access version 2.0.

2. Open the sample database NWIND.MDB.

3. Create the following new macro:

      Action

      -----------

      MoveSize

         Right: 0

         Down:  0

4. Save the macro as AutoExec and then close the NWIND database.

5. Open the NWIND database. Note that the Database window opens in the

   upper left corner of the screen.

6. Repeat steps 2-4 for each database in your system.

REFERENCES

==========

For more information about creating AutoExec macros, search for "AutoExec

macro" then "Creating the AutoExec Macro" using the Microsoft Access Help

menu.

Additional reference words: 2.00


INF: Explanation of Compliance Checking Program (CCP)

 Article Number: Q112124

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft offers the cost-saving option for you to upgrade from previous

versions of its products, or to upgrade from a competitive product, for a

decreased price. To ensure that the purchase is a true upgrade or a

competitive upgrade, several Microsoft products run a program called the

Compliance Checking Program (CCP) before running Setup.

MORE INFORMATION

CCP is used by Microsoft Access version 2.0, as well as by other Microsoft

products such as Microsoft Word for Windows and Microsoft Excel. CCP checks

for previously installed software on your system that meets upgrade or

competitive upgrade criteria before you can install the upgrade. (The

restriction criteria vary according to the package you purchase and the

country in which you purchase it. See the product's documentation for

details.)

CCP uses a list of acceptable Microsoft or competitors' products for the

compliance checking. If the CCP program finds one of these products

installed on your system, it allows Setup to continue. If CCP does not find

one of the accepted products in the product list, it asks you to list the

directory where an acceptable product is installed. This includes any

location on a hard disk, CD-ROM, network drive, or floppy disk.

For example, if you purchase and install a Microsoft Access 2.0 upgrade

package to upgrade from Microsoft Access version 1.1 to 2.0, CCP checks for

the presence of Microsoft Access 1.1 on your system before installation can

occur. If you purchase a competitive upgrade package to upgrade from

Borland Paradox version 4.5 for Windows to Microsoft Access 2.0, CCP checks

for the presence of Borland Paradox version 4.5 for Windows on your system

before installation can occur. The back of the upgrade package box

describes how compliance is handled, and lists acceptable competitive

products. On the box, the term "special software" refers to CCP. Otherwise,

the reseller is mentioned.

Different CCP Versions

----------------------

There are two different versions of CCP: Lenient and Strict. Lenient CCP is

used in all U.S. versions of Microsoft Access, while Strict CCP is used in

countries other than the United States.

If Lenient CCP does not find one of the acceptable products in the product

list, it is a restriction violation. However, only a warning is given and

installation does occur.

When Strict CCP perceives a violation, it halts installation with a

violation message stating that installation cannot continue.

very

to

code.

to

disks

it

be

tell

that

DFRUMIN.

Product List

------------

In the United States, an upgrade to Microsoft Access version 2.0 requires

only a previous installation of Microsoft Access version 1.x.

A competitive upgrade in the United States requires a previous installation

of any of the following products:

   Microsoft Access 1.x

   Microsoft Works for Windows 3.0, 2.0a, 2.0 (US, Z, F, G)

   Microsoft Works for MS-DOS 3.0, 2A, 2, 1.5, 1.05, 1.0 (US, Z, F, G)

   Microsoft FoxPro for MS-DOS 2.0, 2.5, 2.5a, 2.5b, 2.6

   Microsoft FoxPro for Windows 2.5, 2.5a, 2.5b, 2.6

   Microsoft Office 4.0-4.2

   Lotus Approach 1.0, 2.0, 2.1

   DataEase for MS-DOS 4.2, 4.5

   DataEase for Windows 1.0, 1.1

   FileMaker Pro for Windows 2.0, 2.1

   Borland dBASE III+ 1.1, IV 1.5, 2.0

   Borland Paradox for MS-DOS 3.5, 4.0, 4.5

   Borland Paradox for Windows 1.0, 4.5

   Symantec Q&A for MS-DOS 2.0, 3.0

   Symantec Q&A for Windows 4.0 (Checking for Q&A or QAWrite)

   Microrim R:Base 2.11, 3.0, 3.1, 4.0, 4.5, 4.5+

   Software Publishing Superbase4 for Windows 1.2,1.3

   Computer Associates Clipper 5.01

   PowerSoft Powerbuilder 3.0

Additional reference words: 2.00 Complying Magic Answer


INF: Using SHARE.EXE and VSHARE.386 with Microsoft Access 2.0

 Article Number: Q112125

 CREATED: 01-MAR-1994

 MODIFIED: 07-APR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access version 2.0 includes a version of VSHARE.386 that is

compatible with Microsoft Windows 3.1, Windows for Workgroups 3.1, and

Windows for Workgroups 3.11.

If you are using applications that support object linking and embedding

(OLE) 2.0, you must run either SHARE.EXE or VSHARE.386. VSHARE.386

eliminates the need for SHARE.EXE when you run Windows 3.1 or Windows for

Workgroups in 386 enhanced mode. If you run Windows 3.1 in standard mode,

you still need to run SHARE.EXE.

MORE INFORMATION

Microsoft Access Setup will automatically install VSHARE.386 by copying

VSHARE.386 into the WINDOWS\SYSTEM directory and adding this line to the

[386Enh] section of the SYSTEM.INI file:

   device=vshare.386

Setup will not automatically remove SHARE.EXE from the AUTOEXEC.BAT file,

since it may still be required by MS-DOS applications running outside of

Windows.

If SHARE.EXE is not required for any applications running in MS-DOS out-

side of Windows, it can be removed from the AUTOEXEC.BAT file to free up

approximate 5K of conventional memory. Leaving SHARE.EXE in the

AUTOEXEC.BAT file will not cause any harm.

If Windows is run in standard mode then SHARE.EXE must be in the

AUTOEXEC.BAT file. Add the following line to the AUTOEXEC.BAT file to

install SHARE.EXE:

   <path>\SHARE.EXE /L:500 /F:5100

In the example above, substitute the drive and directory where the

SHARE.EXE file is located for <path>. For example, if the SHARE.EXE file is

located in the DOS directory on drive C, add the following line to your

AUTOEXEC.BAT file:

   C:\DOS\SHARE.EXE /L:500 /F:5100

After adding SHARE.EXE to the AUTOEXEC.BAT file, restart the computer.

Additional reference words: 2.00 WinIss


INF: "Language Reference" Online Only in Version 2.0

 Article Number: Q112126

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access version 2.0 includes the Microsoft Access "Language

Reference" manual in the Microsoft Access Help system. To view it, choose

Contents from the Help menu, and then click the Language And Technical

Reference icon.

If you want a printed version of the Microsoft Access "Language Reference"

manual, your retail package contains a coupon you can use to order the

manual directly from Microsoft for $9.95 plus $5.00 shipping (plus local

sales tax, if applicable). Send the coupon and payment to:

   Attn: Microsoft Access 2.0 Language Reference

   Microsoft Access for Windows Supplemental Offers

   P.O. Box 3022

   Bothell, WA 98041

Additional reference words: 2.00 Manuals General Documentation book


INF: Converting Graphs from Microsoft Graph Version 3.0 to 5.0

 Article Number: Q112127

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

When you convert a Microsoft Access database from version 1.x to 2.0, your

graphs are not updated automatically from Microsoft Graph version 3.0 to

5.0. This article describes how to convert the graphs in a Microsoft Access

2.0 database to Microsoft Graph version 5.0.

MORE INFORMATION

The following steps describe how to convert your graphs from Microsoft

Graph version 3.0 to 5.0:

1. In Program Manager, double-click the Graph AutoConvert icon in your

   Microsoft Access 2.0 program group.

2. In the AutoConversion dialog box, select the On option button and

   then choose OK.

3. Convert your Microsoft Access version 1.x database to version 2.0.

   For more information about converting databases from version 1.x to

   2.0, search for "converting databases to version 2.0" using the

   Microsoft Access 2.0 Help menu.

4. Open the converted database in Microsoft Access 2.0.

5. Open in Design view a form or report that contains a graph.

6. Double-click the graph object to start Microsoft Graph 5.0.

7. From the File menu, choose Exit & Return To Form: <Form Name>, or

   choose Exit & Return To Report: <Report Name>.

8. Close the form or report. When you are prompted to save your changes,

   choose Yes.

Your graph is now converted to Microsoft Graph version 5.0.

REFERENCES

==========

For more information about Microsoft Graph, search for "graph" using the

Microsoft Access Help menu.

Additional reference words: 2.00 Microsoft Graph 2.0 5.0 convert chart


INF: Using "Name" in Expressions

 Article Number: Q112130

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

All Microsoft Access version 2.0 objects have a Name property, but

Microsoft Access version 1.x objects do not. A Microsoft Access 1.x

database will not run correctly in Microsoft Access 2.0 if you refer to

Name as an ambiguously qualified object in the 1.x database. To correct

this, Microsoft Access treats Name as a special case when you are using a

1.x database.

MORE INFORMATION

With the advent of Microsoft Access 2.0 and data access objects (DAO), all

objects have a Name property. Name is also a very common field name. This

creates a conflict when you are running a 1.x database in Microsoft Access

2.0. When you refer to an ambiguously qualified object, both Microsoft

Access 1.x and 2.0 have a predetermined search path to locate the object.

The search order is as follows:

   Properties, controls, fields

If a field has the same name as a property, the value of the property will

be returned instead of the value of the field. In order to deal with the

new Name property, the search order when referring to Name changes to:

   Controls, fields, properties

Note that this only applies to Name and not to any other property.

Listed below is acceptable ambiguous syntax in Microsoft Access 1.x and

unambiguous syntax in Microsoft Access versions 1.x and 2.0. Microsoft

Access 2.0 will handle the ambiguous syntax correctly when you are using an

Access 1.x database.

Acceptable (Ambiguous) 1.x Syntax

---------------------------------

 - In a text box on a report:

      ControlSource: =[Name]

 - In a macro:

      SetValue

         Item: [Name]

         Expression: UCase([Name])

 - In a DLookup() expression:

      DLookup("[ID]","MyTable","[Name]=Form.Name")

 - In Access Basic using ListTables(), ListFields(), and so on:

      Set MySnap = MyDB.ListTables()

      Debug.Print MySnap.Name

Unambiguous 1.x and 2.0 Syntax

------------------------------

 - In a text box on a report:

      ControlSource: =Report![Name]

 - In a macro:

      SetValue

         Item: Form![Name]

         Expression: UCase(Form![Name])

 - In a DLookup() expression:

      DLookup("[ID]","MyTable","[Name]=Form!Name")

 - In Access Basic using ListTables(), ListFields(), and so on:

      Set MySnap = MyDB.ListTables()

      Debug.Print MySnap!Name

Note the explicit use of the form or report object and the use of the

exclamation point (!) instead of the period (.) to refer to fields. This

tells Microsoft Access to search controls and fields and to ignore

properties. If you use the period (.), properties are assumed and searched

before controls and fields.

Using Naming Conventions

------------------------

Ambiguously referenced objects can also be correctly referenced by using a

naming convention that includes a standard prefix or suffix that can be

attached to object names. For example, ctlName could indicate a control,

and fldName could indicate a field.

Converting to Microsoft Access 2.0

----------------------------------

When you are converting a Microsoft Access 1.x database to 2.0 format, you

must use the unambiguous method to reference fields and controls that have

the same names as properties.

REFERENCES

==========

For more information about identifiers in expressions, search for

"identifiers in expressions" using the Microsoft Access 2.0 Help menu.

Additional reference words: 2.00 DAO


INF: Creating Virtual Indexes with SQL Data-Definition Queries

 Article Number: Q112131

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

If your server supports the creation of SQL views, you can achieve a

compromise between pass-through and Microsoft Access queries by creating a

view on the server and then attaching it. The Microsoft Jet database engine

treats an attached view exactly like an attached table (with no indexes).

The processing defined in a view is always performed by the server, no

matter what the Jet database engine decides to execute locally.

MORE INFORMATION

If your server supports updating through views, you need to create an index

specification on the attachment to tell Microsoft Access which fields

uniquely specify a record returned by the view. This lets the Jet database

engine create an updatable dynaset on the view, and on Microsoft Access

queries and forms that use it.

For example, you could run the Microsoft Access data-definition query

   CREATE UNIQUE INDEX index1 ON SeptemberOrders (OrderID)

on an attached view named SeptemberOrders that returns a subset of the

remote Orders table and has a unique field named OrderID.

This query does not create anything on the server, nor does it take any

extra space in your Microsoft Access database. It simply tells the Jet

database engine that the OrderID field is the primary key for the attached

view. Note that this is not a "real" index in that it does not improve

query performance. It is only used to serve as a reference for the Jet

database engine.

REFERENCES

==========

For more information about data-definition queries, search for "Data

Definition" then "Data Definition Command" using the Microsoft Access Help

menu.

Additional reference words: 2.00 Attaching


INF: Must Save Table to Use Input Mask Wizard

 Article Number: Q112132

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

Before you can use the Microsoft Access Input Mask Wizard in a table, you

must save the table if any changes have been made to it since it was last

saved, or if it has never been saved. If the table has not been saved, you

will be prompted:

   Must save table first. Save now?

MORE INFORMATION

Microsoft Access version 2.0 supports the use of input masks to control the

way data is entered and displayed in a field. An input mask can be used at

the table level or the form level. If you apply an input mask at the table

level with the Input Mask Wizard, you will be prompted to save the table

first. This is necessary because the Input Mask Wizard is written in Access

Basic code, and Access Basic cannot determine whether the table has been

altered. Once the table design is saved, the Input Mask Wizard will begin.

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Open the Customers table in Design view.

3. Add a new field called Home Phone. Accept the default data type and

   size.

4. Click anywhere in the InputMask field property box, and then choose

   the Build button. You will be prompted to save the table. If you choose

   No, the table will not be saved and the Input Mask Wizard will not run.

   If you choose Yes, the table will be saved and the Input Mask Wizard

   will begin.

REFERENCES

==========

Microsoft Access "User's Guide," version 2.0, Chapter 8, "Creating Input

Masks for Data Entry"

For more information about input masks and the Input Mask Wizard, search

for "input mask" then "Adding an Input Mask" using the Microsoft Access

Help menu.

Additional reference words: 2.00 InputMask


INF: Description of Vendor Independent Mail (VIM)

 Article Number: Q112133

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how the Microsoft Access Setup program installs

support for electronic mail (email) applications, and how you can modify

your Windows settings to support one of two different electronic mail

interface protocols: messaging application programming interface (MAPI) or

vendor independent messaging (VIM), which is used by the Lotus cc:Mail

electronic mail application.

MORE INFORMATION

All of the Microsoft Office for Windows applications (Microsoft Access,

Microsoft Word, Microsoft Excel, Microsoft Mail, and Microsoft PowerPoint)

support the MAPI protocol by default. To support VIM electronic mail

systems, the applications use a MAPI-to-VIM translation dynamic-link

library (DLL) called MAPIVIM.DLL. The following diagrams demonstrate the

route Microsoft Access uses when you send electronic mail using either the

Send command from the File menu or the SendObject macro action:

   Sending to Microsoft Mail             Sending to Lotus cc:Mail

   --------------------------            --------------------------

   Send command or SendObject            Send command or SendObject

   macro action                          macro action

       |                                     |

   MAPI.DLL                              MAPIVIM.DLL

       |                                     |

   Microsoft Mail                        VIM.DLL or SMI.DLL

                                             |

                                         cc:Mail

How Microsoft Access Installs Electronic Mail Support

-----------------------------------------------------

1. The Microsoft Access Setup program searches the Windows WIN.INI file for

   the following setting, which indicates that a VIM-compliant email

   application (such as cc:Mail) is installed on your computer:

      [Mail]

      MAPIDLL=<WINDOWS>\SYSTEM\MAPIVIM.DLL

   where <WINDOWS> is the location of your Windows program directory (for

   example, C:\WINDOWS). If Setup finds this setting, it copies the

   MAPIVIM.DLL file to your <WINDOWS>\SYSTEM directory and updates the

   MAPIDLL setting in your WIN.INI file to reflect the location of the new

   MAPIVIM.DLL file.

   If the MAPIDLL setting points to a different .DLL file, Microsoft Office

   applications use the MAPI functions in the specified .DLL instead of

   MAPI.DLL.

2. If Setup does not find the above MAPIDLL setting, it searches the

   WIN.INI file for the following setting, which indicates that a MAPI-

   compliant email application (such as Microsoft Mail) is installed on

   your computer:

      [Mail]

      MAPI=1

   NOTE: If Setup installs MAPI support, it deletes any existing MAPIDLL

   entry from your WIN.INI file.

3. If Setup detects both MAPI and VIM on your system, it prompts you

   to select which messaging system to support.

4. If Setup finds either of the above settings, it adds the email commands

   to the Microsoft Access menus (for example, Setup adds the Send command

   to the File menu).

NOTE: the cc:Mail program directory must be part of your PATH statement. If

it is not, the email commands will not be added to your Microsoft Access

menus.

How to Switch from One Mail System To Another

---------------------------------------------

When you access email from Microsoft Access, Microsoft Access searches

first for the MAPIDLL setting. If found, Microsoft Access supports VIM-

compliant email systems. If not found, Microsoft Access then searches for

the MAPI=1 setting and, if found, supports MAPI-compliant email systems.

If you work on a network that uses both MAPI- and VIM-compliant email

applications, you may want Microsoft Access to be able to switch back and

forth between the two applications. To do this, add both of the above

settings to the [Mail] section of your WIN.INI file. When you want to use a

MAPI-compliant email application, comment the MAPIDLL line to deactivate it

(to comment a line in the WIN.INI file, type a semicolon [;] at the

beginning of the line).

The following sample WIN.INI entries demonstrate this procedure:

To use a MAPI-compliant email program (such as Microsoft Mail), comment the

MAPIDLL line:

   [Mail]

   ;MAPIDLL=<WINDOWS>\SYSTEM\MAPIVIM.DLL

   MAPI=1

To use a VIM-compliant email program (such as cc:Mail), remove the

semicolon (;) from the MAPIDLL line to reactivate it:

   [Mail]

   MAPIDLL=<WINDOWS>\SYSTEM\MAPIVIM.DLL

   MAPI=1

If you want to use VIM-compliant email systems but Microsoft Access did not

install the MAPIVIM.DLL file because there was no MAPIDLL line in the

WIN.INI file, you can install the MAPIVIM.DLL file manually. To do this,

copy the DECOMP.EXE file from disk 1 of your original Microsoft Access

installation disks to your Windows directory. Insert disk 5 (for 3.5-inch

disks) or disk 4 (for 5.25-inch disks) in drive A, and then type the

following command at a DOS prompt:

   c:\windows\decomp.exe a:\mapivim.dl_ c:\windows\system\mapivim.dll

This command will install the MAPIVIMM.DLL file in your WINDOWS\SYSTEM

directory.

REFERENCES

==========

For more information about using cc:Mail with Microsoft Access, query on

the following words here in the Microsoft Knowledge Base:

   cc:mail and mapivim.dll and lotus

cc:Mail is manufactured by Lotus Development Corporation, a vendor

independent of Microsoft; we make no warranty, implied or otherwise,

regarding this product's performance or reliability.

Additional reference words: 2.00


PRB: Cannot Choose Custom Bitmap for Toolbar Button

 Article Number: Q112135

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SYMPTOMS

You cannot add user-designed bitmaps to toolbar buttons in Microsoft

Access version 2.0. Instead, you can only use the 84 predefined bitmaps

that are included with Microsoft Access.

STATUS

This behavior is by design. This feature is being reviewed and will be

considered for revision in a future release of Microsoft Access.

However,

the

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. From the View menu, choose Toolbars.

2. Choose the Customize button.

3. Click the right mouse button on the button in the toolbar whose

   bitmap you want to change.

4. Choose the Choose Button Face command.

You must select a bitmap from the 84 predefined bitmaps; you cannot choose

your own custom bitmap.

Additional reference words: 2.00 UI Limitations


INF: Overview of New Query Features in Version 2.0

 Article Number: Q112136

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article summarizes the new query features and functionality in

Microsoft Access version 2.0. This information can also be found using the

Microsoft Access Help menu by searching for "What's New in Microsoft Access

Version 2.0."

MORE INFORMATION

Rushmore Query Optimization

---------------------------

Microsoft Access uses an optimization method similar to that used by

Microsoft FoxPro to speed up many types of queries.

Automatic Joins for Fields with the Same Name

---------------------------------------------

Even if you have not defined relationships between tables, Microsoft Access

automatically creates joins in a query between tables containing matching

fields.

Greater Updatability of Query Fields

------------------------------------

When a query includes fields from more than one related table, you can

update data on both sides of the join in the same query.

New Query Properties and Property Sheet

---------------------------------------

With the new query properties, you can add input masks and formats to your

queries, and you can limit the number of records displayed to a specified

value. Query properties can be set in the property sheet.

Query Datasheet Formatting

--------------------------

As with tables and forms, you can save your datasheet layout in queries.

For example, if you freeze a column in a query datasheet, you can save the

layout so it will appear the same way when you run the query again.

Subqueries

----------

You can use SQL SELECT statements as subqueries within your expressions in

the Criteria row of the Query window.

Union and Data-Definition Queries

---------------------------------

Using SQL in Microsoft Access, you can create union queries and queries

that create, change, or delete tables and indexes in Microsoft Access

databases. Use the SQL Specific command on the Query menu in a query's

Design view to create these types of queries.

Improved SQL View Window

------------------------

You can enter any SQL statement in the improved SQL View window, including

statements that you cannot create in the query's QBE grid. The menu and the

toolbar buttons are also available when you are working in a SQL View

window.

SQL Pass-Through

----------------

You can pass SQL statements directly to SQL databases, providing improved

connectivity in client-server relationships. You can use SQL pass-through

queries as the source for a query, form, or report.

REFERENCES

==========

For more information about queries, search for "queries: <option>" then

view each of the topics using the Microsoft Access Help menu.

Additional reference words: 2.00


INF: Overview of MS Access Developer's Toolkit (ADT) v. 2.0

 Article Number: Q112137

 CREATED: 01-MAR-1994

 MODIFIED: 07-APR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

 - Microsoft Access Developer's Toolkit version 2.0

---------------------------------------------------------------------

SUMMARY

The Microsoft Access Developer's Toolkit (ADT) version 2.0 is the upgrade

to the Microsoft Access Distribution Kit (ADK) version 1.1, and complements

the retail version of Microsoft Access version 2.0. Developers can use the

ADT to assist them in developing advanced database applications, creating

client/server solutions, and developing Wizards and other add-ins for

Microsoft Access.

MORE INFORMATION

The ADT provides a run-time version of Microsoft Access 2.0 and tools to

assist the developer with the creation and distribution of applications

developed using the retail version of Microsoft Access 2.0. The retail

version of Microsoft Access 2.0 is not included with the ADT, but can be

purchased separately.

The ADT includes a run-time version of Microsoft Graph for distributing

graphs and charts with applications, the Microsoft Windows Help compiler

for creating custom Help files, and a Setup Wizard for creating customized

Setup programs. Code samples for Wizards, functions, and other utilities

are also included and can be copied and pasted directly into applications.

Detailed technical documentation and customization tools are provided,

including the Access Basic "Language Reference" manual, and the


INF: How to Uninstall Microsoft Access Version 2.0

 Article Number: Q112138

 CREATED: 01-MAR-1994

 MODIFIED: 07-APR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access version 2.0 includes commands to uninstall, or remove,

many but not all of its components. This article describes how to remove a

typical, single-user installation of Microsoft Access 2.0 from your hard

disk.

MORE INFORMATION

Before you uninstall Microsoft Access, you should backup any databases (any

.MDB or .MDA files) created in Microsoft Access 2.0. If you implemented any

security in your Microsoft Access 2.0 database system, make sure to backup

the SYSTEM.MDA file.

You might also want to save your data tables in another format, such as

Microsoft Access version 1.x, dBASE IV, or text delimited. The steps for

saving Microsoft Access 2.0 tables in version 1.x format are described

below. For more information on exporting data to other formats, search on

"exporting data: basics" using the Microsoft Access Help menu.

Saving Microsoft Access 2.0 tables in 1.x Format

------------------------------------------------

1. In Microsoft Access 2.0, choose Export from the File menu.

2. In the Data Destination box, select Microsoft Access.

3. Select the table to export, then choose OK.

4. Select a Microsoft Access 1.x database to export the table to.

5. Repeat steps 3 and 4 for each of your tables.

Uninstalling Microsoft Access 2.0

---------------------------------

1. Run Microsoft Access Setup by double-clicking the MS Access Setup icon

   in your Microsoft Access 2.0 program group in Program manager, or by

   running SETUP.EXE from the ACCESS\SETUP directory in File Manager.

2. Choose Remove All. When you are prompted "Are you sure you want to

   remove this application?" choose Yes.

3. If you are prompted to remove shared components for Microsoft Graph

   and MSInfo, choose Keep if you have other applications, such as

   Microsoft Word for Windows or Microsoft Excel, that share these

   applications.

4. After the uninstall process is completed, use File Manager to remove

   your Microsoft Access 2.0 directory and any files it contains.

5. Use File Manager to remove these files from the Windows directory:

      CCARD200.EXE

      MSACC20.INI

6. Use File Manager to remove these files from the WINDOWS\SYSTEM

   directory:

   CAUTION: Many of these files are shared with other Windows applications.

   Do not delete these files if you have other applications, such as

   Microsoft Visual Basic 3.0, Microsoft Excel 5.0, or Microsoft Word 6.0

   for Windows, that share these files with Microsoft Access 2.0.

      BTRV200.DLL

      CCAPI200.DLL

      DAO2016.DLL

      DBNMP3.DLL

      DRVACC2.HLP

      DRVSSRVR.HLP

      MSABC200.DLL

      MSAEXP20.DLL

      MSAJT200.DLL

      MSJETERR.DLL

      MSJETINT.DLL

      OLE2.DLL

      OLE2.REG

      OLE2CONV.DLL

      OLE2DISP.DLL

      OLE2NLS.DLL

      OLE2PROX.DLL

      PBX200.DLL

      SQLSRVR.DLL

      SQORA.DLL

      STORAGE.DLL

      TYPELIB.DLL

      XBS200.DLL

7. Use File Manager to remove these ODBC files from your Windows directory:

   CAUTION: Do not remove ODBC files if other applications, such as

   Microsoft Visual Basic 3.0, Microsoft Excel 5.0, or Microsoft Word 6.0

   for Windows, that share these ODBC files with Microsoft Access 2.0 are

   installed on your computer.

      ODBC.INI

      ODBCINST.INI

8. Use File Manager to remove these ODBC files from the WINDOWS\SYSTEM

   directory:

   CAUTION: Do not remove ODBC files if other applications, such as

   Microsoft Visual Basic 3.0, Microsoft Excel 5.0, or Microsoft Word 6.0

   for Windows, that share these ODBC files with Microsoft Access 2.0 are

   installed on your computer.

      ODBC.DLL

      ODBCADM.EXE

      ODBCADM.HLP

      ODBCINST.DLL

      ODBCINST.HLP

      ODBCJT16.DLL

      ODBCTL16.DLL

9. Remove the ODBC icon from the Windows Control Panel as follows:

   a. Open the CONTROL.INI file located in the Windows directory with

      a text editor such as Windows Notepad.

   b. Under the [MMCPL] section, change the NumApps entry to one less

      than the current number.

   c. Also under the [MMCPL] section, delete the ODBC= line.

   d. Save the CONTROL.INI file and close it.

Additional reference words: 2.00 un-install


INF: List of Constants in Macros and Modules

 Article Number: Q112140

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article lists the contant variables that are in the UTILITY.MDA file.

This list is for reference only; importing these constants would result in

a duplicate definition error.

Additional constants are listed in the CONSTANT.TXT file located in your

Microsoft Access directory. This text file is provided for supplementary

use and can be imported.

MORE INFORMATION

AbcConstants Module from UTILITY.MDA

------------------------------------

NOTE: All of the constants listed below are global constants.

V_EMPTY = 0, V_NULL = 1, V_INTEGER = 2, V_LONG = 3, V_SINGLE = 4

V_DOUBLE = 5, V_CURRENCY = 6, V_DATE = 7, V_STRING = 8

DB_BINARY = 9, DB_OLE = 11, DB_NONULLS = 3

A_TABLE = 0, A_QUERY = 1, A_FORM = 2, A_REPORT = 3, A_MACRO = 4

A_MODULE = 5, A_FORMBAR = 0, A_FILE = 0, A_EDITMENU = 1

A_RECORDSMENU = 3, A_NEW = 0, A_SAVEFORM = 2

A_SAVEFORMAS = 3, A_SAVERECORD = 4, A_UNDO = 0, A_UNDOFIELD = 1

A_CUT = 2, A_COPY = 3, A_PASTE = 4, A_DELETE = 6, A_SELECTRECORD = 7

A_SELECTALLRECORDS = 8, A_OBJECT = 14, A_REFRESH = 2

A_OBJECTVERB = 0, A_OBJECTUPDATE = 3, A_ANYWHERE = 0, A_ENTIRE = 1

A_START = 2, A_UP = 0, A_DOWN = 1, A_CURRENT = 0, A_ALL = 1

A_PREVIOUS = 0, A_NEXT = 1, A_FIRST = 2, A_LAST = 3, A_GOTO = 4

A_NEWREC = 5, A_NORMAL = 0, A_DESIGN = 1, A_PREVIEW = 2, A_FORMDS = 3

A_ADD = 0, A_EDIT = 1, A_READONLY = 2, A_HIDDEN = 1, A_ICON = 2

A_DIALOG = 3, A_PRINTALL = 0, A_SELECTION = 1, A_PAGES = 2

A_HIGH = 0, A_MEDIUM = 1, A_LOW = 2, A_DRAFT = 3, A_PROMPT = 0, A_SAVE = 1

A_EXIT = 2, A_IMPORT = 0, A_EXPORT = 1, A_ATTACH = 2, A_IMPORTDELIM = 0

A_IMPORTFIXED = 1, A_EXPORTDELIM = 2, A_EXPORTFIXED = 3, A_EXPORTMERGE = 4

OLE_CHANGED = 0, OLE_SAVED = 1, OLE_CLOSED = 2, OLE_RENAMED = 3

OLE_RELEASE = 5

SHIFT_MASK = 1, CTRL_MASK = 2, ALT_MASK = 4

LEFT_BUTTON = 1, RIGHT_BUTTON = 2, MIDDLE_BUTTON = 4

DATA_ERRCONTINUE = 0, DATA_ERRDISPLAY = 1, DATA_ERRADDED = 2

LB_INITIALIZE = 0, LB_OPEN = 1, LB_GETROWCOUNT = 3

LB_GETCOLUMNCOUNT = 4, LB_GETCOLUMNWIDTH = 5, LB_GETVALUE = 6

LB_GETFORMAT = 7, LB_CLOSE = 8, LB_END = 9

SYSCMD_INITMETER = 1, SYSCMD_UPDATEMETER = 2, SYSCMD_REMOVEMETER = 3

SYSCMD_SETSTATUS  = 4, SYSCMD_CLEARSTATUS = 5, SYSCMD_RUNTIME = 6

SYSCMD_ACCESSVER = 7, SYSCMD_CLEARHELPTOPIC = 11

OBJSTATE_OPEN = 1, OBJSTATE_NEW = 4, OBJSTATE_DIRTY = 2

A_DELETE_V2 = 7, A_SELECTRECORD_V2 = 8, A_SELECTALLRECORDS_V2 = 9

A_TOOLBAR_YES = 0, A_TOOLBAR_WHERE_APPROP = 1, A_TOOLBAR_NO = 2

DELETE_OK = 0, DELETE_CANCEL = 1, DELETE_USER_CANCEL = 2

Form, Report, Macro and Module Specific Security Constants

----------------------------------------------------------

DB_SEC_FRMRPT_READDEF = &H4&

DB_SEC_FRMRPT_WRITEDEF = &H8& + DB_SEC_FRMRPT_READDEF + DB_SEC_DELETE

DB_SEC_FRMRPT_EXECUTE = &H100&

DB_SEC_MAC_READDEF = &HA&

DB_SEC_MAC_WRITEDEF = &H6& + DB_SEC_DELETE

DB_SEC_MAC_EXECUTE = &H8&

DB_SEC_MOD_READDEF = &H2&

DB_SEC_MOD_WRITEDEF = &H4& + DB_SEC_MOD_READDEF + DB_SEC_DELETE

A_MENU_VER1X = 11, A_MENU_VER20 = 20

A_FORMATRTF = "Rich Text Format (*.rtf)"

A_FORMATXLS = "Microsoft Excel (*.xls)"

A_FORMATTXT = "MS-DOS Text (*.txt)"

DataConstants Module from UTILITY.MDA

-------------------------------------

DB_OPEN_TABLE = 1

DB_OPEN_DYNASET = 2

DB_OPEN_SNAPSHOT = 4

DB_DENYWRITE = &H1

DB_DENYREAD = &H2

DB_READONLY = &H4

DB_APPENDONLY = &H8

DB_INCONSISTENT = &H10

DB_CONSISTENT = &H20

DB_SQLPASSTHROUGH = &H40

DB_FAILONERROR = &H80

DB_FORWARDONLY = &H100

DB_OPTIONINIPATH = 1

DB_FIXEDFIELD = &H1

DB_VARIABLEFIELD = &H2

DB_AUTOINCRFIELD = &H10

DB_UPDATABLEFIELD = &H20

DB_DESCENDING = &H1

DB_BOOLEAN = 1

DB_BYTE = 2

DB_INTEGER = 3

DB_LONG = 4

DB_CURRENCY = 5

DB_SINGLE = 6

DB_DOUBLE = 7

DB_DATE = 8

DB_TEXT = 10

DB_LONGBINARY = 11

DB_MEMO = 12

DB_RELATIONUNIQUE = &H1&

DB_RELATIONDONTENFORCE = &H2&

DB_RELATIONINHERITED = &H4&

DB_RELATIONUPDATECASCADE = &H100&

DB_RELATIONDELETECASCADE = &H1000&

DB_RELATIONLEFT = &H1000000

DB_RELATIONRIGHT = &H2000000

DB_ATTACHEXCLUSIVE = &H10000

DB_ATTACHSAVEPWD = &H20000

DB_SYSTEMOBJECT = &H80000002

DB_ATTACHEDTABLE = &H40000000

DB_ATTACHEDODBC = &H20000000

DB_HIDDENOBJECT = &H1&

DB_TABLE = 1

DB_QUERYDEF = 5

DB_QSELECT = &H0

DB_QACTION = &HF0

DB_QCROSSTAB = &H10

DB_QDELETE = &H20

DB_QUPDATE = &H30

DB_QAPPEND = &H40

DB_QMAKETABLE = &H50

DB_QDDL = &H60

DB_QSQLPASSTHROUGH = &H70

DB_QSETOPERATION = &H80

DB_QSPTBULK = &H90

DB_UNIQUE = 1

DB_PRIMARY = 2

DB_PROHIBITNULL = 4

DB_IGNORENULL = 8

DB_LANG_ARABIC = ";LANGID=0x0401;CP=1256;COUNTRY=0"

DB_LANG_CZECH = ";LANGID=0x0405;CP=1250;COUNTRY=0"

DB_LANG_DUTCH = ";LANGID=0x0413;CP=1252;COUNTRY=0"

DB_LANG_GENERAL = ";LANGID=0x0409;CP=1252;COUNTRY=0"

DB_LANG_GREEK = ";LANGID=0x0408;CP=1253;COUNTRY=0"

DB_LANG_HEBREW = ";LANGID=0x040D;CP=1255;COUNTRY=0"

DB_LANG_HUNGARIAN = ";LANGID=0x040E;CP=1250;COUNTRY=0"

DB_LANG_ICELANDIC = ";LANGID=0x040F;CP=1252;COUNTRY=0"

DB_LANG_NORDIC = ";LANGID=0x041D;CP=1252;COUNTRY=0"

DB_LANG_NORWDAN = ";LANGID=0x0414;CP=1252;COUNTRY=0"

DB_LANG_POLISH = ";LANGID=0x0415;CP=1250;COUNTRY=0"

DB_LANG_CYRILLIC = ";LANGID=0x0419;CP=1251;COUNTRY=0"

DB_LANG_SPANISH = ";LANGID=0x040A;CP=1252;COUNTRY=0"

DB_LANG_SWEDFIN = ";LANGID=0x040B;CP=1252;COUNTRY=0"

DB_LANG_TURKISH = ";LANGID=0x041F;CP=1254;COUNTRY=0"

DB_VERSION10 = 1

DB_ENCRYPT = 2

DB_DECRYPT = 4

DB_VERSION11 = 8

DB_VERSION20 = 16

DB_SORTARABIC = 267

DB_SORTCYRILLIC = 263

DB_SORTCZECH = 264

DB_SORTDUTCH = 259

DB_SORTGENERAL = 256

DB_SORTGREEK = 269

DB_SORTHEBREW = 268

DB_SORTHUNGARIAN = 265

DB_SORTICELANDIC = 262

DB_SORTNORWDAN = 261

DB_SORTPDXINTL = 4096

DB_SORTPDXNOR = 4098

DB_SORTPDXSWE = 4097

DB_SORTPOLISH = 266

DB_SORTSPANISH = 258

DB_SORTSWEDFIN = 260

DB_SORTTURKISH = 270

DB_SORTUNDEFINED = -1

DB_FREELOCKS = 1

DB_SEC_NOACCESS = &H0&

DB_SEC_FULLACCESS = &HFFFFF

DB_SEC_DELETE = &H10000

DB_SEC_READSEC = &H20000

DB_SEC_WRITESEC = &H40000

DB_SEC_WRITEOWNER = &H80000

DB_SEC_DBCREATE = &H1&

DB_SEC_DBOPEN = &H2&

DB_SEC_DBEXCLUSIVE = &H4&

DB_SEC_CREATE = &H1&

DB_SEC_READDEF = &H4&

DB_SEC_WRITEDEF = &H8& Or DB_SEC_READDEF Or DB_SEC_DELETE

DB_SEC_RETRIEVEDATA = &H10& Or DB_SEC_READDEF

DB_SEC_INSERTDATA = &H20&

DB_SEC_REPLACEDATA = &H40&

DB_SEC_DELETEDATA = &H80&

REFERENCES

==========

For more information about constants, search for "constants" then

"Constants" using the Microsoft Access Help menu.

Additional reference words: 2.00


PRB: Counter Starts at 2 in Table Created by Make-Table Query

 Article Number: Q112160

 CREATED: 01-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SYMPTOMS

When you create an empty table with a make-table query and then add

records to the new table, the counter starts at 2 instead of 1.

CAUSE

Microsoft Access provides the first value for auto-increment fields

internally. Since it provided 1 internally for the previous auto-increment

column, the next value is 2, which shows in the new table.

RESOLUTION

Create the table manually, instead of using a make-table query, to start

the counter at 1.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create a new query based on the Employees table.

3. From the Query menu, choose Make Table. Enter "Empty Table" (without

   quotation marks) in the Table Name box, and then choose OK.

4. Drag the Employee ID and Last Name fields to the QBE grid.

5. In the Criteria row for the Employee ID column, enter "<1" (without

   quotation marks).

6. Run the query. A new, empty table called Empty Table will be created.

7. Open the Empty Table table and enter a name in the Last Name field.

   Note that the counter starts at 2 instead of 1.

Additional reference words: 2.00 Queries


INF: How to Determine if the Current Record Is the New Record

 Article Number: Q112292

 CREATED: 06-MAR-1994

 MODIFIED: 10-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SUMMARY

Microsoft Access has no built-in macro action or function to determine

if the current record on the form is the new record. This article

demonstrates a sample function called IsNewRecord() that you can use to

determine whether the current record on the form is the new record.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual.

MORE INFORMATION

To use the IsNewRecord() function, add the following to a new or existing

module:

   '********************************************************************

   ' FUNCTION: IsNewRecord()

   '

   ' PURPOSE:

   '   Determines if the record in the active form is the new record

   '

   ' RETURNS:

   '   True - If the record is the new record

   '   False - If the record is not the new record

   '

   '********************************************************************

   Function IsNewRecord ()

       Const NO_CURRENT_RECORD = 3021

       Dim RetVal

       On Error Resume Next

       ' Try to reference the bookmark property of the current record

       RetVal = Screen.ActiveForm.Bookmark

       If Err = NO_CURRENT_RECORD Then

           IsNewRecord = True

       Else

           IsNewRecord = False

       End If

   End Function

How to Use the IsNewRecord() Function

-------------------------------------

The following example demonstrates how to use the IsNewRecord() function

with the Employees form in the sample database NWIND.MDB to display the

message "In the new record!" whenever you navigate into the new record:

1. Create the following new macro and then save it as CheckForNewRecord:

      Condition       Action      Described Below

      -------------------------------------------

      IsNewRecord()   MsgBox            1.

      CheckForNewRecord Actions

      -------------------------

      1. MsgBox

            Message: "In the new record!"

2. Open the Employees form in Design view.

3. Change the form's OnCurrent property to:

      CheckForNewRecord

Additional reference words: 1.00 1.10


PRB: No Password Prompt Using Microsoft Access .MDB with ODBC

 Article Number: Q112346

 CREATED: 07-MAR-1994

 MODIFIED: 29-MAR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

You are not prompted for a user name and password as you expect when you

are using ODBC from an application such as Microsoft Query (which is

included with Microsoft Excel) to access data in a Microsoft Access

database.

CAUSE

You have not specified a Microsoft Access SYSTEM.MDA file to be used with

the Microsoft Access ODBC data source. The SYSTEM.MDA file contains a list

of users, groups, and passwords.

If you do not specify a SYSTEM.MDA file, ODBC will open your Microsoft

Access database (.MDB) file without a password as a member of the Users

group, with the permissions of the Users group.

RESOLUTION

Edit the Microsoft Access ODBC data source to use the appropriate Microsoft

Access SYSTEM.MDA file. Use the following steps to alter a Microsoft Access

ODBC data source to use a SYSTEM.MDA file:

1. Start Microsoft Windows Control Panel.

2. Double-click the ODBC icon.

3. In the Data Sources box, select the Microsoft Access data source

   you are using, and then choose the Setup button.

4. Choose the Options button.

5. In the System Database box, select the Database option button

   instead of the None option button.

6. Choose the Select Database button.

7. Find and select the appropriate SYSTEM.MDA file. This file will

   probably be in your Microsoft Access directory.

8. Choose the OK button.

MORE INFORMATION

If ODBC opens your Microsoft Access database without a password, this does

not mean that you have circumvented Microsoft Access security.

Microsoft Access employs user-level security on databases, not share-level

security. In user-level security, you grant permissions to users of your

database resources (such as tables and forms). In share-level security, you

password-protect your resources.

If ODBC opens your Microsoft Access database without a password, you will

log on to the database as a member of the Users group and will only have

permissions to objects in the database that are available to members of the

Users group.

If members of the Users group do not have permissions to edit data in a

table, you will not be able to edit that table using ODBC with no

SYSTEM.MDA file specified.

In user-level security, the combinations of users and their permissions

define database security. Information about users, groups, and passwords is

stored in a SYSTEM.MDA file. Information about who has permissions on

database objects is stored with each database in the Microsoft Access

database (.MDB) file.

Passwords are stored in a SYSTEM.MDA file, and are used only to prevent a

user from logging on to a database as another user who has different

permissions on database objects. Members of the Users group may not have

permissions to modify data in tables, but a user with a password may have

permissions to modify data in the tables.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 25, "Administering a

Database System," pages 612-624

Microsoft Access "User's Guide," version 1.1, Chapter 25, "Administering a

Database System," pages 616-633

For more information about security, search for "security: an overview," or

"security: basics" then view each of the topics using the Microsoft Access

Help menu.

For information on the highly recommended "SecurityWizard and White Paper"

Application Note, query on the following words here in the Microsoft

Knowledge Base:

   securitywizard and white and paper

Additional reference words: 1.00 1.10 2.00


PRB: Inconsistent Line Spacing in Summary Reports

 Article Number: Q112723

 CREATED: 17-MAR-1994

 MODIFIED: 18-MAR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you print or preview a summary report (a report with nothing in the

detail section) the line spacing on the report is not consistent.

CAUSE

The height of the detail section isn't exactly 0 inches or centimeters.

RESOLUTION

Use the property sheet to verify that the height of the detail section is

0. If it is not, change the Height property to 0. If the height still does

not become 0, delete any controls in the detail section and then set the

Height property to 0 again.

MORE INFORMATION

You can view the property sheet by choosing Properties from the View menu

when your report is open in Design view. The property sheet's title bar

will indicate which control or section is currently selected.

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Make a copy of the Employee Sales By Country report.

3. Open the copy report in Design view.

4. Delete all the controls from the report's detail and Salesperson

   header sections.

5. Set the height of the detail and Salesperson header sections to 0.01.

6. Preview the report. When you are prompted to enter beginning and

   ending dates for the report, enter "1/1/89" (without quotation marks)

   and "1/1/90" (without quotation marks).

Note that the line spacing on the report is not consistent. If you set the

height of the detail and Salesperson header sections to 0, the line spacing

will be consistent.

Additional reference words: 1.00 1.10 height


INF: How to Speed Up Iterative Processes in Access Basic

 Article Number: Q112724

 CREATED: 17-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

To speed up iterative (looping) processes through large numbers of rows

using Access Basic, declare all field references explicitly.

MORE INFORMATION

The following is an example of Access Basic code that iterates slowly:

   Sub Slow()

      Dim d As Database

      Dim r As Recordset

      Set d = DBEngine.Workspaces(0).Databases(0)

      Set r = d.OpenRecordset("Order Details")

      While Not r.EOF

         r.Edit

         r.Fields("Price") = r.Fields("Qty") * r.Fields("UnitCost")

         r.Update

         r.MoveNext

      Wend

      r.Close

   End Sub

In the example above, the field variable "lookup" (that is, where Access

Basic equates variable names with database fields) for the three field

variables Price, Qty, and UnitCost is performed in the same While loop

where the calculations are performed. In this configuration, both

calculations and lookups must be performed inside the While loop, which is

not an efficient design.

The following is an example of Access Basic code that is more efficient:

   Sub Faster()

      Dim d As Database

      Dim r As Recordset

      Dim Price As Field, Qty As Field, UnitCost As Field

      Set d = DBEngine.Workspaces(0).Databases(0)

      Set r = d.OpenRecordset("Order Detail")

      Set Price = r.Fields("Price")

      Set Qty = r.Fields("Qty")

      Set UnitCost = r.Fields("UnitCost")

      While Not r.EOF

         r.Edit

         Price = Qty * UnitCost

         r.Update

         r.MoveNext

      Wend

      r.Close

    End Sub

This example runs faster because Access Basic performs the field lookup

only once for each field and completes it before executing the loop. A

direct reference to each of the three fields is then stored in the three

field variables Price, Qty, and UnitCost. As a result, no lookup is

required in the While loop, and the field values are accessed and

manipulated directly.

NOTE: The code examples above are only for illustrative purposes. In some

cases, an Update query can be a faster way to accomplish the task. An

example of such a case would be when you need to modify one field based on

another field (or fields). Also, speed differences may be slight for small

numbers of records.

Performance can also be optimized by using the transaction processing

features of Access Basic (BeginTrans, CommitTrans, and Rollback). These

features allow Microsoft Access to cache the information and reduce disk

I/O.

REFERENCES

==========

For more information about transaction processing, search for

"Transactions" then "BeginTrans, CommitTrans, Rollback Methods" using the

Microsoft Access Help menu.

Additional reference words: 2.00 Queries Programming AB


INF: Preventing Users from Adding New Records in Version 2.0

 Article Number: Q112725

 CREATED: 17-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

In Microsoft Access version 2.0, you can use the DefaultEditing property to

prevent users from adding new records, but still allow them to edit

existing records.

MORE INFORMATION

There is a new value for the DefaultEditing property in Microsoft Access

version 2.0 called "Can't Add Records." The following example demonstrates

how to use this value to prevent users from adding new records:

1. Open the sample database NWIND.MDB.

2. Open the Employees form in Design view.

3. If the property sheet is not displayed, display it by choosing

   Properties from the View menu.

4. In the property sheet, select Other Properties.

5. Change the DefaultEditing property to Can't Add Records.

REFERENCES

==========

For more information about the DefaultEditing property, search for

"DefaultEditing" then "AllowEditing, DefaultEditing Properties" using the

Microsoft Access Help menu.

Additional reference words: 2.00 only


INF: Form and Report Modules Have Local Scope

 Article Number: Q112726

 CREATED: 17-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article describes the effect of "scope" on procedures and variables in

form and report modules. Scope refers to the extent to which a given

identifier (a constant, data type, variable, or routine) can be referenced

in a program.

MORE INFORMATION

The procedures and variables defined in a form or report module have local

scope; they do not exist outside of that object. Attempting to call a

function in a form or report module from outside that form or report will

result in a "reference to undefined function or array" error message or

some other "unknown function name..." type of error. A call to a subroutine

from outside the form or report will result in a "syntax error" message.

A reference to one of the form's variables from a different module will

produce unexpected results. Due to the nature of modules and procedures, a

new variable of the same name will be implicitly created with an Empty

value (Variant type 0). If Option Explicit has been specified in the module

that refers to the form's variable, then a "Variable not Defined" compile

error will occur.

When you plan to create a procedure or variable in a form or report module,

first determine that nothing outside of that form or report will need to

know that the procedure or variable exists. Any variable or procedure you

write in a form or report module should be useful to that object only.

If you need to call a procedure from multiple forms or reports, write the

procedure in a global module. Do the same for any variables your code needs

to access from more than one form or report.

The following example demonstrates the scope of a function in a form module

and the errors that can occur:

1. Create a new database.

2. Create the following new form and call it Form1:

     Form: Form1

     -------------------------

     no RecordSource (unbound)

     Form1 Controls

     --------------------------

     command button: Button0

        Caption: Form1_SayHi

        OnClick: =Form1_SayHi()

3. In Form1's Design view, choose Code from the View menu. Form1's

   module will be displayed. Enter the following function in the module:

      Function Form1_SayHi()

        MsgBox "Hi!"

      End Function

4. Create the following new form, and call it Form2:

      Form: Form2

      -------------------------

      no RecordSource (unbound)

      Form2 Controls

      --------------------------

      command button: Button0

         Caption: Form1_SayHi

         OnClick: =Form1_SayHi()

5. From the Database window, create a new module. Enter the following

   function in the module:

      Function Run_Form1_SayHi()

        Run_Form1_SayHi = Form1_SayHi()

      End Function

6. Open both forms. Click the command button on Form1. A message box

   with the text "Hi!" will be displayed. This works because the

   function is in scope in Form1.

7. Click the command button on Form2. An error message will be displayed.

   This is because the function is out of scope for Form2.

8. In the module's Immediate window, type the following and then

   press ENTER:

      ? Run_Form1_SayHi()

The error message "Reference to undefined Function or array" will be

displayed. The error occurs because the function is still out of scope.

Calling the function from anywhere except Form1 will result in an error.

REFERENCES

==========

For more information about form and report modules, look in the Microsoft

Access Help system glossary under "form module" and "report module."

Additional reference words: 2.00


INF: Tips for Improving Combo and List Box Performance

 Article Number: Q112745

 CREATED: 20-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article lists several things you can do to improve the speed and

performance of combo and list boxes in your Microsoft Access version 2.0

applications.

MORE INFORMATION

To improve combo and list box performance:

 - Include only fields from the record source that are absolutely

   necessary. Extra fields can decrease combo or list box performance.

 - Index the first field that is displayed in the combo or list box.

 - Index any other fields used for criteria (such as when a combo or list

   box is based on a criteria query).

 - In combo boxes, set the AutoExpand property to No if it is not needed.

 - Create a default value for combo boxes. Combo boxes try to match

   whatever is entered in them, so if there is no default value for the

   combo box, the combo box tries to match a null value when it is first

   opened. An example of a default value for a combo box is:

      =[combobox].ItemData(0)

   In the example above, [combobox] is the name of the combo box.

 - Use unbound subforms to display data when there is a large number of

   records.

Additional reference words: 2.00 Forms Reports


INF: How to Base Subforms on SQL Pass-Through Queries

 Article Number: Q112746

 CREATED: 20-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to use an SQL pass-through query for a form's

record source. It assumes that you know how to build and use SQL pass-

through queries.

The following considerations should be kept in mind when you are using SQL

pass-through queries for forms' record sources:

 - SQL pass-through query record sources are read-only.

 - The Query Builder does not save the connect string unless you save

   the query.

 - Subforms can use SQL pass-through queries as record sources only if

   you set the record source in the main form's OnLoad property. Subreports

   cannot use SQL pass-through queries as record sources.

MORE INFORMATION

SQL Pass-Through Queries Are Read-Only

--------------------------------------

Forms based on SQL pass-through queries are read-only because SQL pass-

through queries are read-only. The recordset returned by an SQL pass-

through query is a snapshot, or read-only recordset. This behavior is by

design. In order for the form to be updateable, base your form on an

attached table with a unique index.

The Query Builder Does Not Save the Connect String

--------------------------------------------------

The RecordSource property's Query Builder displays a window that looks

similar to a query's Design window. You use this window to build the SQL

string or query for the RecordSource property. The Query Builder will set

the RecordSource property to an SQL string if the SQL string is not saved

as a query. If you save the string as a query, the name of the query will

be used as the RecordSource property.

When you are using an SQL pass-through query created using the Query

Builder, the ODBC connect string defined in that query will not be returned

as part of the RecordSource property SQL string. This can produce the error

message "Couldn't find input table or query '[Table from ODBC Server]'"

because without the ODBC connect string, the form will look for a local

table, instead of a table on the server. If you save the SQL string as a

query, the RecordSource property will contain the name of the query instead

of the SQL string, and the form will be able to retrieve the remote data

correctly.

Subforms Cannot Directly Use SQL Pass-Through Queries as Record Sources

-----------------------------------------------------------------------

The best way to use server-based data in a subform is to attach the remote

table and then base the subform on the attachment.

If you base a subform directly on an SQL pass-through query, you will

receive the following error message when you open the form:

   The crosstab query underlying a subform or subreport must have fixed

   column headings.

If you have to use an SQL pass-through query as a subform's record source,

you can dynamically set the subform's RecordSource property with the main

form's OnLoad event. The following is an example of an OnLoad event

procedure in the main form MainForm that dynamically sets the RecordSource

property in the subform SPTSubForm:

   Sub MainForm_OnLoad

     Me!SPTSubForm.Form.RecordSource = "[<Name of SQL pass-through query>]"

   End Sub

The subform itself should be saved without a RecordSource property.

REFERENCES

==========

For more information about SQL pass-through queries, search for "pass-

through query" then "Creating a Pass-Through Query" using the Microsoft

Access Help menu.

Additional reference words: 2.00


INF: Tips for Improving Subform Performance

 Article Number: Q112747

 CREATED: 20-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article lists several things you can do to improve the speed and

performance of subforms in your Microsoft Access version 2.0 applications.

MORE INFORMATION

To improve subform performance:

 - If you can, base your subforms on queries rather than tables. Include

   only fields from the record source that are absolutely necessary. Extra

   fields can decrease subform performance.

 - Index all the fields on the subform that are linked to the main form.

   Indexes help speed the search process to find the matching subform

   records.

 - Index any fields used for criteria (such as when a subform is

   based on a criteria query).

 - If you are linking on multiple fields, add a calculated field to the

   main form that concatenates the fields. Then, create a calculated column

   in the subform's RecordSource property query with the same expression.

   For example, to link to the subform on an Employee ID field and an

   Order ID field, create a text box on the main form with the following

   properties:

      Name: EmployeeIDOrderID

      ControlSource: =[Employee ID] & [Order ID]

   Next, add the following field to the query that the subform is based

   on:

      EmployeeIDOrderID: [Employee ID] & [Order ID]

   Then, link the main form and the subform on the concatenated field

   rather than on the two individual fields. The subform properties might

   look like:

      LinkChildFields: EmployeeIDOrderID

      LinkMasterFields: EmployeeIDOrderID

   Since Microsoft Access only has to compare one criteria to return

   the subform's recordset, the subform's performance should be improved.

 - Set the subform's DefaultEditing property to ReadOnly if the records

   in the subform are not going to be edited.

REFERENCES

==========

For general performance and indexing recommendations, search for

"performance" and "Rushmore technology" using the Microsoft Access Help

menu.

Additional reference words: 2.00 Forms Subforms Speeding Slow


INF: How to Use In-Place Activation with OLE Objects

 Article Number: Q112748

 CREATED: 20-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access version 2.0 supports in-place activation of OLE objects in

a form's Form view. In a form or report's Design view, or in a table,

query, or form's Datasheet view, activation of an OLE object will cause the

object's original application to run in the background as a server

application (if the original application is available), so you can edit the

object in Microsoft Access.

MORE INFORMATION

In-place activation of an OLE object allows you to edit or otherwise

manipulate the object without switching to the object's original

application. For example, you could edit an embedded document that was

created in Microsoft Word for Windows without having to start Word for

Windows.

When you edit an OLE object in place, the object's border becomes a hatched

frame and the menus and menu options supported by the object's original

application are added to the standard Microsoft Access menus. Tool bars

supported by the object's original application may also be displayed.

The object's original application runs in the background and supplies the

functionality it supports for the object, but the application is not

visible and does not appear in the Windows Task List.

For an OLE object to be activated in place, the following must be true:

 - The object must have been created in an OLE server application

   that supports in-place activation.

 - The object must be displayed in an object frame on a form that

   is open in Form view.

 - The frame's Enabled property must be set to Yes.

If the Locked property is set to Yes, you will be able to edit the object,

but any changes you make will be discarded when the object is deactivated.

If the object is linked, you can activate it in place, but you cannot edit

it in place.

The AutoActivate property controls how an object is activated. The default

value is Double-Click, which allows you to double-click the object to

activate it. If you change this property to GetFocus, the object is

activated as soon as you select or tab to it. If you set the property to

Manual, you have to select the object, choose <object type> from the Edit

menu, and then choose the first verb listed to activate it.

The following is an example of how to create an OLE object that supports in-

place activation:

1. Start Microsoft Access and either create a new database or open one

   of your choosing.

2. Create a new form.

3. Using the Unbound Object Frame tool, create a new frame on the

   form.

4. In the Object Type box, select a server that supports OLE 2.0. For

   this example, choose Microsoft Graph 5.0, and then choose OK.

5. From the Microsoft Graph File menu, choose Exit & Return To Form:

   <Formname>.

6. In Microsoft Access, set the frame's Enabled property to Yes and

   its Locked property to No.

7. View the form in Form view.

8. Double-click the embedded graph. The graph's border will change to

   a hatched frame, and several menus and menu options will change. If

   no Graph 5.0 tool bars are displayed, choose Toolbars from the View

   menu and select one of the tool bar check boxes.

9. Click anywhere in the form outside of the OLE object to deactivate

   the graph.

REFERENCES

==========

For more information on in-place activation and in-place editing search on

"in-place activation" and "in-place editing" using the Microsoft Access

Help menu.

For more information on whether or not a specific object application

supports in-place activation, refer to that application's documentation.

Additional reference words: 2.00 Interoperability OLE Embedding Embed


INF: List of OLE 2.0 Features Supported in MS Access v. 2.0

 Article Number: Q112749

 CREATED: 20-MAR-1994

 MODIFIED: 07-APR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access version 2.0 supports the Object Linking and Embedding

(OLE) specification version 2.0. The OLE 2.0 specification describes a

standard set of interfaces that allow applications to share features.

Applications may provide none, some, or all of this functionality.

MORE INFORMATION

When you install Microsoft Access version 2.0, all the files necessary for

OLE 2.0 functionality are installed and Microsoft Access is registered in

your system as on OLE 2.0 client. If you choose to install Microsoft Graph

during the Microsoft Access installation, it is registered as on OLE 2.0

server application.

Embedding and Linking

---------------------

Objects created in OLE 1.0 and 2.0 servers can be embedded or linked into

Microsoft Access forms, reports, and tables. Microsoft Access supports the

OLE 2.0 standard menus and dialog boxes for inserting and updating objects.

Visual Editing

--------------

Microsoft Access 2.0 supports in-place editing of OLE objects in a form's

Form view. To prevent in-place editing of an embedded OLE object, set the

Enabled property of the object's frame to No. In-place activation is not

available in a form or report's Design view, or in a table, query, or

form's Datasheet view.

Drag and Drop

-------------

Microsoft Access 2.0 does not support Drag and Drop across applications.

Drag and Drop is used in Microsoft Access 2.0 to quickly create macro

actions, new controls, and to customize tool bars.

OLE Automation

--------------

Microsoft Access 2.0 provides full access to the OLE Automation methods

supported by embedded objects through the use of Access Basic.

Context-Sensitive Menus

-----------------------

Context-sensitive menus are used extensively in Microsoft Access 2.0 to

provide shortcuts for commonly used commands. This includes access to an

OLE object's object-specific verb menu when you click the right mouse

button on an OLE object. When an OLE object is activated in place, mouse

clicks are passed to the OLE object. When the object is not active the

mouse clicks are handled by Microsoft Access.

OLE Server

----------

Objects created in Microsoft Access 2.0 cannot be embedded or linked into

other OLE 2.0 applications; Microsoft Access 2.0 is not an OLE 2.0 server.

You can export objects to other Windows applications using a variety of

methods including DDE and the Microsoft Access Export command.

Conversion and Emulation

------------------------

Microsoft Access 2.0 does not have a Convert dialog box. Objects that are

registered to use AutoConversion or Object Type Emulation (also called

"Activate As" or "Treat As") are fully supported by Microsoft Access 2.0.

Relative Links

--------------

Links in OLE 2.0 maintain both a relative link source reference and an

absolute link source reference. You can take advantage of this

functionality in Microsoft Access 2.0, or you can continue to use the OLE

1.0 behavior in which only absolute link source reference information is

saved. This allows users operating in a heterogeneous environment (where

both Microsoft Access 1.x and 2.0 is used) to share databases. This option

is controlled through an entry in the MSACC20.INI file called

AllowOLE1LinkFormat. The default for this entry is 0, which means that all

OLE 2.0 link tracking information (both the relative and absolute link

source references) is maintained and stored.

REFERENCES

==========

For more information about modifying the MSACC20.INI file, search for

"customizing Microsoft Access" then "Customizing MSACC20.INI Settings"

using the Microsoft Access Help menu.

Additional reference words: 2.00


INF: Overview of Version 2.0 Add-Ins, Builders, and Wizards

 Article Number: Q112751

 CREATED: 20-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article is an overview of the add-ins, builders, and Wizards in

Microsoft Access version 2.0. Listed below is the name of each add-in,

builder, and Wizard, and a brief description of its purpose.

MORE INFORMATION

Name                      Description of Purpose

--------------------------------------------------------------------

Add-In Manager            Used to install, uninstall, or customize

                          add-ins, builders, and Wizards.

Add-Ins                   File menu command to control any current

                          add-in, builder, or Wizard.

Archive Query Wizard      Creates a query that will copy records

                          from one table into another, new table.

Attachment Manager        Used to view or refresh the links to

                          attached tables.

AutoDialer                Used by Microsoft Access to dial a

                          selected phone number.

AutoForm                  Creates a form based on the

                          currently selected table or query.

AutoReport                Creates a report based on the

                          currently selected table or query.

Code Builder              Displays the Module window, where you

                          create or modify a procedure for an

                          event.

Color Builder             Creates custom colors, or you can

                          select colors in the palette.

Combo box Wizard          Creates a combo box on a form or report.

Command button Wizard     Creates a command button with built-in

                          bitmaps and code.

Crosstab Query Wizard     Creates a query that will summarize

                          data in row and column format.

Database Documentor       Used to print a list of design elements

                          of your database objects.

Expression Builder        Creates expressions using functions,

                          operators, constants, and so on.

Field Builder             Adds a new field to a table's design

                          from a list of tables and fields.

Find Duplicates           Creates a query that will find duplicate

Query Wizard              records in a table or query.

Find Unmatched            Creates a query to find records that

Query Wizard              do not match in other tables or queries.

Graph Wizard              Creates a form containing a graph or

                          creates a graph in an existing form or

                          report.

Groups/Totals             Creates a report that groups and

Report Wizard             aggregates values in tabular format.

Import Database Add-in    Imports all the objects from another

                          Microsoft Access database.

Input Mask Wizard         Adds an input mask to a field in a

                          table or query or a text box on a form.

List box Wizard           Creates a list box on a form or report.

Macro Builder             Creates a new macro where you select from

                          47 actions for an event.

Mailing Label             Creates a report used to make mailing

Report Wizard             labels.

Main/Subform Wizard       Creates a form based on one or more

                          tables or queries.

Menu Builder              Used to create a menu bar that you can

                          attach to a form or report.

Microsoft Word Mail       Merges Microsoft Access data

Merge Wizard              with a Word for Windows document.

ODBC Connection           Creates a connection string to gain

String Builder            access to a backend server.

Option Group Wizard       Creates an option group on a form or

                          report.

Picture Builder           Used to add a picture to a command

                          button or toggle button.

Query Builder             Design or modify a query that is the

                          source for a form, report, list box,

                          combo box, graph, or object frame.

Single-Column Form        Creates a form that displays the

Wizard                    contents of each record in a column.

Single-Column Report      Creates a report that displays the

Wizard                    contents of each record in a column.

Summary Report Wizard     Similar to the Groups/Totals Report

                          Wizard but without detail lines.

Table Wizard              Assists you in creating a table by

                          offering over 40 sample tables.

Tabular Form Wizard       Creates a form that displays record

                          values in columns from left to right.

Tabular Report Wizard     Creates a report that displays record

                          values in columns from left to right.

Wizards Customizer        Customizes add-ins, builders, and Wizards.

Zoom box                  Zooms the contents of an input area

                          using SHIFT+F2.

REFERENCES

==========

For more information about Microsoft Access 2.0 add-ins, builders, and

Wizards, search for "Wizards: reference" then "Builders, Wizards, and Add-

ins" using the Microsoft Access Help menu.

Additional reference words: 2.00


PRB: Subreport or Subform Data Missing from "Output To" Result

 Article Number: Q112752

 CREATED: 20-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SYMPTOMS

Information in subforms and subreports is missing from files created

with the Output To command in Microsoft Access version 2.0.

CAUSE

The Output To command does not support subforms and subreports.

RESOLUTION

To output forms or reports containing subforms or subreports, open the

subform or subreport as a separate form or report and use the Output To

command to print that form or report independently.

If you must have the subform or subreport print with the main form or

report, you can direct the output to a text file using the Windows Generic

print driver attached to the FILE port.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. Open the Sales Summaries report in Design view.

3. Verify that there are two subreports in the detail section.

4. From the File menu, choose Output To. Select MS-DOS Text (*.txt) as

   the file type and then choose OK.

5. Choose OK.

6. Choose OK when you get the message "The Output To command will not

   process any subreports or subforms contained in your report.

   Proceed anyway?"

7. Open the text file created by the Output To command. It contains only:

      Sales Summaries

      15-Mar-94

      Employee Sales:

      Category Sales:

REFERENCES

==========

For a complete list of the functionality of each file type created by the

Output To command, search for "Output To" using the Microsoft Access Help

menu.

For more information about how to output Microsoft Access forms and reports

to text files, query on the following words here in the Microsoft Knowledge

Base:

   print and file and generic

Additional reference words: 2.00 OutputTo


PRB: "Output To" of Print Definition Contains Only Headers

 Article Number: Q112794

 CREATED: 20-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SYMPTOMS

When you use the Output To command to create an output file from a Print

Definition report, the file contains pages that have only headers. The rest

of each page is blank.

CAUSE

All the information in Print Definition reports, except for the header, is

contained in subreports. The Output To command does not support subforms or

subreports. Print Definition reports cannot be saved because they are

created temporarily in a library database.

RESOLUTION

You can work around this design limitation by saving the Print Definition

report as a table, or by printing it to a file. Both of these methods are

described below.

Saving the Print Definition Report as a Table

---------------------------------------------

When you preview a Print Definition report, the Save As Table command is

available in the File menu. Choosing this command saves the contents of the

Print Definition report as a table named Object Definition. If a table

already exists with this name, the new table is named Object Definition1.

You can create your own queries and reports on the Object Definition table

to analyze the structure of your database objects.

Printing the Print Definition Report to a File

----------------------------------------------

To print the Print Definition report to a file, open the report and use the

Output To command to print it to a text file using the Windows Generic

print driver attached to the FILE port.

For more information about how to print to a text file using the Windows

Generic printer, query on the following words here in the Microsoft

Knowledge Base:

   print and file and generic

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. In the Database window, select the Shippers table.

3. From the File menu, choose Print Definition, then choose OK.

4. Choose either the Publish It With MS Word or the Analyze It With

   MS Excel button on the tool bar.

   NOTE: If you do not have either Microsoft Word for Windows or

   Microsoft Excel installed on your computer, you can add a button to

   the tool bar to output text files. To do this, click the right mouse

   button on the tool bar, choose Customize, choose File in the

   Categories box, and then drag the Output To Notepad button to the

   tool bar.

The file that is output will contain text similar to the following:

   C:\ACCESS\SAMPAPPS\NWIND.MDB            Friday, April 1,  1994

   Table: Shippers                                        Page: 1

Note that the page is blank except for the header.

REFERENCES

==========

For more information about the Output To command, search for "Output To"

then "Output To Command" using the Microsoft Access Help menu.

Additional reference words: 2.00 Printing OutputTo Output To


INF: List of New 2.0 Form/Report Events, Methods, & Properties

 Article Number: Q112795

 CREATED: 20-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article lists the many new events, methods, and properties for both

forms and reports in Microsoft Access version 2.0.

MORE INFORMATION

NAME                    TYPE                  APPLIES TO REPORTS

------------------------------------------------------------------

Action                    Property                   X

Activate                  Event                      X

AfterDelConfirm           Property, PS, Event

AfterInsert               Property, PS, Event

Append                    Method

AutoActivate              Property, PS

AutoCenter                Property, PS

AutoExpand                Property, PS

AutoTab                   Property, PS

BeforeDelConfirm          Event

BeforeInsert              Property, PS

BorderLineStyle           Property, PS               X

Change                    Event

Class                     Property, PS

ColumnHidden              Property, PS

ColumnOrder               Property

ColumnWidth               Property

ControlBox                Property, PS

CreateDatabase            Method

CreateObject              Method

CurrentView               Property

CurrentSectionLeft        Property

CurrentSectionTop         Property

CurrentView               Property

DatasheetFontHeight       Property

DatasheetFontItalic       Property

DatasheetFontName         Property

DatasheetFontUnderline    Property

DatasheetFontWeight       Property

Deactivate                Event                      X

Delete (Recordset)        Method

Dirty                     Property

DisplayType               Property, PS               X

Echo                      Method

EnterKeyBehavior          Property, PS

Error                     Event                      X

EventProcPrefix           Property                   X

Execute (QueryDef)        Method

FastLaserPrinting         Property, PS               X

FieldSize                 Method

FillCache                 Method

FrozenColumns             Property

GetObject                 Method

GetOption                 Method

GotFocus                  Event

GotoPage                  Method

Idle                      Method

InputMask                 Property, PS               X

InSelection               Property

InsertText                Method

ItemData                  Method

KeepTogether - Groups     Property, PS

KeyDown                   Event

KeyPress                  Event

KeyUp                     Event

ListCount                 Property                   X

ListIndex                 Property                   X

Load                      Event

LostFocus                 Event

lpOleObject               Property                   X

MaxButton                 Property, PS

Me                        Property                   X

MenuBar                   Property, PS               X

MinButton                 Property, PS

Module                    Property                   X

MouseDown                 Event

MouseMove                 Event

MouseUp                   Event

Move                      Method

Name                      Property, PS               X

NavigationButtons         Property, PS               X

NewPassword               Method

NotInList                 Event

Object                    Property                   X

ObjectPalette             Property                   X

ObjectVerbs               Property                   X

ObjectVerbsCount          Property                   X

OleType                   Property, PS               X

OleTypeAllowed            Property, PS               X

OnActivate                Property, PS               X

OnChange                  Property, PS

OnClick (replaces         Property, PS

         OnPush property)

OnDeactivate              Property, PS               X

OnError                   Property, PS               X

OnGotFocus                Property, PS

OnKeyDown                 Property, PS

OnKeyPress                Property, PS

OnKeyUp                   Property, PS

OnLoad                    Property, PS               X

OnLostFocus               Property, PS

OnMouseDown               Property, PS

OnMouseMove               Property, PS

OnMouseUp                 Property, PS

OnNotInList               Property, PS

OnResize                  Property, PS

OnTimer                   Property, PS

OnUnload                  Property, PS

OnUpdated                 Property, PS

OpenArgs                  Property

OpenDatabase              Method

OpenRecordset             Method

OpenRecordset (Database)  Method

Pages                     Property                   X

PaintPalette              Property                   X

PaletteSource             Property, PS               X

Quit                      Method

Recalc                    Method

RecordsetClone            Property

Refresh                   Method

Refresh (DAO)             Method

RefreshLink               Method

RegisterDatabase          Method

Repaint                   Method

RepairDatabase            Method

Requery                   Method

Requery (DAO)             Method

Resize                    Event

SelLength                 Property

SelStart                  Property

SelText                   Property

SetFocus                  Method

SetOption                 Method

ShortcutMenu              Property

SizeMode                  Property, PS              X

SourceDoc                 Property, PS              X

SourceItem                Property, PS              X

TabIndex                  Property, PS

TabStop                   Property, PS

Tag                       Property, PS              X

Text                      Property                  X

Timer                     Event

TimerInterval             Property, PS

Updated                   Event

UpdateOptions             Property, PS              X

Value                     Property                  X

Verb                      Property, PS              X

WindowHeight              Property                  X

WindowWidth               Property                  X

REFERENCES

==========

For more information about form properties, search for "properties: forms"

then "Form Properties" using the Microsoft Access Help menu.

For more information about report properties, search for "properties:

reports" then "Report Properties" using the Microsoft Access Help menu.

Additional reference words: 2.00 Forms Reports


INF: How to Filter a Subform by Changing the Record Source

 Article Number: Q112796

 CREATED: 20-MAR-1994

 MODIFIED: 27-MAR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

The ApplyFilter action cannot be used with a subform. In Microsoft Access

version 1.x, some of this functionality could be achieved by basing the

subform on a parameter query. In Microsoft Access version 2.0, however, you

can achieve this by changing the subform's RecordSource property.

MORE INFORMATION

The ApplyFilter action is used to dynamically restrict or sort the records

in a table, or the records from a form or report's underlying table or

query. Although you cannot use this action with a subform, you can

accomplish the same thing by changing the subform's RecordSource property.

The following example demonstrates how to dynamically change the sort order

of the Categories Subform subform in the sample database NWIND.MDB:

1. In the NWIND database, create a new query based on the Products table.

   Include all the fields from the table in the query.

2. Set the Sort row of the Unit Price column to Ascending.

3. Save the query as Unit Price Sort.

4. Open the Categories form in Design view, and add a command button

   to it.

5. Set the command button's OnClick property to the following:

      If Me![Categories Subform].Form.RecordSource = "Products" Then

         Me![Categories Subform].Form.RecordSource = "Unit Price Sort"

      Else

         Me![Categories Subform].Form.RecordSource = "Products"

      End If

6. View the Categories form in Form view.

7. Choose the command button you added in step 4.

The form's sort order will toggle between the Unit Price and the Product ID

fields as you choose the command button.

REFERENCES

==========

For more information about how to use the RecordSource property, search for

"RecordSource" then "Changing a Form or Report's Underlying Table or Query"

using the Microsoft Access Help menu.

Additional reference words: 2.00


PRB: Report Property PageFooter Set to "Not With Rpt Ftr"

 Article Number: Q113297

 CREATED: 31-MAR-1994

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

When you set a report's PageFooter property to Not With Rpt Ftr, the page

footer still prints on the last page of the report with the report footer.

CAUSE

The PageFooter property, if set to Not With Rpt Ftr, was designed to not

print the page footer if the report footer is the first section printed on

the report.

Note that the PageHeader property works similarly. The PageHeader property,

if set to Not With Rpt Ftr, was designed to not print the page header if

the report footer is the first section printed on the page.

RESOLUTION

Setting the report's PageFooter property to Not With Rpt Ftr alone

will not prevent the page footer from printing with the report footer.

To keep the page footer from printing with the report footer, set the

report footer property ForceNewPage to Before Section. Or, if the

PageHeader property is set to Not With Rpt Ftr, the report footer section

will be forced to a new page, and no page footer section will print.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

 1. Open the sample database NWIND.MDB.

 2. Open the Alphabetical List Of Products report in Design view.

 3. From the View menu, choose Properties.

 4. Set the report's PageFooter property to Not With Rpt Ftr.

 5. Add a label control with the text "My Report Ftr" to the report

    footer section.

 6. From the File menu, choose Print Preview.

 7. Move to the last page of the report. Note that both the report footer

    and the page footer (page number) are printed.

 8. Choose the Cancel button on the toolbar.

 9. Change the report footer property ForceNewPage to Before Section.

10. From the File menu, choose Print Preview. Move to the last page

    of the report. Note that the report footer is printed on a new

    page, without the page footer.

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 18, "Designing

Reports," page 445

Microsoft Access "User's Guide," version 1.1, Chapter 18, "Designing

Reports," page 449

Additional reference words: 1.00 1.10 report footer


PRB: Unknown Reference or Function in Validation Expression

 Article Number: Q113298

 CREATED: 31-MAR-1994

 MODIFIED: 01-APR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SYMPTOMS

When you try to save a table that has a field name, control name, or user-

defined function in a validation rule or default value, you receive the

error message:

   Unknown or invalid reference '<field>' in validation

   expression or default value in table '<Table>'.

   -or-

   Unknown function '<function>' in validation expression or

   default value in '<Table>'.

CAUSE

Validation rules are enforced by the Microsoft Access Jet database engine

in Microsoft Access version 2.0. There are some rules allowed in Microsoft

Access versions 1.0 and 1.1 that are not allowed at the field level in

Microsoft Access 2.0. In version 2.0, validation rules at the field level

cannot refer to other fields (whether in the current table or another

table), controls on a form, or user-defined functions.

RESOLUTION

To get the validation rule you want, create the rule at the table level

instead of the field level. Note that validation rules on a form can refer

to other controls on the form.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access and either create a new database or open one

   of your choosing.

2. Create a new table.

3. Add two text fields named ABC and DEF to the table.

3. Set the ValidationRule property of the DEF control to:

      <[ABC]

4. Save the table (do not define a primary key). You will receive one of

   the error messages stated above.

Additional reference words: 2.00 Tables


PRB: Invalid Table Name Error with TransferSpreadsheet Action

 Article Number: Q113299

 CREATED: 31-MAR-1994

 MODIFIED: 01-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

When you pass a long (more than 64 characters) SQL string as an argument to

the TransferSpreadsheet action, you receive the error message:

   Invalid Table Name

CAUSE

SQL strings passed directly to the TransferSpreadsheet action cannot be

longer than 64 characters. Characters beyond 64 will be truncated. The

TransferSpreadsheet action was not designed to handle SQL strings, although

they will work if 64 characters or less.

RESOLUTION

Create a query using your SQL string and export that query using the

TransferSpreadsheet action.

MORE INFORMATION

NOTE: In the following sample code, an underscore (_) is used as a line-

continuation character. Remove the underscore when re-creating this code in

Access Basic.

The following example demonstrates a SQL string that can be passed to the

TransferSpreadsheet action:

   Function Xfer ()

      DoCmd TransferSpreadsheet a_export, 0, "Select * from_

       transactions where [tradedate] <= #01-01-93# ;",_

       "C:\EXCEL\TEST.XLS"

   End Function

The next example demonstrates a SQL string that cannot be successfully

passed to the TransferSpreadsheet action:

   Function Xfer ()

      DoCmd TransferSpreadsheet a_export, 0, "Select * from_

       transactions where [tradedate] between #01-01-93# and_

       #7-24-93#;","C:\EXCEL\EARL.XLS"

   End Function

If you copy the SQL statement in the example above and paste it into a

query, the query will run correctly.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.1, "TransferDatabase

Action," pages 473-476

Additional reference words: 1.00 1.10 2.00 AB Queries


INF: How to Use DDE to Pass Information to MS Access v. 2.0

 Article Number: Q113300

 CREATED: 31-MAR-1994

 MODIFIED: 07-APR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

In Microsoft Access, you cannot poke data into a table using a dynamic data

exchange (DDE) channel. However, you can pass information to an Access

Basic function using a function with parameters in a DDE channel to the SQL

topic. The data can then be processed by the function and added to a table.

MORE INFORMATION

The following example demonstrates how to add a new customer to the

Customers table in the sample database NWIND.MDB using data from Microsoft

Excel and Microsoft Word for Windows:

1. Create a table called None with one field of any data type, with

   one record.

2. Open a module and create a function with the parameters that

   you want to pass. The following Access Basic function will create

   a new record in the Customers table, and accepts an argument for

   the Customer ID field and an argument for the Company Name field:

      Declarations Section

         Option Explicit

      Function AddNewCust (CustomerID$, CompanyName$)

         Dim MyDB As Database, MyTable As Recordset

         Set MyDB = DBEngine.Workspaces(0).Databases(0)

         ' Trap any error that might occur.

         On Error Resume Next

         ' Open table.

         Set MyTable = MyDB.OpenRecordset("Customers", DB_OPEN_TABLE)

         MyTable.AddNew                             ' Prepare new record.

         MyTable("Customer ID") = CustomerID$       ' Set record key.

         MyTable("Company Name") = CompanyName$     ' Set company name.

         MyTable.Update                             ' Save changes.

         MyTable.Close                              ' Close table.

         ' Return the error code.

         AddNewCust = Err

      End Function

   This function will return 0 if successful, otherwise a Microsoft Access

   error number will be returned. If a record in the Customers table

   already exists with the specified Customer ID, error number 3022 will be

   returned. This error would return the following error message if it

   were not trapped:

      Duplicate value in index, primary key, or relationship.

      Changes were unsuccessful.

3. In the DDE client application, initiate a DDE link using MSACCESS

   as the application and a SQL select query as the topic. The topic

   should be of the form:

      DatabaseName;SQL Select FunctionName(args) From None;

   In the sample topic above, None is the name of the empty table, and

   FunctionName(args) is the call to the Access Basic function that

   processes the arguments (args) passed to it.

   For example, the following Microsoft Excel macro will insert a new

   record with "JOHNJ" as the Customer ID and "John's Place" as the Company

   Name into the Customers table:

   NOTE: In the following sample code, an underscore (_) is used as a

   line-continuation character. Remove the underscore when re-creating

   this code.

      AddNewCustomer

      chan=INITIATE("MSACCESS","NWIND;SQL SELECT _

         AddNewCust(""JOHNJ"",""John's Place"") FROM None;")

      =ALERT(REQUEST(chan,"FirstRow"))

      =TERMINATE(chan)

      =RETURN()

   The following is the equivalent Microsoft Excel Visual Basic

   function:

      Function AddNewCustomer()

         Chan = DDEInitiate("MSACCESS", "NWIND;SQL SELECT _

            AddNewCust(""TADO"",""Tad's Place"") FROM None;")

         Result = DDERequest(Chan, "FirstRow")

         MsgBox Result(1)

         DDETerminate Chan

      End Function

   The following is the equivalent Microsoft Word for Windows Word

   Basic macro:

      Sub MAIN

         qt$ = Chr$(34) ' create the quote character

         Funct$ = "AddNewCust(" + qt$ + "JOHNJ" + qt$ + "," + qt$ + _

            "John's Place" + qt$ + ")"

         Chan = DDEInitiate("MSACCESS", "NWIND;SQL SELECT " + Funct$ + _

            " FROM None;")

         Result$ = DDERequest$(Chan, "FirstRow")

         MsgBox Result$

         DDETerminate Chan

      End Sub

How the SQL Initiate Technique Works

------------------------------------

When you initiate a DDE link with Microsoft Access using an SQL statement,

each function in the SELECT statement will run one time for each record in

the table the query selects from.

In the examples above, the None table has only one record to query against.

Since the table has only one record, the AddNewCust() function runs only

one time. If the None table had two records, the AddNewCust() function

would run twice, trying to add the same record two times.

The query's result will return the results of the function being called in

the SELECT statement. The AddNewCust() function returns the error code if

an error occurs. This is useful so that the DDE client, such as Microsoft

Excel, Word, or Visual Basic, can know whether the function ran

successfully or not.

REFERENCES

==========

For more information, search for "DDE" then "Using Microsoft Access as a

DDE Server" using the Microsoft Access Help menu.

Additional reference words: ddepoke


PRA: Words Split When CanGrow=Yes and KeepTogether=No

 Article Number: Q113301

 CREATED: 31-MAR-1994

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

The Report Wizard splits a text box in the middle of a word instead of

between lines.

CAUSE

This problem can occur if the following conditions are all met:

 - The first line of a multiple-line text box is the last line that will

   fit on the page.

 - The text box's CanGrow property is set to Yes.

 - The section's CanGrow property is set to Yes.

 - The section's KeepTogether property is set to No.

RESOLUTION

Set the text box's height to two lines, and set its CanShrink property to

Yes. The Report Wizard will not split a control into a size smaller than

its size in Design view.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions

1.0, 1.1, and 2.0. We are researching this problem and will post new

information here in the Microsoft Knowledge Base as it becomes available.

Additional reference words: 1.00 1.10 2.00


INF: New Events and Properties in Microsoft Access v. 2.0

 Article Number: Q113302

 CREATED: 31-MAR-1994

 MODIFIED: 11-APR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

Microsoft Access version 2.0 has many new events and properties. The new

events and properties are listed below in alphabetical order.

MORE INFORMATION

- A -

Action                           Attributes

AfterDelConfirm                  AutoActivate

AfterInsert                      AutoCenter

Alias                            AutoExpand

AllowZeroLength                  AutoTab

AllowZeroLength (Data Access)

- B -

BeforeDel                        Bookmark (Data Access)

BeforeInsert                     BorderLineStyle

- C -

CacheSize                        Container

CacheStart                       ControlBox

Class                            Count (Data Access)

Clustered                        CurrentObjectName

CollatingOrder                   CurrentObjectType

ColumnHeadings                   CurrentSectionLeft

ColumnHidden                     CurrentSectionTop

ColumnOrder                      CurrentView

Connect

- D -

DatasheetFontHeight              DefaultValue (Data Access)

DatasheetFontItalic              DestConnectStr

DatasheetName                    DestinationDB

DatasheetUnderline               DestinationTable

DatasheetWeight                  Dirty

DataUpdatable                    DisplayType

DateGrouping

- E -

EnterKeyBehavior                 EventProcPrefix

- F -

FastLaserPrinting                ForeignTable

Foreign                          FrozenColumns

ForeignName

- G,H,I,J,K -

IgnoreNulls                      InputMask

IgnoreNulls (Data Access)        InSelection

Inherited                        KeepTogether - Groups

- L -

LastModified                     LoginTimeout

ListCount                        LogMessages

ListIndex                        lpOLEObject

- M -

MaxButton                        MinButton

Me                               Module

MenuBar

- N -

Name                             NavigationButtons

Name (Data Access)

- O -

Object                           OnKeyPress

ObjectPalette                    OnKeyUp

ObjectVerbs                      OnLoad

ObjectVerbsCount                 OnLostFocus

ODBCConnectStr                   OnMouseDown

ODBCTimeout                      OnMouseMove

ODBCTimeout (Data Access)        OnMouseUp

OLEType                          OnNotInList

OLETypeAllowed                   OnResize

OnActivate                       OnRetreat

OnChange                         OnTimer

OnClick                          OnUnload

OnDeactivate                     OnUpdated

OnError                          OpenArgs

OnGotFocus                       OrdinalPosition

OnKeyDown                        OutputAllFields

Owner

- P -

Pages                            PID

PaintPalette                     PreviousControl

PaletteSource                    Primary

Password                         Primary (Data Access)

PercentPosition                  PrtDevNames

Permissions

- Q,R -

QueryTimeout                     ReturnsRecords

Required                         ReturnsRecords (Data Access)

Required (Data Access)           RowHeight

Restartable                      RunPermissions

- S -

SelLength                        SourceConnectStr

SelStart                         SourceDatabase

SelText                          SourceDoc

ShortcutMenu                     SourceField

Size                             SourceItem

SizeMode                         SourceTable

Source                           SourceTableName

- T -

TabIndex                         Text

Table                            TimerInterval

TabStop                          TopValues

Tag                              Type

- U -

Unique                           UniqueValues

Unique (Data Access)             UpdateOptions

UniqueRecords                    UserName

- V -

V1xNullBehavior                  Value

ValidateOnSet                    Value (Data Access)

ValidationRule (Data Access)     Verb

ValidationText (Data Access)     Version

- W,X,Y,Z -

WindowHeight                     WindowWidth

REFERENCES

==========

For more information on new events and properties in Microsoft Access

version 2.0, search for "What's New in Microsoft Access version 2.0," and

"properties: reference" using the Microsoft Access Help menu.

Additional reference words: 2.00 PtrIss forms reports


PRB: MS Access Converts Extended Chars in Attached FoxPro DBF

 Article Number: Q113303

 CREATED: 31-MAR-1994

 MODIFIED: 01-APR-1994

 VERSION(S): 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.1 and 2.0

 - FoxPro for Windows versions 2.5a and 2.5b

---------------------------------------------------------------------

SYMPTOMS

Extended characters (ANSI characters greater than 128) that you enter in an

attached FoxPro table are converted to other characters when you commit the

record.

CAUSE

The ISAM that Microsoft Access uses to attach FoxPro databases reads a Code

Page flag in the header of the FoxPro database. This flag tells the ISAM

how to handle OEM to ANSI conversions. In this case, the flag is set to

convert ANSI characters to OEM characters.

RESOLUTION

To correct this problem, add the following line to the FoxPro configuration

file CONFIG.FPW:

   CODEPAGE=AUTO

This line tells the ISAM not to perform ANSI to OEM conversions.

MORE INFORMATION

The resolution above will not correct character conversions that were made

prior to your changing the CONFIG.FPW file. To correct conversions that

have already been made, port the data from the existing FoxPro database to

a new FoxPro database. Consult the FoxPro documentation for information on

how to port data from an existing database to a new database.

REFERENCES

==========

Microsoft Access "Language Reference," version 1.1, Appendix A, page 505

Additional reference words: 1.10 2.00


INF: How to Create a Custom Toolbar Using a Form

 Article Number: Q113304

 CREATED: 31-MAR-1994

 MODIFIED: 01-APR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to create a custom, floating toolbar using a

Microsoft Access form. Using a form for a custom toolbar provides the

following advantages:

 - Labels, combo boxes and list boxes can be placed on the toolbar.

 - Buttons with custom bitmaps can be placed on the toolbar.

 - You can prevent users from closing or moving the toolbar.

 - You can take advantage of code behind forms to store the code being

   used by the controls on the toolbar with the toolbar itself.

 - You can disable the shortcut menus from being used on the toolbar.

MORE INFORMATION

The example below demonstrates how to create a custom, floating toolbar

that has buttons to find, save, delete, and undo a record, as well as

buttons to navigate among the records, including buttons to go to the first

record, go to the previous record, go to the next record, go to the last

record, and add a new record.

 1. Open the sample database NWIND.MDB and create a new, blank form.

 2. Set the following form-level properties:

       Caption: Tool bar

       ShortcutMenu: No

       ScrollBars: Neither

       RecordSelectors: No

       NavigationButtons: No

       PopUp: Yes

       BorderStyle: Dialog

       MinButton: No

       MaxButton: No

 3. Activate the toolbox by choosing Toolbox from the View menu. Make sure

    the Wizard button is chosen (the button should appear sunken).

 4. Choose the command button tool, and then click anywhere in the form.

 5. In the Categories box, select Record Navigation. In the When Button Is

    Pressed box, select Find Record. Choose Finish.

 6. Drag the new button to the upper left corner of the detail section.

 7. Repeat steps 4-6 to create the other buttons for the toolbar. Use the

    following selection combinations from the Categories and the When

    Button Is Pressed boxes. Move each of the new buttons directly to the

    right of the button before it.

       Categories             When button Is Pressed

       ---------------------------------------------

       Record Operations      Save Record

       Record Operations      Delete Record

       Record Operations      Undo Record

       Record Navigation      Go to First Record

       Record Navigation      Go to Previous Record

       Record Navigation      Go to Next Record

       Record Navigation      Go to Last Record

       Record Operations      Add New Record

 8. Drag the bottom of the detail section up so that it is flush with the

    bottom of the buttons. Drag the right side of the detail section so

    that it is flush with the right side of the last button.

 9. From the View menu, choose Code.

10. Create the following Access Basic function in the toolbar form module:

       Option Explicit

       Function ActivateToolbarForm ()

          On Error Resume Next

          Forms(Me.Tag).SetFocus

          If Err Then

             ActivateToolbarForm = False

          Else

             ActivateToolbarForm = True

          End If

       End Function

    This function will be used to reactivate the form the toolbar is

    floating on, so that the chosen operation is performed on that form

    rather than against the toolbar form itself.

11. For each button on the toolbar form, insert the following line of code

    at the very top of the button's OnClick event procedure. To insert the

    code, select a button, click the right mouse button in the OnClick

    property field, and then choose Build.

       If ActivateToolbarForm() = False Then Exit Sub

    For example, the code for the Search button might look like the

    following:

       Sub Button0_Click ()

       If ActivateToolbarForm() = False Then Exit Sub

       On Error GoTo Err_Button0_Click

          DoCmd DoMenuItem A_FORMBAR, A_EDITMENU, 10, , A_MENU_VER20

       Exit_Button0_Click:

          Exit Sub

       Err_Button0_Click:

          MsgBox Error$

          Resume Exit_Button0_Click

       End Sub

    This code ensures that the form the toolbar is floating on is selected

    for the chosen operation.

12. Save the form with the name Toolbar, and then close the form.

13. Create a new Access Basic module. Add the following code:

       Option Explicit

       Sub SetToolbarForm (F As Form)

          If IsLoaded("Toolbar") Then Forms![Toolbar].Tag = F.Name

       End Sub

    The SetToolbarForm subroutine uses the IsLoaded() function that in the

    Utility Functions module in NWIND.MDB. You should copy this function

    for use in other databases.

14. For every form that you intend to use the custom toolbar with, add the

    following line of code to the form's OnActivate property:

       SetToolbarForm Me

    For this example, add the line of code above to the OnActivate property

    of the Customers and Employees forms:

    a. Open the Employees form in Design view.

    b. From the View menu, choose Code.

    c. Select Form in the first combo box on the code toolbar.

    d. Select Activate in the second combo box on the code toolbar.

    e. Add the above line of code so the subroutine appears as follows:

          Sub Form_Activate ()

             SetToolbarForm Me

          End Sub

    f. Repeat steps a-e for the Customers form.

    This line of code instructs the custom toolbar to store the name of the

    form to be used when a toolbar button is chosen. This ensures that the

    toolbar actions are performed against the active form.

Using the Custom Toolbar

------------------------

Open the Customers and Employees forms in Form view, and then open the

Toolbar form. Switch back and forth between the Employees form and the

Customers form, using the navigation buttons on the custom toolbar to

navigate among the form records.

Suggested Enhancements to the Custom Toolbar

--------------------------------------------

 - You may want to automate the loading and closing of a custom toolbar

   form from another form's load and unload events. For example, to have

   the custom toolbar open only with the Customers form, add the following

   code to the Customers form's OnLoad and OnUnLoad properties:

      Sub Form_Load ()

         DoCmd OpenForm "Toolbar"

      End Sub

      Sub Form_Unload (Cancel As Integer)

         DoCmd Close A_FORM, "Toolbar"

      End Sub

 - You can set the BorderStyle property of the toolbar form to None, so

   that no border and no caption bar appears. This will prevent users from

   being able to move the toolbar around.

 - You may want to automatically position the toolbar form to a specific

   location on the screen. To do this, use a MoveSize macro action in the

   toolbar form's OnLoad property. The following sample code will position

   the toolbar form to the upper left corner of the screen:

      DoCmd MoveSize 0, 0

Additional reference words: 1.00 1.10 2.00 tool bar


INF: How to Refer To a Control On a Subform or Subreport

 Article Number: Q113352

 CREATED: 03-APR-1994

 MODIFIED: 04-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to refer to controls on subforms or subreports,

and describes some common problems you may encounter when you refer to

controls on subforms or subreports.

MORE INFORMATION

To refer to a control on a subform, use the following syntax:

   Forms![main form name]![subform control name].Form![control name]

To refer to a control on a subreport, use the following syntax:

   Reports![main report name]![subreport control name].Report![control

   name]

NOTE: Only subforms are discussed in the rest of this article, but all the

information applies to both subforms and subreports.

It is important to note that you cannot refer to controls on a subform with

the following syntax:

   Forms![subform name]![control name]

This is because a subform on a main form is not a form, but is a control

just like a text box or a list box. You must refer to a subform as a

control rather than a form, and specify the Form identifier following the

subform control name reference to access the controls on a subform.

It is also important to note that when you are referring to controls on a

subform, you must specify the value contained in the ControlName property

of the subform control. The ControlName property should not be confused

with the SourceObject property for a subform control. The SourceObject

property is used to indicate which subform to use in the subform control.

The ControlName property is used to specify the name by which the subform

control will be referenced. ControlName is typically set the same as the

SourceObject, but it does not have to be.

For example, consider an Order Details subform on an Orders form with the

following properties:

   ControlName: Order Details

   SourceObject: Order Details

You can refer to a Unit Price control on the Order Details subform

with the following reference:

   Forms![Orders]![Order Details].Form![Unit Price]

If, however, the subform control has the following properties

   ControlName: Details

   SourceObject: Order Details

you must refer to the Unit Price control on the Order Details subform

with this reference:

   Forms![Orders]![Details].Form![Unit Price]

Examples of Referencing Controls on a Subform

---------------------------------------------

The following SetValue macro action could be used to increase the Unit

Price value on the Orders Subform by 10 percent:

   SetValue

      Item: Forms![Orders]![Order Details].Form![Unit Price]

      Expression: Forms![Orders]![Order Details].Form![Unit Price]* 1.1

If the macro is attached to a button on the Orders form, you can use

this expression for the SetValue Expression argument:

   [Order Details].Form![Unit Price]*1.1

If you are referring to a control on a subform from another control on the

same subform, you do not have to enter the Form property identifier. For

example, to refer to the Unit Price value on the Order Details subform in a

macro attached to a button on the Order Details subform, you can enter:

   [Unit Price]

The following expression can be entered as the ControlSource property for

the Subtotal control on the Orders main form to display a value calculated

in the hidden Order Subtotal control on the Order Details subform:

   =[Orders Subform].Form![Order Subtotal]

To refer to the value of a control on the parent (main) form from a control

on a subform, use the Parent property. For example, the following

expression entered in a control on a subform refers to the Customer ID

field on the parent form.

   =Parent![Customer ID]

To refer to a control on a nested subform (a subform on a subform),

the following syntax can be used:

   Forms![main form name]![subform control name].Form![nested subform

   control name].Form![control name]

Common Problems Encountered When Referencing Subform Controls

-------------------------------------------------------------

 - The following error message occurs:

      Invalid reference to form '<subform name>'

   This means that you tried to reference a control on a subform with the

   following syntax:

      Forms![subform name]![control name]

   The problem is that the subform is not really a form, but a control

   that appears on a main form. Refer to the subform as a control rather

   than a form with the following syntax:

      Forms![main form name]![subform control name].Form![control name]

-  "#Name?" appears in a control with an expression referring to a

   subform control.

   This can occur when the ControlName property for the subform control is

   not what you expect. Open the main form in Design view, select the

   subform control, then activate the Property window from the View menu.

   Compare the ControlName property value to the SourceObject property

   value.

   The SourceObject property is used to indicate which subform to use

   in the subform control. The ControlName property is used to specify

   the name by which the subform control will be referenced. The

   ControlName is typically set the same as the SourceObject, but

   it does not have to be.

 - The following error message occurs:

      Invalid reference to field '<subform name>'

   This error message has the same cause as the problem above.

REFERENCES

==========

For more information, search for "subforms: referring to controls on" using

the Microsoft Access Help menu.

Additional reference words: 1.00 1.10 2.00


PRA: Datasheet Header and Footer Print at Constant Locations

 Article Number: Q113353

 CREATED: 03-APR-1994

 MODIFIED: 04-APR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SYMPTOMS

The default top and bottom margin for table and query Datasheet views is 1

inch. Decreasing these margins will not move the location of the title and

date header, or of the page number footer. Instead, the header and footer

will be overwritten by the column data when you print or preview the data.

CAUSE

By default, the title and date header is placed at a constant of 0.5 inches

from the top of the page. The page number footer is placed at 0.5 inches

from the bottom of the page.

RESOLUTION

Create a form or report, instead of using a table or query's Datasheet

view, if you want to decrease the default top and bottom margins.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version

2.0. We are researching this problem, and will post new information here in

the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB.

2. Open the Customers table in Datasheet view.

3. Preview the table.

4. From the File menu, choose Print Setup. Change the top and bottom

   margins to 0.25 inches, and then choose OK.

Additional reference words: 2.00 title, page header, page footer


PRB: Cannot Sum Calculated Controls in Forms or Reports

 Article Number: Q113354

 CREATED: 03-APR-1994

 MODIFIED: 04-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SYMPTOMS

"#Name?" is displayed in a text box in a form footer, or a parameter box

appears requesting the field specified in the sum expression in a report.

CAUSE

The text box is trying to perform a sum on a calculated control in the

detail section of the form or report.

You cannot sum a calculated control on a form or report because the

calculation is not stored anywhere for use in a later computation. The

calculation is computed and then output to the screen for display only.

RESOLUTION

There are two solutions to this problem.

1. Repeat the calculation being computed in the calculated control in the

   sum expression. If the calculated control on the form or report has the

   expression

      =[Unit Price] * [Quantity]

   repeat this calculation in the sum expression as:

      =SUM([Unit Price] * [Quantity])

2. Base the form or report on a query and calculate the expression as a

   calculated field in the query rather than as a calculated control on the

   form or report. Since the calculation is being computed in the query,

   the result will be available for other computations. This method is

   considerably faster than the first method as the computation does not

   have to be done twice. If the calculated control on the form or report

   has the expression

      =[Unit Price] * [Quantity]

   then the new calculated field in the query will have the following in

   the Field row of the query grid:

      Extended Price: [Unit Price] * [Quantity]

   If the form or report is based on a query with this calculated field,

   Extended Price will appear in the field list and should be used in place

   of the calculated control on the form or report. The sum expression in

   the form or report footer would look like the following:

      =SUM([Extended Price])

MORE INFORMATION

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Open the form Orders Subform in Design view.

3. Place a text box with the following properties in the detail section:

      ControlName: My Extended Price

      ControlSource: =[Unit Price] * [Quantity]

4. Alter the Order Subtotal text box ControlSource property from

      =Sum([Extended Price])

   to:

      =Sum([My Extended Price])

   NOTE: The original expression will correctly display the sum of the

   Extended Price field since this field is being computed as a calculated

   field in the Order Details2 query the form is based on. The Extended

   Price calculated field in the Order Details2 query looks like the

   following:

      Extended Price: CLng([Order Details].[Unit Price]*[Quantity]*(1-

      [Discount])*100)/100

5. Change the form's ViewsAllowed property from Datasheet to Both.

6. View the form in Form view. "#Name?" will appear in the Order

   Subtotal box in the form footer.

Work Around 1: Repeating the Calculation in the Sum Expression

--------------------------------------------------------------

NOTE: These steps continue from the "Steps to Reproduce Behavior" section

above.

Alter the Order Subtotal ControlSource property from

   =Sum([My Extended Price])

to:

   =Sum([Unit Price] * [Quantity])

Note that the calculation correctly displays in the Order Subtotal box in

the form footer.

Work Around 2: Repeating the Calculation in the Sum Expression

--------------------------------------------------------------

1. Open the Order Details2 query in Design view.

2. In an empty query grid column, type the following in the Field row:

      My Extended Price: [Order Details].[Unit Price]*[Quantity]

3. Remove the My Extended Price calculated control in the detail

   section.

The calculation correctly displays in the Order Subtotal box in the form

footer.

REFERENCES

==========

For more information, search for "totals" then "Calculating Totals in

Forms" using the Microsoft Access Help menu.

Microsoft Access "User's Guide," version 1.0, Chapter 11, "Using

Expressions in Forms," pages 295-298

Microsoft Access "User's Guide," version 1.1, Chapter 11, "Using

Expressions in Forms," pages 299-302

Additional reference words: 1.00 1.10 2.00


INF: How Microsoft Access Uses SHARE.EXE

 Article Number: Q113355

 CREATED: 03-APR-1994

 MODIFIED: 04-APR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article describes the SHARE.EXE file-sharing utility, and how it is

used by Microsoft Access to handle file sharing for multiuser databases.

MORE INFORMATION

Description of SHARE.EXE

------------------------

SHARE.EXE (Share) is a file-sharing utility included with MS-DOS versions

3.0 and higher. It is used by application programs that work with several

files at a time. It is essential for sharing files on a network with

multiple users.

In MS-DOS, Share is a terminate-and-stay-resident (TSR) utility. If you are

running Windows for Workgroups version 3.11 in enhanced mode, Share is

replaced by an enhanced mode virtual device driver (VxD) called VSHARE.386

(VShare). VShare was designed for Windows for Workgroups and the peer-to-

peer networking it supports. Since Windows for Workgroups 3.11 uses only

VShare, you can conserve memory by not loading Share. Consult your Windows

for Workgroups documentation for more information about using VShare.

Since Share and VShare are functionally identical for Microsoft Access,

only Share will be described further in this article.

Share gives applications an easy, well-defined way to prevent users from

accessing the same file (or region of a file) at the same instant. Once

Share is run, an application can use it to lock a file (or region of a

file) so that only one person at a time can make changes to it, preventing

file read and write conflicts. Most multiuser and network software packages

use Share for their file and record locking tasks.

Microsoft Access uses Share to control file sharing between two or more

instances of Microsoft Access running on the same system and using the same

database, or to allow a workstation to run as a non-dedicated file server

in a Windows for Workgroups environment. Share is also used by certain

object linking and embedding (ODE) applications. OLE applications use Share

to coordinate file usage, and OLE itself opens files using Share. Also, all

of the installable ISAM drivers rely on Share.

How Share Works

---------------

Share maintains two tables in memory: the FILES table and the LOCK table.

The FILES table contains the complete pathname of each file that has been

opened, plus an internal file handle number and other housekeeping

information. The LOCK table contains a list of internal file handle numbers

and corresponding information on the various areas of each file that are

locked. Share checks these tables whenever an application attempts to open

or use a file or a region of a file, and tells the application whether or

not the file or region is available.

Share uses at least one entry in each table for each file that is opened.

The more files your computer opens and locks, the more space Share needs

for its internal tables. You can control the size of Share's internal

tables with two command line options: /F and /L. The /F option controls the

amount of space allocated for the FILES table and the /L option controls

the number of simultaneous locks that Share will allow.

The /F Parameter

----------------

The /F parameter controls the size (in bytes) of the table that Share

reserves for filenames and handles. The syntax for the /F parameter is

   SHARE /F:<n>

where <n> is any number from 0 to approximately 62,000 (depending on the

other applications loaded). The default is /F:2048 (or, 2K). Share stores

the complete pathname of each file, plus 11 bytes of file handle and

housekeeping information. You can figure the largest possible space

requirement by multiplying the number of files in your CONFIG.SYS file by

71 (60 bytes for the longest possible pathname + 11 bytes for other

information). For example, if your system has FILES = 255 in your

CONFIG.SYS file, in the worst case (all 255 files are open) Share would

require over 18,100 bytes for the FILES table.

On a network server, you must allocate enough space for all the files that

will be opened by all the users on the network. The default value is 2048

bytes--enough space to hold the information for 66 files with paths

averaging 20 characters, or about 28 files in a worst-case scenario. If you

know that paths on your system average more than 20 characters or that you

will be opening many files, you should use the /F parameter to give Share

more space for the FILES table.

The /L Parameter

----------------

The /L parameter controls the number of simultaneous locks that Share can

handle. A low number of Share locks is a common problem for Microsoft

Access users on networks. The syntax for the /L parameter is

   SHARE /L:<n>

where <n> is an integer between 1 and approximately 3800 (depending

on the size of other applications loaded). The default is 20 locks.

Opening a file on a server requires at least one lock. In addition, most

network programs use several more locks per file. They lock individual

records, and even individual fields within records. Most multiuser

databases use many locks--sometimes 10 or more per file. On a network, with

several users opening each file, Share's 20-lock default can be used up

almost instantly. The number of Share locks used by Microsoft Access

varies, depending on the amount of data that is accessed. A rough estimate

of the number of locks needed is 5 times the number of records that will be

accessed at any given time. During the Microsoft Access installation

process, the SETUP.EXE program automatically sets the number of locks to

500.

Use the /L parameter to increase the number of locks allowed to prevent

Share lock errors. The /L setting should be at least the number of files

you have specified in your CONFIG.SYS file. If you are running a multiuser

program that opens many files, consider setting /L to at least twice the

number of open files allowed, or in the case of Microsoft Access, 5 times

the number.

Questions and Answers About Share and Microsoft Access

------------------------------------------------------

1. Q: Does Microsoft Access use Share if you open a database

      exclusively?

   A: Yes. Share takes over all File Open calls.

2. Q: Do any of the ODBC drivers (such as those in the Drivers Pack, or

      third-party drivers) require Share?

   A: Yes, all of the ODBC drivers require Share, whether in a multiuser

      or a stand-alone configuration.

3. Q: What is the highest number of locks Microsoft Access might need?

   A: This is impossible to determine exactly, since it depends on the

      amount of data that is accessed at any given time. However, a

      rough estimate is 5 times the number of records that will be

      accessed at any given time.

4. Q: What memory does Share use?

   A: Share uses conventional memory, while VShare uses memory from

      the Windows memory pool (extended, virtual, and so on). You do not

      need to run both Share and VShare, because VShare disables

      Share.

5. Q: Do Share and VShare compete with other applications for memory?

   A: Share is an MS-DOS application that is loaded into the

      conventional memory area, so it does compete with other programs

      that use conventional memory. Also, Share requires a small

      amount of memory to store file and lock information. VShare is a

      Windows-managed VxD, so it can be allocated in any of the available

      Windows memory areas and does not impact other applications.

6. Q: Do transactions use Share?

   A: Yes.

7. Q: Why do I sometimes get a "Share locks exceeded" message, while

      at other times I get an "Out of memory" error message?

   A: If you have a Share locking problem, you get an error message

      identifying Share as the problem. An "Out of memory" message

      can be caused by a number of other things.

Additional reference words: 2.00 MU Multiuser Sharing


INF: How to Determine the Current Screen Resolution (Size)

 Article Number: Q113458

 CREATED: 05-APR-1994

 MODIFIED: 06-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes a sample user-defined Access Basic function that you

can use to determine the current screen resolution. This function is useful

in determining if you are running in standard VGA mode (640 x 480) or Super

VGA mode (800 x 600 or 1024 x 768).

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

MORE INFORMATION

The example below demonstrates how to create and use the sample

GetScreenResolution() function.

Notes:

 - You may have some Microsoft Windows API functions defined in an existing

   Microsoft Access library; therefore, your declarations may be

   duplicates. If you receive a duplicate procedure name error message,

   remove or comment out the declarations statement in your code.

 - In the following sample code, an underscore (_) is used as a line-

   continuation character. Remove the underscores when re-creating this

   code in Access Basic.

 - In Microsoft Access version 2.0, you can create code in a form module.

   Code in a form module is restricted to that form. The Type statement

   used in this example must be global. You can use this code in a form's

   module if the Type statement is in the Declarations section of a global

   Access Basic module. For more information about the Type statement,

   search for "type" then "Type Statement" using the Microsoft Access Help

   menu.

1. Create a new Access Basic module, and enter the following Declarations

   and function:

      ' *****************************************************************

      ' DECLARATIONS SECTION

      Option Explicit

      Type RECT

          x1 As Integer

          y1 As Integer

          x2 As Integer

          y2 As Integer

      End Type

      Declare Function GetDesktopWindow Lib "User" () As Integer

      Declare Function GetWindowRect Lib "User" _

         (ByVal hWnd As Integer, rectangle As RECT) As Integer

      ' *****************************************************************

      ' FUNCTION: GetScreenResolution()

      '

      ' PURPOSE:

      '   To determine the current screen size or resolution.

      '

      ' RETURN:

      '   The current screen resolution. Typically one of the following:

      '      640 x 480

      '      800 x 600

      '      1024 x 768

      ' *****************************************************************

      Function GetScreenResolution () as String

          Dim R As RECT

          Dim hWnd As Integer

          Dim RetVal As Integer

          hWnd = GetDesktopWindow()

          RetVal = GetWindowRect(hWnd, R)

          GetScreenResolution = (R.x2 - R.x1) & "x" & (R.y2 - R.y1)

      End Function

2. From the View menu, choose Immediate Window.

3. Type the following in the Immediate window, and then press ENTER:

      ? GetScreenResolution()

The current screen resolution will be displayed in the Immediate window. If

the current resolution is standard VGA, the following will be displayed in

the Immediate window:

   640x480

Additional reference words: 1.00 1.10 2.00


INF: Using the AllowZeroLength and Required Properties

 Article Number: Q113493

 CREATED: 06-APR-1994

 MODIFIED: 07-APR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

The AllowZeroLength property determines whether a zero-length string ("")

is a valid entry. The Required property determines whether a null value is

a valid value. Although these two properties work together, the

AllowZeroLength property works independently of the Required property.

MORE INFORMATION

The AllowZeroLength property determines whether a zero-length string ("")

is a valid entry, and is available only for text and memo fields.

Microsoft Access version 1.x does not allow zero-length strings in a text

or memo field. In Microsoft Access 1.x, if a user deletes data in an

existing field, or does not enter data in a field, the value saved for the

field is a null. Microsoft Access version 2.0 supports both null and zero-

length strings in text and memo fields. To be compatible with Microsoft

Access 1.x applications, the default for the AllowZeroLength property is

No.

The Required property determines whether a null value is a valid value.

Although the AllowZeroLength and Required properties work together, the

AllowZeroLength property works independently of the Required property. If

AllowZeroLength is set to Yes, a zero-length string is a valid value for

the field regardless of the Required property setting. To enter a zero-

length string in a field, type two double quotation marks ("").

You can use the AllowZeroLength and Required property settings to

differentiate between information that does not exist and information that

may exist. For example, you might have employees in your database who do

not have a home phone. If AllowZeroLength is set to Yes, Required is set to

No, and DefaultValue is left blank for the Home Phone field, you can enter

two double quotation marks to indicate that an employee does not have a

home phone. If you leave the field blank (do not type text or delete the

existing text), it indicates that the employee may have a home phone, but

you do not know what it is.

The following table shows the results you can expect when you combine the

AllowZeroLength and Required property settings:

AllowZeroLength    Required      User's action        Value displayed

---------------------------------------------------------------------

      No              No         Presses ENTER            <Null>

                                 Presses SPACEBAR         <Null>

                                 Types ""              (not allowed)

      Yes             No         Presses ENTER            <Null>

                                 Presses SPACEBAR         <Null>

                                 Types ""                   ""

      No              Yes        Presses ENTER         (not allowed)

                                 Presses SPACEBAR      (not allowed)

                                 Types ""              (not allowed)

      Yes             Yes        Presses ENTER         (not allowed)

                                 Presses SPACEBAR           ""

                                 Types ""                   ""

REFERENCES

==========

For more information about the AllowZeroLength property, search for

"AllowZeroLength" then "AllowZeroLength Property" using the Microsoft

Access Help menu.

For more information about the Required property, search for "Required"

then "Required Property" using the Microsoft Access Help menu.

Microsoft Access "User's Guide," version 2.0, Chapter 8, "Changing and

Customizing Tables"

Additional reference words: 2.00


PRB: Error When Trying to Enforce Referential Integrity

 Article Number: Q113494

 CREATED: 06-APR-1994

 MODIFIED: 07-APR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SYMPTOMS

When you create a relationship in the Relationships window by dragging a

field from one table to another, you get the following error message when

you select "Enforce Referential Integrity" and choose the Create button.

   Can't create relationship to enforce referential integrity. The

   field(s) in the primary table must be the primary key or have a unique

   index.

CAUSE

You must drag the joining field from the "one" side to the "many" side in

order to enforce referential integrity." The field on the "one" side must

also be the primary key field in that table, or have a unique index. If you

are dragging the joining field from the "one" side to the "many" side and

still get this error, another possible cause might be the way your indexes

are set up.

RESOLUTION

To set up your indexes correctly, open the "one-side" table in Design view

and set a primary key, or create a unique index, for the field you want to

use. Then, create the relationship between the tables.

The following example uses the sample database NWIND.MDB to demonstrate a

relationship with referential integrity enforced:

1. Open the sample database NWIND.MDB.

2. From the Edit menu, choose Relationships.

3. From the Edit menu, choose Clear Layout. When you are prompted

   to continue, choose OK.

4. From the Relationships menu, choose Add Table.

5. Double click the Products table and the Order Details table. Choose

   Close.

6. If there is already a relationship line drawn between the Products

   table and the Order Details table, select it and press DEL

   to remove it. When you are prompted to continue, choose OK.

7. Drag the Product ID field from the Products table onto the Product

   ID field in the Order Details table.

8. In the Relationships dialog box, select the "Enforce Referential

   Integrity" check box, and then choose Create.

   This will create a one-to-many relationship between the Products table

   and the Order Details table.

9. Close the Relationships window. Do not save your changes.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce the Error:

-----------------------------

1. Open the sample database NWIND.MDB.

2. From the Edit menu, choose Relationships.

3. From the Edit menu, choose Clear Layout. When you are prompted

   to continue, choose OK.

4. From the Relationships menu, choose Add Table.

5. Double click the Products table and the Order Details table. Choose

   Close.

6. If there is already a relationship line drawn between the Products

   table and the Order Details table, select it and press DEL

   to remove it. When you are prompted to continue, choose OK.

7. Drag the Product ID field from the Order Details table onto the Product

   ID field in the Product table.

8. In the Relationships dialog box, select the "Enforce Referential

   Integrity" check box, and then choose Create.

   This will cause the error message to pop up. You must drag the field

   from the "one" side (the Products table) to the "many" side (the Order

   Details table) in order to enforce referential integrity.

9. Close the Relationships window. Do not save your changes.

REFERENCES

==========

For additional information about setting up relationships, search for

"Relationships" using the Microsoft Access Help menu.

Microsoft Access "User's Guide," version 2.0, Chapter 2, "Designing a

Database (Determining the Relationships)"

Microsoft Access "User's Guide," version 2.0, Chapter 7, "Table Basics"

Additional reference words: 2.00


PRB: Parameters Expected When Navigating Form with Sub-subform

 Article Number: Q113545

 CREATED: 06-APR-1994

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1

---------------------------------------------------------------------

SYMPTOMS

While navigating a main form that contains a subform that contains another

subform, you receive the following error message:

   3 Parameters were expected but only 1 were supplied

CAUSE

A common field is being used in the LinkChild and LinkMaster properties to

link the main form to the subform and the subform to its subform (the

subsubform). When Microsoft Access tries to evaluate the common link field

to filter the records in the subforms, it may try to evaluate the links in

an incorrect order, which leads to the error message described above.

RESOLUTION

There are two ways to solve this problem.

1. Create a single, unique, key field (perhaps a counter field) in the

   subform table that can be used to link to the subsubform table, rather

   than linking on multiple fields.

2. Base the subform and the subsubform on a query that has a calculated

   field that combines the linking fields into a single field. This single

   calculated field can be used in the LinkChild and LinkMaster properties

   of the subsubform control to link to the subform. This eliminates the

   common field from being defined in both links.

See the example below, which demonstrates how to use both techniques to

solve this problem.

MORE INFORMATION

The following example demonstrates the problem described above, and

demonstrates the techniques to solve the problem.

Note that this problem is very difficult to reproduce. Following the steps

below may not be sufficient to cause the problem to manifest in the sample

database NWIND.MDB.

Suppose that you have common Orders and Order Details tables to take orders

for your business, similar to the design in the sample database NWIND.MDB.

The Orders table stores information about an order and the Order Details

table stores information about the "many" products ordered on "one" order.

The tables might have the following important fields (among others):

   Orders

   ----------

   *Order ID

   Order Date

   Order Details

   ----------------

   *Order ID

   *Product ID

   Unit Price

   Quantity Ordered

NOTE: An asterisk (*) denotes a primary key field.

Your business is run such that you can fulfill an order by making multiple

shipments of products to the customer for a given order. (You may be out of

stock of some products and will ship the remainder of the order

separately.) You need to track how many of each product was shipped on a

given date for a given order. To do this, you create an additional "many"

table to store the dates and the quantities shipped per item on a given

order. You create the following table:

   Order Details Shipped

   ---------------------

   *Order ID

   *Product ID

   *Date

   Quantity Shipped

To view this information, you create a main form based on the Orders table.

You create a subform to view information about the "many" products ordered

from the Order Details table linked on the Order ID field. You create a

subsubform to view information on the "many" shipments made for each

product on the order from the Order Details Shipped table linked on the

Order ID and Product ID fields. Your form links look like the following:

   Main form     Subform              SubSubform

   Orders        Order Details        Order Details Shipped

   ---------     -------------        ---------------------

   Order ID  ->  Order ID         ->  Order ID

                 Product ID       ->  Product ID

In this design, the Order ID field is being used to link both the main form

to the subform, and the subform to the subsubform. This can cause the error

described above when you navigate the records on the main form.

Solution 1

----------

The best way to solve this problem is to create a single, unique key field

(perhaps a counter field), in the subform table that can be used to link

the subsubform table, rather than linking with multiple fields.

Using the example above, add a field called Order Detail ID with a Counter

data type to the Order Details table. The table will look like:

   Order Details

   ----------------

   Order Detail ID

   *Order ID

   *Product ID

   Unit Price

   Quantity Ordered

You can then link a product to the many shipment records in the Order

Details Shipped table using this single field:

   Order Details Shipped

   ---------------------

   *Order Detail ID

   *Date

   Quantity Shipped

The links between the main form and the subforms would look like the

following:

   Main form     Subform              SubSubform

   Orders        Order Details        Order Details Shipped

   ---------     -------------        ---------------------

   Order ID  ->  Order ID

                 Order Detail ID  ->  Order Detail ID

The difficulty with this solution is that implementing it on an existing

database with a lot of data may require some effort. The second solution,

although less preferred, solves the problem at the form level rather than

the table level.

Solution 2

----------

This solution involves another way of eliminating the use of a common field

in the links between the main form and the subforms by using a query. To

use this solution, create two queries. One of the queries will be based on

the subform table, and the other will be based on the subsubform table.

Include all the fields from the underlying table in each query. In an empty

column on the query grid, create a calculated field that combines the

values of the linking fields.

Using the example above, place the following in an empty Field row on the

query grid:

   OrdProdLink: [Order ID] & [Product ID]

You can now alter the LinkChild and LinkMaster fields between the subform

and the subsubform to use this single calculated field. The links between

the main form and the subforms would look like the following:

   Main form      Subform              SubSubform

   Orders         Order Details        Order Details Shipped

   ---------      -------------        ---------------------

   Order ID  ->   Order ID

                  OrdProdLink     ->   OrdProdLink

REFERENCES

==========

Microsoft Access "User's Guide," version 1.0, Chapter 6, "Designing Select

Queries," pages 126-127

Microsoft Access "User's Guide," version 1.1, Chapter 6, "Designing Select

Queries," pages 130-131

Microsoft Access "User's Guide," version 1.0, Chapter 10, "Creating Forms

Based On More than One Table," pages 275-276

Microsoft Access "User's Guide," version 1.1, Chapter 6, "Designing Select

Queries," pages 275-276

Additional reference words: 1.00 1.10


INF: Programmatically Add Counter Field to Table using DAO

 Article Number: Q113546

 CREATED: 06-APR-1994

 MODIFIED: 08-APR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to add a counter field to an existing table

using data access objects (DAO).

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Building Applications" manual.

MORE INFORMATION

The example below demonstrates how to add a counter to a table using DAO

and Access Basic:

1. Open the sample database NWIND.MDB.

2. Create the following new table:

      Table: Counterless

      -----------------------

      Field Name: MyText

         Data Type: Text

      Field Name: MyNumber

         Data Type: Number

      Field Name: MyDate

         Data Type: Date/Time

3. Save the table as Counterless, without creating a primary key.

4. Create a new module and add the following line to the Declarations

   section:

      Option Explicit

5. Enter the following function in the module:

      '***************************************************************

      ' FUNCTION: AddCounter()

      '

      ' PURPOSE:  Programmatically adds a counter field to an

      '           existing table.

      '

      ' ARGUMENTS:

      '

      '    TName: The name of the table.

      '    FName: The name of the new counter field.

      '

      ' RETURNS:  True (error was encountered) or

      '           False (no error) as an integer.

      '

      '***************************************************************

      Function AddCounter (TName As String, FName As String) As Integer

         Dim DB As Database, TDef As TableDef, Fld As Field

         ' Get the current database.

         Set DB = DBEngine.Workspaces(0).Databases(0)

         ' Open the tabledef to which the counter field will be added.

         Set TDef = DB.TableDefs(TName)

         ' Create a new counter field of type LONG

         ' with the counter attribute.

         Set Fld = TDef.CreateField(FName, DB_LONG)

         Fld.Attributes = DB_AUTOINCRFIELD

         ' Trap for any errors.

         On Error Resume Next

         ' Append the new field to the tabledef.

         TDef.fields.Append Fld

         ' Check to see if an error occurred.

         If Err Then

            AddCounter = False

         Else

            AddCounter = True

         End If

         DB.Close

      End Function

6. Save the module as DAOAddCounter, and then close it.

7. Create the following macro:

      Action

      -------

      RunCode

      RunCode argument

      ------------------------------------------------

      Function Name: Addcounter("Counterless","NewID")

8. Save the macro as DAOAddCounter, and then close it.

9. Run the macro.

When you open the Counterless table, note the new NewID counter field.

REFERENCES

==========

For more information about the CreateField method, search for "CreateField"

then "CreateField Method (Data Access)" using the Microsoft Access Help

menu.

Additional reference words: 2.00


INF: How to Trap Keystrokes that Leave a Control on a Form

 Article Number: Q113547

 CREATED: 06-APR-1994

 MODIFIED: 07-APR-1994

 VERSION(S): 1.00 1.10 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access versions 1.0, 1.1, and 2.0

---------------------------------------------------------------------

SUMMARY

This article describes how to trap the ENTER, TAB, SHIFT+TAB, PAGE UP, and

PAGE DOWN keys when they are pressed in a form, and then either replace the

key's action with another action, or disable the action.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Introduction to Programming" manual in Microsoft Access version

1.x, or the "Building Applications" manual in version 2.0.

MORE INFORMATION

The example below demonstrates how to use the GetKeyState() Windows

application programming interface (API) call to detect which key or key

combination is used to exit a control on a form. This technique can be used

to prevent a user from exiting a control, or to remap the key or key

combination to a different action:

1. Enter the following Declarations and function in an Access Basic module:

      ' **** DECLARATION SECTION ****

      Option Explicit

      Global Const VK_CONTROL = &H11

      Global Const VK_SHIFT = &H10

      Global Const VK_TAB = &H9

      Global Const VK_RETURN = &HD

      Global Const VK_PRIOR = &H21  ' PGUP

      Global Const VK_NEXT = &H22   ' PGDN

      Declare Function GetKeyState% Lib "user.exe" (ByVal nKey%)

      Function CheckKey ()

         Dim sControl As String

         Dim sShift As String

         ' Was the CTRL or SHIFT key used?

         If GetKeyState(VK_CONTROL) < 0 Then sControl = "Ctrl+"

         If GetKeyState(VK_SHIFT) < 0 Then sShift = "Shift+"

         ' Was the TAB key used?

         If GetKeyState(VK_TAB) < 0 Then

            MsgBox "You pressed " & sControl & sShift & "TAB!"

         End If

         ' Was the ENTER or RETURN key used?

         If GetKeyState(VK_RETURN) < 0 Then

            MsgBox "You pressed " & sControl & sShift & "ENTER!"

         End If

         ' Was the PAGE DOWN key used?

         If GetKeyState(VK_NEXT) < 0 Then

            MsgBox "You pressed " & sControl & sShift & "PGDN!"

         End If

         ' Was the PAGE UP key used?

         If GetKeyState(VK_PRIOR) < 0 Then

            MsgBox "You pressed " & sControl & sShift & "PGUP!"

         End If

      End Function

2. Open any form in Design view, and set any control's OnExit property to:

      =CheckKey()

3. View the form in Form view, move to the control you modified in step

   2, and then try to exit the control.

The next example demonstrates how to use the GetKeyState() Windows API call

to modify the ENTER key's action so that it adds lines to a text box,

rather than moving to the next control in the tab order:

1. Create the following sample Access Basic function in a module:

      Option Explicit

      Global Const VK_RETURN = &HD

      Declare Function GetKeyState% Lib "user.exe" (ByVal nKey%)

      Function MakeEnterAddLines()

         If GetKeyState(VK_RETURN) < 0 Then

            DoCmd CancelEvent

            SendKeys "^{ENTER}"

         End If

      End Function

2. Set the OnExit property of any text box control on any form to:

      =MakeEnterAddLines()

3. View the form in Form view, move to the control you modified, and then

   press ENTER.

The next example demonstrates how to use the GetKeyState() Windows API call

to disable the PAGE UP and PAGE DOWN keys in a form:

1. Create the following sample Access Basic function in a module:

      Option Explicit

      Global Const VK_PRIOR = &H21  ' PGUP

      Global Const VK_NEXT = &H22   ' PGDN

      Declare Function GetKeyState% Lib "user.exe" (ByVal nKey%)

      Function DisablePGUP_PGDN()

         If GetKeyState(VK_PRIOR) < 0 Or GetKeyState(VK_NEXT) < 0 Then

            DoCmd CancelEvent

         End If

      End Function

2. Set the OnExit properties of all the controls where the PAGE UP and PAGE

   DOWN keys are to be disabled, on any form, to:

      =DisablePGUP_PGDN()

The next example demonstrates how to use the GetKeyState() Windows API call

to cause the TAB key, when it is pressed in the last control in the last

record in a subform, to navigate to the next control on the main form:

1. Create the following sample Access Basic function in a module:

      Option Explicit

      Global Const VK_TAB = &H9

      Declare Function GetKeyState% Lib "user.exe" (ByVal nKey%)

      Function TABtoMainForm(F As Form)

         Dim DS As Dynaset

         On Error Goto Bye_TABtoMainForm

         ' Move to last record in form dynaset

         Set DS = F.Dynaset

         DS.MoveLast

         ' See if the form record is the last record

         If DS.Bookmark = F.Bookmark Then

            If GetKeyState(VK_TAB) < 0 Then

               DoCmd CancelEvent

            SendKeys "^{TAB}"

         End If

      End If

      Bye_TABtoMainForm:

      End Function

2. Set the OnExit property of the last control in the subform to:

      =TABtoMainForm()

REFERENCES

==========

For more information about using the GetKeyState() call, query on the

following word here in the Microsoft Knowledge Base:

   GetKeyState

For more information about other ways to disable the PAGE UP and PAGE DOWN

keys, query on the following words here in the Microsoft Knowledge Base:

   pgup and pgdn

Additional reference words: 1.00 1.10 2.00


INF: How to Select Controls on Subforms with SetFocus Method

 Article Number: Q113548

 CREATED: 06-APR-1994

 MODIFIED: 08-APR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

You can use the new SetFocus method for forms and form controls in

Microsoft Access version 2.0 to select a field or control on an open form,

form datasheet, table datasheet, or query dynaset, or to select other

forms.

This article describes how to use the SetFocus method to select controls on

subforms and nested subforms, and how to select controls on a main form

from a control on a subform.

MORE INFORMATION

How to Select a Control on a Subform from a Main Form

-----------------------------------------------------

To select a control on a subform from a main form, do the following:

1. Select the subform control.

2. Select the appropriate control on the subform.

The following example demonstrates how to select a control on a subform

from a main form:

1. Open the sample database NWIND.MDB.

2. Create a new, blank form based on the Customers table.

3. From the View menu, choose Field List to display the field list.

   Drag the Company Name and Contact Name fields to the detail section

   of the form.

4. Drag the Orders form from the Database window onto the detail

   section of the new form. Microsoft Access will embed the Orders form

   as a subform, linking the Orders form to the new form on the Customer

   ID field. Note that the Orders form contains its own subform to show

   order details.

5. Create a command button on the form with the following properties:

      Name: GotoEmployeeID

      Caption: Employee ID

      OnClick: [Event Procedure]

   To create the event procedure, choose the Build button and then select

   the Code Builder. Add the following code to the form module, and then

   close the module:

      ' Select the Orders subform control.

      Me![Orders].SetFocus

      ' Select the Employee ID control on the Orders subform.

      Me![Orders].Form![Employee ID].SetFocus

6. Save the new form with the name Customer Orders.

7. View the form in Form view, and then choose the Employee ID button.

How to Select a Control on a Nested Subform from a Main Form

------------------------------------------------------------

To select a control on a nested subform (a subform of a subform), do the

following:

1. Select the subform control.

2. Select the nested subform control.

3. Select the appropriate control on the nested subform.

The following example demonstrates how to select a control on a nested

subform from a main form:

1. Continuing the example above, add the following command button

   to the Customer Orders form:

      Name: GotoQuantity

      Caption: Quantity

      OnClick: [Event Procedure]

   Create the following code for the OnClick event procedure:

      ' Select the Orders subform control.

      Me![Orders].SetFocus

      ' Select the nested Orders Subform subform control.

      Me![Orders].Form![Orders Subform].SetFocus

      ' Select the Quantity field on the nested subform.

      Me![Orders].Form![Orders Subform].Form![Quantity].SetFocus

2. View the form in Form view, and then choose the Quantity button.

How to Select a Control on a Main Form from a Subform

-----------------------------------------------------

To select a control on a main form from a subform, do the following:

1. Select the main form.

2. Select the appropriate control on the main form.

The following example demonstrates how to select a control on a main form

from a subform:

1. Continuing the example above, open the Orders form in Design view. Add

   the following new command button to the form:

      Name: GotoContact

      Caption: Contact

      OnClick: [Event Procedure]

   Create the following code for the OnClick event procedure:

      ' Select the main form.

      Forms![Customer Orders].SetFocus

      ' Select the Contact Name control on the main form.

      Forms![Customer Orders]![Contact Name].SetFocus

2. Save and then close the Orders form.

3. Open the Customer Orders form in Form view.

4. Choose the Contact button on the Orders subform.

How to Select a Control on a Subform from a Nested Subform

----------------------------------------------------------

To select a control on a subform from a nested subform, do the following:

1. Select the main form.

2. Select the subform control.

3. Select the appropriate control on the subform.

The following example demonstrates how to select a control on a subform

from a nested subform:

1. Continuing the example above, open the Orders Subform form in

   Design view.

2. Modify the Discount field's OnExit property to be:

      OnExit: [Event Procedure]

   Create the following code for the OnExit event procedure:

      ' Select the main form.

      Forms![Customer Orders].SetFocus

      ' Select the Orders subform control.

      Forms![Customer Orders]![Orders].SetFocus

      ' Select the Employee ID control on the Orders subform.

      Forms![Customer Orders]![Orders].Form![Employee ID].SetFocus

2. Save and close the Orders Subform form.

3. Open the Customer Orders form in Form view. Use the mouse to

   select the Discount field in the nested Orders Subform subform.

   Press TAB to exit the Discount field.

REFERENCES

==========

For more information about the SetFocus method, search for "SetFocus" then

"SetFocus Method" using the Microsoft Access Help menu.

Additional reference words: 2.00


INF: How to Determine If a Table or Query Exists

 Article Number: Q113549

 CREATED: 06-APR-1994

 MODIFIED: 08-APR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article describes a sample user-defined function, IsTableQuery(), that

you can use to determine whether a table or query exists in a database. The

sample function uses the TableDefs and QueryDefs data access objects (DAO)

collections.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications using the programming tools provided

with Microsoft Access. For more information on Access Basic, please refer

to the "Building Applications" manual.

MORE INFORMATION

The following example demonstrates how to use the sample user-defined

function IsTableQuery() to determine whether a table or query exists in a

database:

1. Open the sample database NWIND.MDB.

2. Create a new module and add the following line to the module's

   Declarations section:

      Option Explicit

3. Enter the following function in the module:

      '********************************************************

      ' FUNCTION: IsTableQuery()

      '

      ' PURPOSE: Determine if a table or query exists.

      '

      ' ARGUMENTS:

      '   DbName: The name of the database. If the database name

      '           is "" the current database is used.

      '    TName: The name of a table or query.

      '

      ' RETURNS: True (it exists) or False (it does not exist).

      '

      '********************************************************

      Function IsTableQuery (DbName As String, TName As String) As Integer

         Dim Db As Database, Found As Integer, Test As String

         Const NAME_NOT_IN_COLLECTION = 3265

         ' Assume the table or query does exist.

         Found = False

         ' Trap for any errors.

         On Error Resume Next

         ' If the database name is empty...

         If Trim$(DbName) = "" Then

            ' ...then set Db to the current Db.

            Set Db = DBEngine.Workspaces(0).Databases(0)

         Else

            ' Otherwise, set Db to the specified open database.

            Set Db = DBEngine.Workspaces(0).OpenDatabase(DbName)

            ' See if an error occurred.

            If Err Then

               MsgBox "Could not find opened database " & DbName

               IsTableQuery = False

               Exit Function

            End If

         End If

         ' See if the name is in the Tables collection.

         Test = Db.TableDefs(TName).Name

         If Err <> NAME_NOT_IN_COLLECTION Then Found = True

         ' Reset the error variable.

         Err = 0

         ' See if the name is in the Queries collection.

         Test = Db.QueryDefs(TName$).name

         If Err <> NAME_NOT_IN_COLLECTION Then Found = True

         DB.Close

         IsTableQuery = Found

      End Function

4. From the View menu, choose Immediate Window.

5. Type the following line in the Immediate window, and then press ENTER:

      If IsTableQuery("","Orders") = True Then Print "Found it!"

6. Try using other valid database names, and other table and query

   names, in the line above.

REFERENCES

==========

For more information about the TableDefs and QueryDefs collections, search

for "TableDefs" and "QueryDefs" using the Microsoft Access Help menu.

Additional reference words: 2.00


INF: How to Optimize MS Access Using ODBC Data Sources

 Article Number: Q113551

 CREATED: 06-APR-1994

 MODIFIED: 07-APR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article describes several tips for improving performance when you are

accessing data from an ODBC data source.

MORE INFORMATION

Try these tips to improve performance with ODBC data sources:

 - Restrict the amount of data that you request from the server. Do

   not ask for more data than you need. Use queries to select only

   the fields and rows that you need.

 - Use only the functionality you need. Snapshots are less powerful than

   dynasets and are not updateable, but may be faster, particularly for

   small recordsets without Memo or OLE Object fields.

 - Use attached tables to access server data. Do not use "direct" server

   access (that is, opening remote databases and executing queries against

   them). Instead, attach tables and use the attachments, or use pass-

   through queries.

 - Use list and combo boxes wisely. On a form, each list box, combo box,

   subform, and control containing a total requires a separate query.

   Against local data, performance may be adequate. Against remote data,

   however, long delays may occur when you open a form since each query

   must be sent to the server and a response returned before the form can

   open.

 - Avoid large combo boxes. Including a combo box with hundreds, or even

   thousands, of choices based on a local table may yield acceptable

   response time, especially if you define an appropriate index on the

   local table. Against a remote table, however, such a combo box will

   yield sluggish performance as it drains server and network resources as

   it fetches data to fill the list. It is best to limit the number of rows

   returned to the combo box when you are working with remote data. You can

   also break up the data into smaller combo boxes (bearing the tip above

   in mind).

 - Use the Find command only on smaller recordsets. The Microsoft Jet

   database engine optimizes the Find command to work well against local

   recordsets of almost any size, and against remote recordsets of

   reasonable size. However, when you are working with large remote

   recordsets (thousands of records or more), you should instead use a

   filter or query and be careful to use restrictions that your server can

   process.

 - Make sure that queries are sent to the server for processing. The most

   important factor in query performance against remote data is ensuring

   that your server executes as much of the query as possible. The

   Microsoft Jet database engine attempts to send the entire query to your

   server, but evaluates locally any query clauses and expressions that are

   not generally supported by servers or by your particular server.

   Functionality not supported by servers in general includes:

    - Operations that cannot be expressed in a single SQL statement. This

      can occur when you use a query as an input to another query, or when

      your query's FROM clause contains a Totals query or DISTINCT query.

      Often, you can rearrange your queries to calculate totals after all

      other operations.

    - Operations that are Microsoft Jet database engine specific extensions

      to SQL, such as crosstab queries, TOP queries, and reports with

      multiple levels of grouping and totals. Note that simple crosstab

      queries can be sent to servers.

    - Expressions that contain Microsoft Access-specific operators or

      functions. The Microsoft Access financial functions and statistical

      aggregates have no server equivalents.

    - User-defined Access Basic functions that take remote columns as

      arguments. These functions do not exist on the server, but must

      process remote column data. However, if a user-defined function

      returns a single value and does not reference a remote column, the

      function is evaluated locally and its value is sent to the server

      for processing.

    - Mixing text and numeric data types in operators or UNION query

      outputs. Most servers lack the data-type leniency in Microsoft

      Access. Because of this, use explicit conversion functions where

      appropriate.

    - Heterogeneous joins between local tables and remote tables, or

      between remote tables in different ODBC data sources. Joins between

      small local tables and large remote tables, where the join column is

      indexed, may result in a remote index join. In a remote index join,

      one query for each row in the local table is sent to the server and

      only the joining rows are returned.

    - Non-remotable expressions, or expressions that cannot be sent

      remotely, because they cannot be evaluated by your server. Non-

      remoteable output expressions (those in the SELECT clause) do not

      force local evaluation of your query unless they occur in a Totals

      query, a DISTINCT query, or a UNION query. Non-remoteable expressions

      in other clauses (WHERE, ORDER BY, GROUP BY, HAVING, and so on) force

      at least part of your query to be evaluated locally.

 - Servers differ in some areas of supported functionality. When you attach

   a remote table, the Microsoft Jet database engine queries the ODBC

   driver for its capabilities. If the required functionality is supported

   by the driver and the server, the Microsoft Jet database engine sends

   the operation to the server for processing. If not, the Microsoft Jet

   database engine performs the operation locally. Areas of differing

   support include (but are not limited to) the following:

    - Outer joins. Note that the Microsoft Jet database engine does not

      send multiple outer joins to a server, although many inner joins may

      accompany a single outer join.

    - Numeric, string, and date/time functions (such as Log(), Mid$(),

      DatePart(), and so on).

    - Conversion functions (such as CInt(), CStr(), CVDate(), and so on).

Additional reference words: 2.00 Attaching ODBC


PRA: Report Section with Subreport Not Included In Output File

 Article Number: Q113562

 CREATED: 06-APR-1994

 MODIFIED: 08-APR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SYMPTOMS

When you use the Output To command to output a report to a file, any

section of a report that includes a subreport is not included in the output

file.

CAUSE

It is by design that when you use the Output To command to output a report

to a file, subreports are not included in the output file. However, the

presence of a subreport in any section of a report prevents the entire

section from being included in the output file.

RESOLUTION

Remove the subreport from the report section and output the report again.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version

2.0. We are researching this problem, and will post new information here in

the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB.

2. Preview the report Sales By Year.

3. In the Sales By Year Dialog form, enter "6/1/91" (without quotation

   marks) for the beginning date, and enter "6/30/91" (without quotation

   marks) for the ending date. Choose OK.

4. Note that one page is displayed, with a page header section, group

   header section, detail section, and page footer section.

5. From the File menu, choose Output To.

6. In the Select Format box, select Rich Text Format (*.rtf), and then

   choose OK.

7. Choose OK to accept the default filename (sales_by.rtf) for the

   output file.

8. When you are alerted that the subreport will not be included, choose

   OK.

9. Open the SALES_BY.RTF file in any editor (such as Microsoft Word for

   Windows, or Microsoft Write) that can open a Rich Text format file.

   Note that the entire group header section is missing from the file,

   because the group header section of the Sales By Year report contains

   a subreport.

NOTE: The height of the detail section in the Sales By Year report is set

to 0.1667 inches to add space between detail records. Setting the height of

the detail section to 0.1563 inches will avoid double spacing in the output

file.

Additional reference words: 2.00


INF: Microsoft Access 2.0 Readme Help File Contents

 Article Number: Q113564

 CREATED: 06-APR-1994

 MODIFIED: 07-APR-1994

 VERSION(S): 2.00

---------------------------------------------------------------------

The information in this article applies to:

 - Microsoft Access version 2.0

---------------------------------------------------------------------

SUMMARY

This article lists the contents and topics contained in the Microsoft

Access version 2.0 Readme Help file. Note that the Readme Help file

replaces the text-only README.TXT file included with earlier versions of

Microsoft Access.

MORE INFORMATION

In the items below, each content section is underlined, with its associated

topics below.

Microsoft Access Product Update

-------------------------------

 - Microsoft Access Q&A.

 - Using SHARE.EXE or VSHARE.386.

 - Using DECOMP.EXE to Decompress Microsoft Access Files.

 - Renaming, Deleting, or Moving Files and Directories.

 - Files That Must Be Installed Locally.

 - Warning When Attaching Tables with Unsupported Indexes.

 - Scope and Lifetime of Access Basic Variables and Functions.

 - International Issues.

Conversion and Compatibility Updates

------------------------------------

 - Conversion from Microsoft Access Version 1.x to 2.0.

 - Setup Removes Microsoft Access Version 1.x Files.

 - Improving Index Performance.

 - Conflicts with New Property Names in Expressions and Access Basic

   Code.

 - Form Control and Section Names.

 - Converting a "Front-end/Back-end" Application.

 - Version 2.0 Setup and the UTILITY.MDA File.

 - Using Visual Basic Version 3.0 Applications.

 - Exporting to Version 1.1 Databases.

 - DefaultValue Property Setting Includes Quotation Marks in Version

   2.0.

 - Owner Access Queries.

 - Order of Evaluation of Expressions.

 - Applications That Use the SQL Pass-through DLL.

 - Closing Pop-up Forms and Their Underlying Windows.

 - Unused Error Messages.

Network Installations

---------------------

 - Designating Network Connections.

 - Setting Up Microsoft Access on a Network File Server.

 - Creating Custom Installations for Workstation Users.

Documentation Updates

---------------------

 - Book: Microsoft Access Getting Started.

 - Book: Microsoft Access User's Guide.

 - Book: Microsoft Access Building Applications.

 - Help: Microsoft Access Help.

Using Microsoft Access Version 2.0 with Other Software

------------------------------------------------------

 - Microsoft Visual Basic.

 - Accessing Microsoft Access Data from Microsoft Word and Microsoft

   Excel.

 - Using Microsoft Access with Paradox Databases.

 - Running Multiple Data Access Applications.

 - Using Microsoft Access to Import, Attach, or Export to Microsoft

   FoxPro Version 2.5 Files.

 - Lotus cc:Mail or Lotus Notes.

 - Using Microsoft Access with Microsoft Video for Windows

   Windows NT.

 - Setting Up Microsoft Access on a Novell Network.

 - Using Microsoft Access on Novell NetWare Servers and Banyan VINES

   Servers (Increasing the Number of Record Locks).

 - Using Microsoft Access with Microsoft LAN Manager.

 - Using Microsoft Access with Microsoft Windows for Workgroups.

 - Using SQL Server Data Installed on a Novell NetWare LAN or a

   Banyan VINES Network.

 - Asynchronous Query Execution and ODBC Drivers.

 - ORACLE Server Databases and Null Indexes.

Using Microsoft Access with Btrieve

-----------------------------------

 - General Considerations.

 - How Microsoft Access Locates Btrieve Files.

 - Using Databases with Xtrieve-style Security.

 - Using Compressed Data Files.

 - Using Btrieve in a Multiuser Environment.

 - Using Btrieve Indexes.

 - Setting Btrieve Options.

 - Setting Microsoft Access Options for Btrieve.

 - Configuring the Server-based Version (BTRIEVE.NLM).

Files Included with Microsoft Access

------------------------------------

 - Outdated Version 1.0 and Version 1.1 Files.

 - Microsoft Access Version 2.0 Files.

Additional reference words: 2.00 Helpfile Read.me


Forms/Reports (Common)
Microsoft Access Knowledge Base

Welcome to the Microsoft Access Knowledge Base help file.  This help system includes 1313 articles that relate to the Microsoft Access  for Windows.  These articles were developed by Microsoft's Product Support Engineers.  This help file is a snapshot of the Knowledge Base as of April 13, 1994.  New and updated articles can be found on both CompuServe, GENIE and Internet.  This help file also lists Training Centers in your local area, third party application and developers,  and User Groups.  This help file contains helpful tips, programming examples(INF), known problems(PRB, PRA), References, FastTips and other information that may not be addressed in the manuals.

Please feel free to distribute this information in compliance with the terms of Microsoft.

Fast Tips

Forms (Specific)

Forms/Reports (Common)

Colors/Color Palette

Control Properties

Default Properties/Templates

Field List

Toolbox

Wizards

General

Import/Export/Attach

Interoperability

Macros

Non-Product/Non-Technical

Programming

Queries

Reports (Specific)

Security

Setup

Tables

Windows Issue

Printing


Colors/Color Palette

INF: ComboBox On Toolbar Do Not Use Window Background Color

INF: How to Use Custom Colors in Microsoft Access

INF: Transparent Text Boxes Not Supported

PRB: Bitmap May Not Display Correctly

PRB: Changing Caption on Title Label Leaves Shadow Unmodified

PRB: Fonts May Change Zooming Out in Print Preview

PRB: Option Button Appears Fuzzy in Datasheet View

PRB: Raised and Sunken Check Box and Option Button Controls


Control Properties

INF: Allowing an Ampersand to Appear in a Caption

INF: Description of the ControlSource Property

INF: Fill New Record with Data from Prev Record Automatically

INF: General Number Format Ignores Decimal Number Setting

INF: Height, Width Settings Do Not Affect Size of Objects

INF: Horizontal Sizing Controls Availability on Controls

INF: How to Create a Password Text Box

INF: How to Create Raised or Sunken Text in Forms and Reports

INF: How to Default a Combo Box to the First Row Value

INF: How to Determine if the Current Record Is the New Record

INF: How to Display Yes/No Choices in a Combo Box or List Box

INF: How to Show Field in Datasheet View But Not Form View

INF: Resizing Multiple Controls Simultaneously

INF: Size To Fit a Label Without Using Layout Menu

INF: Status Bar Text Too Long for Auto Repeat Property

INF: Using DLookup() to Look Up Values in Forms and Reports

PRA: Changing Font Size Causes Subscript Text

PRA: Combo or List Box Column Not Formatted

PRA: Formatted Memo Truncates Data at 255 Characters

PRA: GP Fault Referencing Column Property of Combo Box

PRA: GP Fault with Button Caption Text Longer Than 2048

PRB: "Change Default" Allowed with Multiple Items Selected

PRB: Apply Default Does Not Change Height or Width of Labels

PRB: Buttons Pasted into Option Groups Have Option Value

PRB: Cannot Use Counter to Determine If Record Is New Record

PRB: Changes in Subform Design Do Not Update in Main Form

PRB: Default Values Used Only with a Bound Control

PRB: Disabled Buttons Not Visible with ATI 1280x1024

PRB: Error Message "Macro '' Not Found"

PRB: Formatted Colors Do Not Appear in Text

PRB: Incorrect Results Received with DSum() Function

PRB: Label Placed in, Not to Left of, Command Button on Form

PRB: Leading Space in Property Sheet Entry May Cause Problems

PRB: No CanShrink Property for Check Boxes

PRB: Nulls Not Concatenated with "+" Operator

PRB: Only One Button Accepts Selection in Yes/No Option Group

PRB: Print Preview Displays Only First Line of Toggle Button

PRB: Random Characters in Text Box Bound to OLE Object Field

PRB: Short Label Autosizes to Cursor Size

PRB: Text Box Formatted as Currency Has a Space on the Right

PRB: Text Label Truncated Printing Form on Epson 9-Pin Printer

PRB: Toggle Button with CancelEvent on BeforeUpdate Property

PRB: Trailing CR/LFs Stripped From Text Box When Retrieved

PRB: Unable to Paste Information into Property Sheet

PRB: Unable to Use Hexadecimal or Octal Values in Properties

PRB: Valid Sum Function Returns '#Name?' in Calculated Control


Default Properties/Templates

INF: Default AutoLabel and AddColon Properties

INF: Form Sizing Grid Accepts Non-Integer Values

INF: How to Change Default Template for Forms and Reports

PRB: "Change Default" Allowed with Multiple Items Selected

PRB: 'No Default Printer' Error Message When Printing

PRB: Buttons Pasted into Option Groups Have Option Value

PRB: Grid Disappears When Measurement Changed to Metric

PRB: Select All Not Grayed Even When No Items Are Available


Field List

PRB: Empty Field List in Report or Form's Design View


Toolbox

PRB: ESC While Creating Control Does not Deselect Control

PRB: Toolbox Selection Lost When Toolbox Is Closed


Wizards

INF: AccessWizards Button Grayed Out

PRA: Error Using FormWizard with VGA Mono Driver

PRA: Options in Form and Report Wizards Are Not Displayed

PRB: Changing Caption on Title Label Leaves Shadow Unmodified

PRB: Clicking Mouse in Wizard Background Changes Focus

PRB: Form Objects Not Placed on Grid by Wizard

PRB: FormWizard Labels Placed on Left Margin Grow Down

PRB: Grid Lines Not Visible in Access When Using Wizards

PRB: Mail Label Wizard Cuts Off First Field at Top of Page

PRB: Mail Label Wizard Shows Blank Line in Label Size List Box

PRB: ReportWizard Defaults to 8.5-by-11-Inch Page

PRB: ReportWizard Select No Fields for Form Still Shows All


Forms (Specific)
Microsoft Access Knowledge Base

Welcome to the Microsoft Access Knowledge Base help file.  This help system includes 1313 articles that relate to the Microsoft Access  for Windows.  These articles were developed by Microsoft's Product Support Engineers.  This help file is a snapshot of the Knowledge Base as of April 13, 1994.  New and updated articles can be found on both CompuServe, GENIE and Internet.  This help file also lists Training Centers in your local area, third party application and developers,  and User Groups.  This help file contains helpful tips, programming examples(INF), known problems(PRB, PRA), References, FastTips and other information that may not be addressed in the manuals.

Please feel free to distribute this information in compliance with the terms of Microsoft.

Fast Tips

Forms (Specific)

Combo/List Box

Events (Calling Macro/Module)

Form Properties

Other

Requery/Refresh

SubForm

Validation

Forms/Reports (Common)

General

Import/Export/Attach

Interoperability

Macros

Non-Product/Non-Technical

Programming

Queries

Reports (Specific)

Security

Setup

Tables

Windows Issue

Printing


Combo/List Box

INF: Base Combo Box on Parameter Query to Filter Values

INF: Changing the RowSource of a ListBox/ComboBox at Runtime

INF: Displaying List or Combo Boxes with More Than One Field

INF: Filling a Multiple-Column List Box Using Access Basic

INF: How to Create a Graph Bound to Two Combo Boxes

INF: How to Create Synchronized Combo Boxes

INF: How to Display Yes/No Choices in a Combo Box or List Box

INF: How to Hide the Combo Box Drop-Down Arrow on a Form

INF: How to Make a Combo Box Default to First Item in List

INF: How to Select More than One Item from a List Box

INF: How to Synchronize Two Combo Boxes on a Form

INF: LimitToList Property Set to Yes Needs a Unique Entry

INF: Tips for Improving Combo and List Box Performance

INF: Tips for Improving Subform Performance

INF: Use SendKeys Macro Action to Open Combo Box Automatically

INF: Using Column Property of Combo Box to Update Text Box

PRA: Combo or List Box Column Not Formatted

PRA: Wrong RowSourceType for Combo Box Causes GP Fault

PRB: "#NAME?" Error Referring to Combo Box Column in Subform

PRB: Cannot Change Combo Box Value If ControlSource Is Counter

PRB: Cannot Delete Item When You Exit a LimitToList Combo Box

PRB: Combo Box Displays Only 255 Characters of Memo Field

PRB: Date/Time Formats Not Used In List or Combo Box Controls

PRB: DDE Statements Invalid in List Box or Combo Box Control

PRB: Edit Undo Command Text Is Misleading

PRB: Empty Row in List Box Can Be Selected

PRB: Find Company Macro Does Not Work Correctly in NWIND.MDB

PRB: List Box Column Property Gets Incorrect Row Information

PRB: List Box Displays #Error

PRB: List Box Does Not Scroll When Scroll Box Is Dragged

PRB: No Error Msg When BoundColumn Greater Than ColumnCount

PRB: Primary Keys Not Used to Order Data in Combo/List Boxes

PRB: Scroll Box Does Not Move Down Scroll Bar in Combo Box

PRB: Typing in Combo Box Does Not Select Item


Events (Calling Macro/Module)

INF: Adding a New Record to a Combo Box with a Double-Click

INF: Custom Menus Cannot Be Implemented with Pop-up Forms

INF: Delete Command Available if Counter Field Selected

INF: Double-click Also Executes OnPush Twice

INF: Form Controls to Increment and Decrement a Date

INF: Form OnOpen Event May Not Set Values of Unbound Controls

INF: Four Ways to Move to a Record from a Combo Box Selection

INF: How to Create a Cyclic Tab Order in a Form

INF: How to Create an Undo Record Button on a Form

INF: How to Not Display the Form Name in the Caption Bar

INF: How to Remove the Menu Bar from a Form

INF: How to Trap Keystrokes that Leave a Control on a Form

INF: How to Use a Toggle Button to Hide and Display a Subform

INF: List of New 2.0 Form/Report Events, Methods, & Properties

INF: Misleading Documentation for Cancel Property

INF: New Events and Properties in Microsoft Access v. 2.0

INF: OnCurrent Is Not Triggered on Unbound Forms

INF: Starting Another Application from a Text Box on a Form

INF: Updating a Separate Table When a Value Changes on a Form

PRA: Form Record Selector Buttons Disabled

PRA: GP Fault Closing Subform in Datasheet View

PRA: GP Fault in Datasheet View of a Form

PRA: GPF Hiding Control in Form Footer in Datasheet View

PRB:  GoToRecord Macro Does Not Work on Subform

PRB: Assigned Values Not Displayed When Form Opened As Dialog

PRB: BeforeUpdate and AfterUpdate Field Properties Not Working

PRB: Can't Refer to Record in Function Called by OnClose Event

PRB: Choosing Toolbar Design Button Causes Unexpected Behavior

PRB: Close Action from Function Does Not Trigger OnClose Error

PRB: CTRL+' Does Not Trigger Update Events in Datasheet View

PRB: Focus Returns to Control After OnDblClick

PRB: Macro on Subform Control Executed by Main Form

PRB: OnDblClick Macro Requires CancelEvent to Change Focus

PRB: OnInsert Event Executed by Unbound Controls

PRB: Setting OnEnter to TAB and OnExit to SHIFT+TAB Loops


Other

INF: "#Name?" or Control is Blank on Form Based on a Query

INF: "Form Is Read Only" Error Message

INF: Concatenating Fields in a Text box to Remove Blank Lines

INF: Creating Floating Popup Menus

INF: DLookup() Usage, Examples, and Troubleshooting Tips

INF: Double-Clicking on Control Moves Control Unintentionally

INF: Form and Report Modules Have Local Scope

INF: Four Ways to Move to a Record from a Combo Box Selection

INF: How to Check for Duplicate Values in Primary Key Fields

INF: How to Create a "Please Wait" Message

INF: How to Create a Custom Toolbar Using a Form

INF: How to Create a Running Sum on a Form

INF: How to Create Custom Navigation (VCR) Buttons on a Form

INF: How to Determine the View in Which a Form Is Displayed

INF: How to Determine Whether a Menu Item Is Checked

INF: How to Find a Record Using a Bound Control

INF: How to Float Windows on Other Windows

INF: How to Get the Last Two Digits of the Year

INF: How to Limit Page Movement in a Form

INF: How to Prevent Users from Adding New Records to a Form

INF: How to Print a Single Record from a Form in a Report

INF: How to Select Controls on Subforms with SetFocus Method

INF: How to Take a Control Out of the Tab Order

INF: How to Use Graphic Images as Wallpaper for Forms

INF: How to Use TimeValue() to Calculate Difference in Times

INF: Inconsistent Save and Save As Menus with Forms

INF: No Form Caption in Run-Time Application

INF: Recent File List Displays Deleted .MDB Files

INF: Round or Truncate Values to Desired Number of Decimals

INF: Sample Table Design to Support Questionnaire Applications

INF: Setting Form's Dynaset Property Puts Bookmark at EOF

INF: Troubleshooting Tips for Error Values

PRA: ApplyFilter Action Causes Form to be Read- Only

PRA: Cannot Use ReportWizard Without Default Windows Printer

PRA: GP Fault when Creating a Dynaset from Form Dynaset

PRA: GPF Using OpenForm Action to Hide Modal Pop- Up Form

PRA: List Box Controls on Forms Painted Incorrectly

PRA: Mouse Remains I-beam Over Text Box Scroll Bar

PRA: Slow Repaint When Saving Form with Many Controls

PRB: "Table Exclusively Locked" Error Switching to Form View

PRB: Cannot Add Security Items to Custom Menu

PRB: Cannot Change Combo Box Value If ControlSource Is Counter

PRB: Cannot Open Multiple Instances of the Same Form

PRB: Cannot Sum Calculated Controls in Forms or Reports

PRB: Company Pick List in Suppliers Form Doesn't Filter

PRB: Dialog Form Reopened by OpenForm Is Disabled

PRB: Error Using Edit Find with Yes/No Data Type

PRB: ESC While Creating Control Does not Deselect Control

PRB: Excess or Garbled Information Appears in List Box

PRB: Filtering Form with OpenForm Action Causes "#Name?" Error

PRB: Focus Does Not Shift When Find Accelerators Are Used

PRB: Form Displays Data from Deleted Field in Query

PRB: Form May Lose the Focus When SHIFT+F8 Is Pressed

PRB: Form Opened in Form View Is Completely Blank

PRB: Form Opens Blank Except for Header

PRB: Formatting Yes/No Data Type Example

PRB: Load From Query Dialog Title Does Not Match Menu

PRB: Macro on Subform Control Executed by Main Form

PRB: Navigation Button Unavailable in Main/Subform Wizard

PRB: Query by Form Returns No Rows When All Rows Expected

PRB: Show All Records Menu Choice not Available

PRB: Size To Fit Form Command Not Available

PRB: Switching Views Disables Undo

PRB: Trailing Spaces Automatically Truncated During Data Entry


Form Properties

INF: Bitmaps Hide the Caption of a Push or Option Button

INF: Border Widths Not Supported with Raised or Sunken Effects

INF: Cannot Change Borders of Raised or Sunken Controls

INF: Control Names >40 Chars in Access Basic Require Brackets

INF: Controlling Design Mode at Run Time to Change Properties

INF: Form Must Close for Modal/Popup Settings to Take Effect

INF: Form View Allowed When ViewsAllowed Set to Datasheet

INF: Headers On Non-Continuous Forms Disable Scroll Bar

INF: How to Base Subforms on SQL Pass-Through Queries

INF: How to Change Read-Only Properties at Run Time

INF: How to Create a Query By Form (QBF)

INF: How To Determine if a Record Is Being Edited

INF: How to Determine Whether a Form Is Minimized

INF: How to Filter a Subform by Changing the Record Source

INF: How to Get Record Position Number from Record Selector

INF: How to Get Red, Green, or Blue Components from RGB Value

INF: How to Limit Page Movement in a Form

INF: How to Position Microsoft Access on the Screen

INF: How to Remove the Caption Bar from a Form

INF: List of New 2.0 Form/Report Events, Methods, & Properties

INF: Minimized Popup Forms Cannot be Easily Restored

INF: New Events and Properties in Microsoft Access v. 2.0

INF: Placing the User Login Name on a Form or in the Title Bar

INF: Preventing Users from Adding New Records in Version 2.0

INF: Sample Function to Use the COMMDLG Color Dialog Box

INF: Two Methods to Refer to a Field in a Previous Record

PRA: Cannot Edit Text Box on Pop-Up Form

PRA: Duplicate Control Menus and Restore Buttons on Form

PRA: Problems Opening a Modal and Pop-Up Form as Dialog

PRB: Border Properties Ignored with Special Effect

PRB: Bound OLE Object Blank in Form View

PRB: Cannot Change the RecordSource of a Form at Run Time

PRB: Cannot Open Datasheet as a Pop-Up or Modal Form

PRB: Cannot Save a Blank Record in a Table or Form

PRB: Disabled Buttons Not Visible with ATI 1280x1024

PRB: Editing Allowed Although AllowEditing Set to Unavailable

PRB: Fields on Popup Not Editable When MS Access Is Minimized

PRB: Form Opened in Form View Is Completely Blank

PRB: Form or Report Cannot be Opened or Previewed

PRB: Form Size Changes Not Retained

PRB: Giving Controls Duplicate Name Does not Generate Error

PRB: HelpContextID Property Accepts Valid Negative Values

PRB: Hidden Pop-Up Forms Not Listed in Show Dialog Box

PRB: Minimizing Pop-Up and Modal Form Loses Application Focus

PRB: MoveSize Action Affects Wrong Window

PRB: New Label Controls Inherit FormWizards' Label Text Align

PRB: No Arrows on Scroll Bars if Window Is Larger than Form

PRB: No Field List When Form Is Based on SQL Statement

PRB: Pressing CTRL+ALT+SPACEBAR Enters Control's Default Value

PRB: Size To Fit Form Command Does Not Size Form Properly

PRB: Unfreeze All Columns Does Not Restore Column Order

PRB: ValidationRule Parses Function Name w/o Parens to String

PRB: Where Condition Refers to Fields Not Controls


Requery/Refresh

INF: Requery, Repaint, and Records Refresh

PRA: Slow Repaint When Saving Form with Many Controls

PRB: Control with Expression Shows up Blank in Form View


SubForm

INF: Four Ways to Move to a Record from a Combo Box Selection

INF: How to Refer To a Control On a Subform or Subreport

INF: How to Reference Controls or Fields on a Subform

INF: How to Requery a Combo Box on Subform

INF: How to Use a Main/Subform with Attached SQL Server Tables

INF: How to Use the Parent Property of a Subform

INF: Making a Subform Uneditable and Unenterable

PRA: GP Fault Closing Subform in Datasheet View

PRA: Help Context ID Property Does Not Work in Subform

PRA: Hidden Subform Maximized If Main Form Is Maximized

PRA: Orders Form Doesn't Print/Preview SubTotal & Total

PRA: Show All Records Does Not Work in Subforms

PRB: "#NAME?" Error Referring to Combo Box Column in Subform

PRB: Cannot Sum Calculated Controls in Forms or Reports

PRB: Cannot Use CTRL+SHIFT+HOME to Move to Main Form

PRB: Changes in Subform Design Do Not Update in Main Form

PRB: Empty Subforms Are Not Visible in Print Preview

PRB: Navigation Button Unavailable in Main/Subform Wizard

PRB: NWIND Order Form Updates Order Amount Field with Zero

PRB: Parameters Expected When Navigating Form with Sub-subform

PRB: Scroll Bars Displayed for a Subform in Datasheet View

PRB: Subform Column Width Changes Made in Main Form Not Saved

PRB: Subform Layout Changes Not Saved

PRB: Subform Not Updated

PRB: Unwanted Record Separator at the Bottom of a Subform

PRB: Wide Subform Does Not Scroll to Show Active Control


Validation

INF: Create a Function to Capitalize Single Words and Phrases

INF: Macro to Check for Duplicate Values in a Field

INF: Validation Rule to Require Uppercase in a Field

PRB: Parameter Limit for Access Basic Functions in Validation


Fast Tips
Microsoft Access Knowledge Base

Welcome to the Microsoft Access Knowledge Base help file.  This help system includes 1313 articles that relate to the Microsoft Access  for Windows.  These articles were developed by Microsoft's Product Support Engineers.  This help file is a snapshot of the Knowledge Base as of April 13, 1994.  New and updated articles can be found on both CompuServe, GENIE and Internet.  This help file also lists Training Centers in your local area, third party application and developers,  and User Groups.  This help file contains helpful tips, programming examples(INF), known problems(PRB, PRA), References, FastTips and other information that may not be addressed in the manuals.

Please feel free to distribute this information in compliance with the terms of Microsoft.

Fast Tips

Fast Tip Questions

Forms (Specific)

Forms/Reports (Common)

General

Import/Export/Attach

Interoperability

Macros

Non-Product/Non-Technical

Programming

Queries

Reports (Specific)

Security

Setup

Tables

Windows Issue

Printing


Fast Tip Questions

INF: Access Basic and Macros Questions & Answers

INF: Access Distribution Kit Questions & Answers

INF: Database Structure Questions & Answers

INF: Forms Questions & Answers

INF: Interoperability Questions & Answers

INF: Querying Questions & Answers

INF: Reports Questions & Answers

INF: Setup Questions & Answers


General
Microsoft Access Knowledge Base

Welcome to the Microsoft Access Knowledge Base help file.  This help system includes 1313 articles that relate to the Microsoft Access  for Windows.  These articles were developed by Microsoft's Product Support Engineers.  This help file is a snapshot of the Knowledge Base as of April 13, 1994.  New and updated articles can be found on both CompuServe, GENIE and Internet.  This help file also lists Training Centers in your local area, third party application and developers,  and User Groups.  This help file contains helpful tips, programming examples(INF), known problems(PRB, PRA), References, FastTips and other information that may not be addressed in the manuals.

Please feel free to distribute this information in compliance with the terms of Microsoft.

Fast Tips

Forms (Specific)

Forms/Reports (Common)

General

Application Design

Compact/Repair

Data Editing

Data Entry

Database Analyzer

Documentation/Cue Cards/Help

Expressions

Find/Replace

Formatting

Global Settings (View Options)

Multiuser/Locking

Northwind Sample Application Examples

Other

Referencing Objects

Referential Integrity

Relationships

SQL

User Interface

Import/Export/Attach

Interoperability

Macros

Non-Product/Non-Technical

Programming

Queries

Reports (Specific)

Security

Setup

Tables

Windows Issue

Printing


Application Design

INF: Additions to User's Guide Appendix A Specifications

INF: Converting Julian Dates with Access Basic

INF: Function to Determine Retail or Run-Time Version

INF: How to Change the Status Bar Text Using SysCmd()

INF: How to Create, Debug, and Use a Microsoft Access Library

INF: How to Return Records in a Many-to-Many Relationship

INF: How to Use Graphic Images as Wallpaper for Forms

INF: How to Wait for a Shelled Process to Finish

INF: List of Categories and Examples from SOLUTION.MDB

INF: Location of Database Window Different in v. 2.0

INF: Maximum Database Size Increased in Version 1.1

INF: Microsoft Access Companion Disk Contents (3.5 in. 1.44MB)

INF: Nulls Allowed in Foreign Key with Referential Integrity

INF: Overview of Conversion Issues from Version 1.1 to 2.0

PRB: BeforeUpdate and AfterUpdate Field Properties Not Working

PRB: Cannot Open a Database with a DoMenuItem Macro

PRB: Default Values of Attached Table Not Used

PRB: Reordering Rows in Table or Macro Design Window

PRB: ReportWizard or FormWizard List Box Empty in ADK


Compact/Repair

INF: Creating and Converting Version 1.0 and 1.1 Databases

INF: Defragment and Compact Database to Improve Performance

INF: How to Correctly Back Up Multiuser Databases

INF: How to Repair a Damaged Database

INF: Overview of Conversion Issues from Version 1.1 to 2.0

INF: Recovering MDB File Larger Than the 128- Megabyte Limit

INF: Sample Macro for Repair/Compact Operations

PRB: Microsoft Access Appears to Hang During Database Compact


Data Editing

INF: Cut, Copy, Paste for Immediate Window and SQL Window

INF: How to Change the Font for the Zoom Box

INF: How to Take a Control Out of the Tab Order

INF: Two Ways to Edit Forms Without Adding New Records

PRB: Weekday Disappears While Editing Long Date Format Field


Data Entry

INF: Converting Julian Dates with Access Basic

INF: Create a Function to Capitalize Single Words and Phrases

INF: How to Take a Control Out of the Tab Order

INF: Macro to Check for Duplicate Values in a Field

INF: Two Ways to Edit Forms Without Adding New Records

INF: Using Scroll Bars Does not Change Record Pointer

PRA: Changing Font Size Causes Subscript Text


Database Analyzer

INF: Cannot Use ANALYZER.MDB Filename for Output Database

INF: How to Install the Database Analyzer on the Help Menu

INF: How to Make the Analyzer Include Field Descriptions

INF: How to Use an Analyzer Table in a Word for Windows Table

PRB: Error in Database Analyzer: DTSysQuery Already Exists

PRB: Must Have Database Open to Use Database Analyzer Utility

PRB: Starting Analyzer Returns "Unknown Function Name"


Documentation/Cue Cards/Help

INF: "Language Reference" Online Only in Version 2.0

INF: Additions to User's Guide Appendix A Specifications

INF: Correct Procedure for Inserting New Field Above Existing

INF: Correct Syntax for TransferDatabase to dBASE and Paradox

INF: Freestanding Labels Do Not Appear in Datasheet View

INF: How to Add the ACC-KB.HLP File to the Help Menu

INF: Microsoft Access 2.0 Readme Help File Contents

INF: Microsoft Access ADK Legal Agreement

INF: MoveSize Arguments in Wrong Order in Language Reference

INF: Online Help for Sigma Button Is Incorrect

INF: OpenQuery Is Not Method; Use OpenQueryDef Instead

PRA: Cue Cards Do not Use Standard Windows Menu

PRA: Minimize MS Access with Cue Cards, System Hangs

PRB: Cannot Install Cue Cards Without Installing Help in Versi

PRB: CueCards Started Outside MS Access Does Not Work

PRB: Error in Column Property Help Menu Topic

PRB: Example Has Wrong Number for Dlookup Ship Postal Code

PRB: Incorrect File Destinations Listed in README.TXT

PRB: Macro Condition Example Using COUNT() Is Incorrect

PRB: Memory Block Not Freed If Cue Cards Incorrectly Installed

PRB: Page Hdr/Ftr Is Not Under View Menu

PRB: Query Window Does Not Always Scroll to Record


Expressions

INF: Displaying Start, Finish, and Elapsed Times on a Form

INF: DLookup() Usage, Examples, and Troubleshooting Tips

INF: Error Messages May Be Caused by International Setting

INF: Formatting Immediate IF (IIF) Statements in Reports

INF: Function to Get Date of Monday Prior to Current Day

INF: Functions to Left and Right Pad Character Strings

INF: How to Calculate the Nth Root of a Number

INF: How to Dynamically Create a Filter

INF: How to Sort on Different Fields Dynamically

INF: How to Use the IIf() (Immediate If) Function

INF: Sample Function to Build a Repeating String

INF: Sample Function to Return Variable's Data Type Name

INF: Sorting/Grouping a Query Using a Portion of Field's Value

INF: Troubleshooting Tips for Error Values

INF: Using "Name" in Expressions

PRA: Cannot Use First() and Last() Functions in a Report

PRA: GPF Using Invalid IIf() as ControlSource

PRB: "Circular Reference Caused by Alias" Error Message

PRB: #Error Appears Using TRIM() in Forms or Reports

PRB: #Error When Control Name Used in ControlSource Expression

PRB: Concatenation of Memo Fields Creates Text Field

PRB: DateDiff() Function Returns Incorrect Value

PRB: DFirst() and DLast() Functions Return Unexpected Records

PRB: Incorrect Time Calculations in Years Prior to 1900

PRB: Using Format() and Month() Returns Incorrect Month

PRB: Zoom Box Does Not Appear When SHIFT+F2 Is Pressed


Formatting

INF: Aligning User-Defined Formats in Text Fields

INF: Flexible Formatting of Phone Numbers

INF: Formatting Immediate IF (IIF) Statements in Reports

INF: Screen Fonts May Not Match Printer Output Fonts

PRA: Memo Field with Format Property Truncates Data

PRA: User-Defined Formatting Symbols Erase Characters

PRB: MS Access Short and Medium Time Formats Have Leading Zero

PRB: Using Format() and Month() Returns Incorrect Month

PRB: Weekday Disappears While Editing Long Date Format Field


Find/Replace

INF: Sample Function to Replace Special Characters

PRA: Use Shift+F4 Not Edit Find Next to Refresh Display

PRB: Current Record Not Immediately Updated with Replace All

PRB: Find Does Not Work with Fields Containing # Character


Global Settings (View Options)

INF: END Key Behavior in Edit Boxes

INF: ENTER in Multiline Text Box Does Not Move to Next Line

INF: Sample Function to Make ENTER Add Lines in a Text Box

INF: SQL Server System Administrator Cannot See System Tables

PRA: "Cursor Stops at First/Last Field" Setting Ignored

PRB: Arrow Keys Inconsistent Between Forms and Datasheets

PRB: Change Option Affects Only One Instance of MS Access

PRB: Changing Show Ruler Option Changes Existing Forms

PRB: Options Dialog Box Items Are Not Visible

PRB: Pressing HOME Key in Text Box Does Not Move to Beginning


Multiuser/Locking

INF: Error When Opening Table in Table Design View

INF: Five Parameters to Set in ISAM Section of MSACCESS.INI

INF: How Microsoft Access Uses SHARE.EXE

INF: How to Correctly Back Up Multiuser Databases

INF: How to Retrieve Windows For Workgroups User Information

INF: Microsoft Access and Untested Networks

INF: Page Locking, No Cluster Indexing Support

INF: Questions and Answers About .LDB Files

PRA: "Can't Delete Account" After Losing Net Connection

PRA: Multiple Users Adding Fields Causes Cross- Linking

PRB: "Record Lock Threshold Exceeded" with Large Action Query

PRB: Changes to Shared Module Are Kept Local Until .MDB Closed

PRB: Err Msg: "Couldn't Update: Currently Locked by User..."

PRB: Error Message "Couldn't Open File" in Shared Environment

PRB: Error Message When Opening Second Instance of .MDB File

PRB: Locking First Record Also Locks Last Record

PRB: Low Number of Share Locks Can Cause Error Message

PRB: Open Object Can Be Deleted by Another User

PRB: Paste Unavailable After Record Is Copied to Clipboard

PRB: Two Error Messages with Database on Workgroups Server


Northwind Sample Application Examples

INF: "Continued..." Header for Groups on More than One Page

INF: "Fieldname" Is Not an Index in This Table

INF: "Form Is Read Only" Error Message

INF: Adding a New Record to a Combo Box with a Double-Click

INF: Aligning User-Defined Formats in Text Fields

INF: Attached Table Must Be Opened as Dynaset from Modules

INF: Base Combo Box on Parameter Query to Filter Values

INF: Changing the Relationship Between Two Existing Tables

INF: Changing the RowSource of a ListBox/ComboBox at Runtime

INF: ComboBox On Toolbar Do Not Use Window Background Color

INF: Commonly Asked Questions About Access Version 1.0

INF: Concatenating Fields in a Text box to Remove Blank Lines

INF: Contents: MS Access 1.0 Disks 1-4 (1/14/93, 3.5-Inch)

INF: Contents: MS Access 1.0 Disks 4-6 (1/14/93, 3.5-Inch)

INF: Controlling Design Mode at Run Time to Change Properties

INF: Correct Syntax for TransferDatabase to dBASE and Paradox

INF: Creating a Crosstab Query with Multiple Value Fields

INF: Creating Queries to Execute Cascading Updates

INF: Custom Setup May Show Zero or Negative Disk Space Needed

INF: Deleting Duplicate Records from Two Tables

INF: Description of the ControlSource Property

INF: Displaying Totals for Each Row in Crosstab Queries

INF: DLookup() Usage, Examples, and Troubleshooting Tips

INF: Equivalent of Microsoft Excel's Fill Down Functionality

INF: Expanded Size of the Companion Disk Database Files

INF: Export Btrieve Table Without Existing Xtrieve FILE.DDF

INF: Expressions to Count Yes, No, and Other Responses

INF: Fill New Record with Data from Prev Record Automatically

INF: Finding the OLE ClassKey of an Embedded Object

INF: Formatting a Label for Each Axis of a Graph

INF: Formatting Immediate IF (IIF) Statements in Reports

INF: Four Ways to Move to a Record from a Combo Box Selection

INF: Graphing Current Sales Compared with Accumulated Sales

INF: How NWIND.MDB Employee Field Photographs Were Created

INF: How to Buffer SQL Strings Using DDE

INF: How to Calculate Averages That Exclude Zero Values

INF: How to Change the Order of Columns in a Graph

INF: How to Check for Duplicate Values in Primary Key Fields

INF: How to Communicate with NetDDE

INF: How to Create, Debug, and Use a Microsoft Access Library

INF: How to Create a "Please Wait" Message

INF: How to Create a "Top 10" Report

INF: How to Create a Custom Toolbar Using a Form

INF: How to Create a Cyclic Tab Order in a Form

INF: How to Create a Dynamic Crosstab Report

INF: How to Create a Graph Bound to Two Combo Boxes

INF: How to Create a Parameter In() Statement

INF: How to Create a Query By Form (QBF)

INF: How to Create a Running Sum on a Form

INF: How to Create Custom Navigation (VCR) Buttons on a Form

INF: How to Create Synchronized Combo Boxes

INF: How to Default a Combo Box to the First Row Value

INF: How To Determine if a Record Is Being Edited

INF: How to Determine If a Table or Query Exists

INF: How to Determine if the Current Record Is the New Record

INF: How to Determine Whether a Menu Item Is Checked

INF: How to Dial a Phone Number in Microsoft Access

INF: How to Disable the Close Command on the Control Menu

INF: How to Dynamically Create a Filter

INF: How to Execute Macro Actions Using DDE

INF: How to Export the Results of a Query

INF: How to Fill an Array Using Access Basic

INF: How to Fill an Array Using Access Basic

INF: How to Fill Text Boxes on a Report with Access Basic

INF: How to Filter a Subform by Changing the Record Source

INF: How to Find Attached Table's Database Name

INF: How to Find Attached Table's Database Name

INF: How to Force a Cascading Delete

INF: How to Get Field Data Types from a Table Using DDE

INF: How to Get Red, Green, or Blue Components from RGB Value

INF: How to Hide the Combo Box Drop-Down Arrow on a Form

INF: How to Index an Existing Field with DAO

INF: How to Make a Combo Box Default to First Item in List

INF: How to Order Data in a Graph

INF: How to Pass Information to Microsoft Access Using DDE

INF: How to Prevent Users from Adding New Records to a Form

INF: How to Print a Conditional Page Header in a Report

INF: How to Print a Single Record from a Form in a Report

INF: How to Print Book Style Page Numbers

INF: How to Print Duplicate Mailing Labels for Each Record

INF: How to Print Odd or Even Pages of a Report

INF: How to Query SQL Server Tables Without Attaching

INF: How to Remove Relationships

INF: How to Remove the Menu Bar from a Form

INF: How to Return Records in a Many-to-Many Relationship

INF: How to Run Access Basic Functions with DDE

INF: How to Select Controls on Subforms with SetFocus Method

INF: How to Sort on Different Fields Dynamically

INF: How to Specify a Custom Starting Page Number for a Report

INF: How to Speed Up Iterative Processes in Access Basic

INF: How to Synchronize Two Combo Boxes on a Form

INF: How to Update a Table Based on Values in a Second Table

INF: How to Use a Toggle Button to Hide and Display a Subform

INF: How to Use Aggregate Functions in a Query

INF: How to Use Command Line Switches

INF: How to Use Criteria Queries Without Join Lines

INF: How to Use DDE to Communicate with a Run-Time Application

INF: How to Use DDE to Fill a List Box

INF: How to Use DDE to Pass Information to MS Access v. 2.0

INF: How to Use DDE to Pass Information to MS Access v. 2.0

INF: How to Use Graphic Images as Wallpaper for Forms

INF: How to Use the ColumnWidth Property

INF: How to Use the IIf() (Immediate If) Function

INF: How to Use the Parent Property of a Subform

INF: How to Use the Status Bar Progress Meter

INF: Installation Process for the Companion Disk

INF: Join Type Mismatch Errors Caught at Runtime

INF: List of Categories and Examples from SOLUTION.MDB

INF: Location of Database Window Different in v. 2.0

INF: Macro to Check for Duplicate Values in a Field

INF: Macro to Enter Date Record Was Last Modified

INF: Microsoft Access, Scanners, and Scanning Software

INF: Microsoft Access 1.0 Disk Contents (3.5 inch, 1.44 MB)

INF: Microsoft Access 1.0 Disks 1-4 Contents (5.25 Inch 1.2MB)

INF: MS Access Does Not Support Parameter Queries as DDE Topic

INF: Must Save Table to Use Input Mask Wizard

INF: Must Save Table to Use Input Mask Wizard

INF: Northwind 'Sales Totals by Amount' Report Is Incorrect

INF: Nulls Allowed in Foreign Key with Referential Integrity

INF: Number of Times a Custom Function Executes in a Query

INF: OLE: New Graph Object Frames are Blank

INF: OpenDatabase and CloseDatabase Pseudo Actions

INF: Part 1: DDE in Visual Basic to Request MS Access Data

INF: Part 2, DDE in Visual Basic to Request Data from Access

INF: Passing Values from a Form to a Parameter Query

INF: Practice Using Object Analyzer Commands

INF: Preventing Users from Adding New Records in Version 2.0

INF: Print a Sequential Number for Each Record/Group on Report

INF: Programmatically Add Counter Field to Table using DAO

INF: Programming with the Object Analyzer Engine and Utilities

INF: Query with Parameters to Evaluate Complex Criteria

INF: Relationships Between Attached Microsoft Access Tables

INF: Reporting the Median Value of a Group of Records

INF: Requery Control Err Msg: There Is No Control Called...

INF: Returning Case-Sensitive Match in Queries

INF: Round or Truncate Values to Desired Number of Decimals

INF: Row Fix-up in the NWIND.MDB Order Form

INF: Sample Function to Determine the Existence of a Query

INF: Sample Function to Open a Form to a Particular Record

INF: Sample Function to Return a Random Record

INF: Sample Function to Reverse a String

INF: Sample Macro to Reset Page Number on Group Level Report

INF: Sending the Current Record to Word for Windows with DDE

INF: Set Focus to a Subform Control Using GoToControl Action

INF: Setting Form's Dynaset Property Puts Bookmark at EOF

INF: Showing All Records (Including Null) in a Parameter Query

INF: Shrinking Empty or Null OLE Object on Report

INF: Snapshot and Underlying Table Updated Until Snapshot Full

INF: Sorting/Grouping a Query Using a Portion of Field's Value

INF: Table Permissions Changes Not Effective with Open Form

INF: Topics Supported by Microsoft Access as a DDE Server

INF: Two Functions to Calculate Age in Months and Years

INF: Two Methods to Refer to a Field in a Previous Record

INF: Updating a Separate Table When a Value Changes on a Form

INF: Use AutoLookup Technique to Look Up Info Automatically

INF: Using a Conditional Macro to Confirm Changes to a Field

INF: Using a Form Reference Parameter Query in Access Basic

INF: Using a Subquery to Simulate a SQL Sub-SELECT Statement

INF: Using a Subtract Query to Find Unmatched Records

INF: Using Data from MS Access in a WordPerfect Mail Merge

INF: Using Find Method to Find a Quotation Mark or Apostrophe

INF: Using Indexes in Microsoft Access

INF: Using Microsoft Access as a DDE Server

INF: Using Microsoft Word to Edit and Spell Check Memo Field

INF: Using the DDE Item SQLText to Request the Text of a Query

PRA: "Cursor Stops at First/Last Field" Setting Ignored

PRA: "Table Does Not Exist" Error Message When Deleting Table

PRA: ApplyFilter Action Causes Form to be Read- Only

PRA: Calculated Control on Subreport Displays Wrong Data

PRA: Cannot DDE Execute RunSQL Command with Brackets

PRA: Cannot Paste Data from Clipboard Using DDE

PRA: Cannot Use First() and Last() Functions in a Report

PRA: Cannot Use ReportWizard Without Default Windows Printer

PRA: Changing Font Size Causes Subscript Text

PRA: Combo or List Box Column Not Formatted

PRA: Crosstab Query with DLL Reference Fails

PRA: Dashed Lines in Graph Print as Solid Lines

PRA: Datasheet and Run Buttons Disabled On Append Query

PRA: Datasheet Header and Footer Print at Constant Locations

PRA: DISTINCTROW Keyword Ignored in a Cartesian Product

PRA: Duplicate Control Menus and Restore Buttons on Form

PRA: ERR: Undefined Function Referencing Column Property

PRA: Erroneous "Lost Records" Error on Delete Query

PRA: Error Importing Filenames Without Extensions

PRA: Error Previewing Subreports that Call Filter Macro

PRA: Error Using SQL in Report RecordSource Property

PRA: Error: Not Enough System Resources in Access

PRA: Exporting Nulls to Paradox Actually Exports a Space

PRA: GetChunk on ODBC Table Returns "Invalid Argument"

PRA: GP Fault Closing Subform in Datasheet View

PRA: GP Fault Importing Multiuser Microsoft Excel Spreadsheet

PRA: GP Fault Printing Large Report with Low Disk Space

PRA: GP Fault Referencing Column Property of Combo Box

PRA: GP Fault when Creating a Dynaset from Form Dynaset

PRA: Hard-Coded and Passed Wildcards Different in Query

PRA: Hidden Subform Maximized If Main Form Is Maximized

PRA: Import/Append Actions Return Errors for Each Record

PRA: Invalid Characters Added to IN Clause Arguments

PRA: List Box Controls on Forms Painted Incorrectly

PRA: List Separator Setting Causes Table Design Errors

PRA: Microsoft Access Closes Abnormally from a Macro

PRA: Mouse Remains I-beam Over Text Box Scroll Bar

PRA: OLE Objects Seem to Be Acceptable Filter Criteria

PRA: Open OLE Objects Not Saved When Record Changes

PRA: Orders Form Doesn't Print/Preview SubTotal & Total

PRA: Printer Fonts Cause Text to Shift Down and Right

PRA: Printing "Data Only" Prints Gridlines

PRA: Report Prompts Twice for Same Parameter Value

PRA: Report Section with Subreport Not Included In Output File

PRA: Reserved Error -1001 with Linked Crosstab Subreport

PRA: Reserved Error -1051 Pasting Over Primary Key Field

PRA: Run Time Partially Displays Sorting and Grouping

PRA: Screen Redraw Problems When Reordering Groups

PRA: Show All Records Does Not Work in Subforms

PRA: Syntax Error When "(" Is First Character in Criteria Cell

PRA: Wrong Action Query Icon with CreateQueryDef Method

PRA: Wrong RowSourceType for Combo Box Causes GP Fault

PRB:  GoToRecord Macro Does Not Work on Subform

PRB: "#ERROR" Message When Referencing Subreport Controls

PRB: "Circular Reference Caused by Alias" Error Message

PRB: "ODBC Call Failed" When Exporting Table to SQL Server

PRB: "Out of Memory" Error Message When Exporting Table

PRB: "Out of Stack Memory" Error Message with SendKeys Macro

PRB: "Output To" of Print Definition Contains Only Headers

PRB: <Expression> Not Part of Aggregate Function or Grouping

PRB: ADK Custom Setup Hangs During Installation

PRB: ALT+Any Key Combination Does Not Work With Active Popup

PRB: BeforeUpdate and AfterUpdate Field Properties Not Working

PRB: Bitmap May Not Display Correctly

PRB: Cannot Change Combo Box Value If ControlSource Is Counter

PRB: Cannot Change the RecordSource of a Form at Run Time

PRB: Cannot Enforce Referential Integrity in Relationship

PRB: Cannot Make Small Adjustments to Width with EGA Driver

PRB: Cannot Open a Database with a DoMenuItem Macro

PRB: Cannot Open Datasheet as a Pop-Up or Modal Form

PRB: Cannot Open Multiple Instances of the Same Form

PRB: Cannot Save a Blank Record in a Table or Form

PRB: Cannot Save a Blank Record in a Table or Form

PRB: Cannot Scroll Query Grid with ARROW Key or Mouse

PRB: Cannot Sum Calculated Controls in Forms or Reports

PRB: Cannot Use CTRL+SHIFT+HOME to Move to Main Form

PRB: Changes in Subform Design Do Not Update in Main Form

PRB: Changing Show Ruler Option Changes Existing Forms

PRB: Clicking Mouse in Wizard Background Changes Focus

PRB: Close Dynaset Based on Form Multiple Times

PRB: Combo Boxes Open When Window Sized to Vertical Minimum

PRB: Companion Disk Install Runs Out of Space & Requests Disk

PRB: Company Pick List in Suppliers Form Doesn't Filter

PRB: Control Menu Move Command Requires Keyboard Input

PRB: Counter Starts at 2 in Table Created by Make-Table Query

PRB: CTRL+' Does Not Trigger Update Events in Datasheet View

PRB: Current Record Not Immediately Updated with Replace All

PRB: Cursor Position Unchanged in Undo Paste Command

PRB: Database Window Loses its Focus

PRB: DDE App Name for Access Is Incorrect in Manual

PRB: Default Values Used Only with a Bound Control

PRB: DFirst() and DLast() Functions Return Unexpected Records

PRB: Do Not Have Permissions to Modify Secured Report

PRB: DoMenuItem Macro to Export Object Returns Error

PRB: Echo Action Without Any Argument Causes Error

PRB: Empty Field List in Report or Form's Design View

PRB: Error in Column Property Help Menu Topic

PRB: Error Message "Can't Group on Fields Selected with '*'"

PRB: Error Message "Couldn't Find Input Table or Query"

PRB: Error Message "Couldn't Open File" in Shared Environment

PRB: Error Message "Macro '' Not Found"

PRB: Error Message If Path Info for Attached Databases Changes

PRB: Error When Trying to Enforce Referential Integrity

PRB: Errors Installing Companion Disk to Nested Subdirectories

PRB: Example Has Wrong Number for Dlookup Ship Postal Code

PRB: Excess or Garbled Information Appears in List Box

PRB: Export to Word for Windows Creates .TXT Filename

PRB: Expression in Query Grid Does Not Show All Text

PRB: Find Company Macro Does Not Work Correctly in NWIND.MDB

PRB: Focus Does Not Shift When Find Accelerators Are Used

PRB: Form Displays Data from Deleted Field in Query

PRB: Form Handle Not Released When Closed with Basic Code

PRB: Form May Lose the Focus When SHIFT+F8 Is Pressed

PRB: Form Objects Not Placed on Grid by Wizard

PRB: Form Opened in Form View Is Completely Blank

PRB: Form Opens Blank Except for Header

PRB: Formatted Colors Do Not Appear in Text

PRB: Full Path Causes Endless Loop in StartApp() Example

PRB: GoToControl to Control with Focus in AfterUpdate Ignored

PRB: Inconsistent Line Spacing in Summary Reports

PRB: Incorrect Results Received with DSum() Function

PRB: Index Does Not Work in AB Function with NWIND.MDB

PRB: Insert Object Dialog Box Has No "All Files" (*.*) Option

PRB: Join Is Broken by Value(s) in Fields '[Field Name]'

PRB: Label Placed in, Not to Left of, Command Button on Form

PRB: Leading Space in Property Sheet Entry May Cause Problems

PRB: List Box Not Dimmed When Disabled

PRB: Locking First Record Also Locks Last Record

PRB: Macro on Subform Control Executed by Main Form

PRB: Minimizing Pop-Up and Modal Form Loses Application Focus

PRB: MoveSize Action Affects Wrong Window

PRB: Negative GroupOn Interval Reverses Sort Order

PRB: No AutoRepeat with GoToRecord/Next and DoMenuItem

PRB: No Field List When Form Is Based on SQL Statement

PRB: No Implicit Parameters on CrossTab Queries

PRB: Not Enough Stack Memory When Opening Form

PRB: NWIND Order Form Updates Order Amount Field with Zero

PRB: NWIND.MDB Query with Criteria Displays Data in Odd Order

PRB: OnExit Macro Runs with AfterUpdate Macro in Option Group

PRB: OnInsert Event Executed by Unbound Controls

PRB: Opening a Database Read-Only Forces Others to Read-Only

PRB: ORDER BYs Must Be Output Columns in DISTINCT Queries

PRB: Order Entry Ship To Address Contains City Information

PRB: Parameters Expected When Navigating Form with Sub-subform

PRB: Paste Link to MS Excel Displays First Field Name Only

PRB: Print Setup Triggers Report's OnClose, OnOpen Properties

PRB: Properties Do not Reset Between Crosstab and Make Table

PRB: Queries Sent to Remote SQL Server Run Slowly

PRB: Query Information Lost Switching to SQL-Specific Query

PRB: Query Window Does Not Always Scroll to Record

PRB: Record Sort Order Is Different Than Expected

PRB: RecordCount Property Returns Incorrect Number of Records

PRB: Referential Integrity Error Message with Shared Databases

PRB: Report Detail Items Appear in Group Header

PRB: Report Grouping on Date/Time Field Incorrect

PRB: Report Property PageFooter Set to "Not With Rpt Ftr"

PRB: ReportWizard Defaults to 8.5-by-11-Inch Page

PRB: Seek Method Is Faster Than Find Method

PRB: Size To Fit Form Command Does Not Size Form Properly

PRB: Size To Fit Form Command Not Available

PRB: Sorting a Query on a Nested Expression Does Not Work

PRB: Subform Layout Changes Not Saved

PRB: Subreport or Subform Data Missing from "Output To" Result

PRB: Text Box Formatted as Currency Has a Space on the Right

PRB: Trailing CR/LFs Stripped From Text Box When Retrieved

PRB: TransferDatabase Macro Action Does Not Replace Table

PRB: Two Accelerator Keys in Custom Menu Show Only First Key

PRB: Type Conversion Failure when Importing Excel Data

PRB: Typing in Combo Box Does Not Select Item

PRB: Unable to Add All Fields in Graph FormWizard

PRB: Unable to Paste Information into Property Sheet

PRB: Unable to Use Hexadecimal or Octal Values in Properties

PRB: Unbound Controls in Form Datasheet Do Not Print Preview

PRB: Unbound Controls in Form Datasheet Do not Print Preview

PRB: Using "MSACCESS" in DDE Initiate with Run-Time App

PRB: Valid Sum Function Returns '#Name?' in Calculated Control

PRB: ValidationRule Parses Function Name w/o Parens to String

PRB: Where Condition Refers to Fields Not Controls

PRB: Wide Subform Does Not Scroll to Show Active Control


Other

INF: Common Dialog Boxes Allow Only Lowercase Typing

INF: Commonly Asked Questions About Access Version 1.0

INF: Contents: MS Access 1.0 Disks 1-4 (1/14/93, 3.5-Inch)

INF: Converting Julian Dates with Access Basic

INF: Copy and Paste Operations from Forms to Queries

INF: Copying Columns In Microsoft Access

INF: Creating and Converting Version 1.0 and 1.1 Databases

INF: Explanation of Compliance Checking Program (CCP)

INF: How Microsoft Access Deletes Objects from a Database

INF: How to Open UTILITY.MDA

INF: How to Optimize Microsoft Access Version 2.0 Performance

INF: How to Optimize Microsoft Access Version 2.0 Queries

INF: How to Search the CompuServe Knowledge Base

INF: How to Use Command Line Switches

INF: Initial Size of Every .MDB File is 64K

INF: List of Articles Relating to MSACCESS.INI File

INF: Microsoft Access, Scanners, and Scanning Software

INF: Microsoft Access 1.0 (1/14/93) Disks 5-7 Contents (1.2MB)

INF: Microsoft Access Performance Enhancement Recommendations

INF: Microsoft Access Table Structure Is Variable Length

INF: ODBC Disk Contents (1/14/93, 5.25-Inch, MS Access 1.0)

INF: Overview of Conversion Issues from Version 1.1 to 2.0

INF: Overview of Version 2.0 Add-Ins, Builders, and Wizards

INF: Sample Function to Determine Language Version

INF: Sample Version 1.1 MSACCESS.INI File

INF: Trapping for Library Being Opened Before Database

PRA: Cannot Add Counter Columns to Tables with > 4 MB Data

PRA: GP Fault with MS Packager Object in Bound OLE Field

PRA: Non-TrueType Fonts with 8514.DRV Cause GP Fault

PRA: Slow Repaint When Saving Form with Many Controls

PRA: STFSETUP.EXE Does Not Overwrite Existing SYSTEM.MDA

PRA: Transaction Limit Can Cause 'Out of Memory' Error

PRB: "Couldn't Open File" Error Message

PRB: "Output To" of Print Definition Contains Only Headers

PRB: Alert With Wrong Filename Given When Opening File Copied

PRB: Back Button Disabled After Selecting Wizard Type

PRB: Control Menu Move Command Requires Keyboard Input

PRB: CTRL+BREAK Makes Mouse Pointer Disappear in Module

PRB: Error Message "Couldn't Find Object [Object Name]"

PRB: File Rename Dialog Still Enabled When No Filename Given

PRB: Opening a Database Read-Only Forces Others to Read-Only

PRB: System Error When Sharing Database on LAN Man/Workgroups

PRB: Using "Save As" from Table Design View Does Not Copy Data


Referencing Objects

INF: Passing Values from a Form to a Parameter Query

PRB: Error Message "Couldn't Find Object [Object Name]"


Referential Integrity

INF: Updating a Separate Table When a Value Changes on a Form

PRA: Erroneous "Lost Records" Error on Delete Query

PRB: Cannot Enforce Referential Integrity in Relationship

PRB: Referential Integrity Error Message with Shared Databases


Relationships

INF: Changing the Relationship Between Two Existing Tables

INF: How to List the Related Tables in a Database in Version

INF: How to Remove Relationships

INF: Join Type Mismatch Errors Caught at Runtime

INF: Relationships Between Attached Microsoft Access Tables

PRB: Can't Create Two Relationships Between Same Tables


SQL

INF: Creating Result Equivalent to SQL UNION Operator Result

INF: Empty Table Created by SELECT INTO with No Matching Rows

INF: Limit on AND's in SQL Select Statement

INF: Queries Sort by Order of IN() Parameters

INF: Using a Subquery to Simulate a SQL Sub-SELECT Statement

INF: Using a Subtract Query to Find Unmatched Records

PRB: "Too Many Expressions in Distinct Output" Error


User Interface

INF: Copying and Pasting Text in a Property Sheet

INF: Error When Opening Table in Table Design View

INF: ESC Key Turns Off Extend (Selection) Mode

INF: Extend Mode and ESC in Form View

INF: How to Add Items to the Help Menu

INF: How to Make Custom Application Name Appear in Task List

INF: How to Make Welcome to MS Access Opening Screen Display

INF: Microsoft Access, Scanners, and Scanning Software

INF: Microsoft Access is Pen Compatible but Not Pen Aware

INF: SHIFT+ENTER Key Combination vs. CTRL+ENTER

INF: Use CTRL+M to Open Objects in Design View

INF: View Procedures Sorts Modules Alphabetically

PRA: Cannot Cascade or Tile with 50 Windows in Access

PRA: Find Toolbar Button Not Grayed After Pressing

PRA: Machine Hangs When Relationships Box is Displayed

PRA: Microsoft Access Changes MS-DOS Screen/Text Colors

PRA: Selecting Options in Find Dialog Box

PRA: Setup Program Not Handling All Palette Messages

PRA: SHIFT+HOME Does Not Select All the Text

PRA: Text Not Replaced in All Modules with Replace All

PRB: "Welcome to Microsoft Access" Screen Disables Status Bar

PRB: Alert With Wrong Filename Given When Opening File Copied

PRB: ALT+Any Key Combination Does Not Work With Active Popup

PRB: CanGrow or CanShrink Problems in Report Header or Footer

PRB: Cannot Choose Custom Bitmap for Toolbar Button

PRB: Cannot Exit Extend Mode in Parameters Dialog Box

PRB: Cannot Scroll Left in Form's Design View with Rulers

PRB: Cannot Scroll Query Grid with ARROW Key or Mouse

PRB: Changing Show Ruler Option Changes Existing Forms

PRB: Column in QBE Grid Keeps Focus After Clicking Field List

PRB: Column Widths in Table Design Not Saved

PRB: Combo Boxes Open When Window Sized to Vertical Minimum

PRB: Compile All Command is Enabled After Saving a Module

PRB: CTRL+BREAK Makes Mouse Pointer Disappear in Module

PRB: CTRL+HOME in List Box Moves to First Item in List

PRB: Cursor Position Unchanged in Undo Paste Command

PRB: Database Window Loses its Focus

PRB: Edit Find Dialog Box Is Modal in Form View

PRB: Edit Menu Commands Unavailable in Design View

PRB: Error Message "The File WFWNET.DR_ Could Not Be Found"

PRB: Expression in Query Grid Does Not Show All Text

PRB: File Rename Dialog Still Enabled When No Filename Given

PRB: Floating Objects Can Cause Unusual Effects

PRB: Grid Lines Not Visible In Table Datasheet View

PRB: In Extend Mode, Text to Right of Indicator Is Selected

PRB: List Box Not Dimmed When Disabled

PRB: Menu Visible When All Objects Are Minimized

PRB: Microsoft Access Cannot Paste Entire Column in Query Grid

PRB: Microsoft Access Trims Spaces Off Database Names

PRB: Object Buttons in Database Window Do Not Change Colors

PRB: Opening a Database Read-Only Forces Others to Read-Only

PRB: Opening Screen Size Is Different from Earlier Session

PRB: Paste Unavailable After Record Is Copied to Clipboard

PRB: Pressing ENTER with Database Window Minimized Opens a Doc

PRB: Pressing SHIFT While Dragging Not Working on New Control

PRB: Query Design Status Bar Does Not Have Help Message

PRB: Query Toolbar and Menus Are Not Updated Concurrently

PRB: SCROLL LOCK Has No Effect in Form or Datasheet View

PRB: Scrolling to Bottom of Module Window Goes Past Typed Info

PRB: Size To Fit Form Command Not Available

PRB: Sizing Rows and Columns to Zero Works Differently

PRB: Toolbars Do Not Use Control Panel Button Face Color

PRB: When Column Selected and Deleted, Query Grid Disappears

PRB: Zoom Box Accessible When Multiple Fields Are Selected


Import/Export/Attach
Microsoft Access Knowledge Base

Welcome to the Microsoft Access Knowledge Base help file.  This help system includes 1313 articles that relate to the Microsoft Access  for Windows.  These articles were developed by Microsoft's Product Support Engineers.  This help file is a snapshot of the Knowledge Base as of April 13, 1994.  New and updated articles can be found on both CompuServe, GENIE and Internet.  This help file also lists Training Centers in your local area, third party application and developers,  and User Groups.  This help file contains helpful tips, programming examples(INF), known problems(PRB, PRA), References, FastTips and other information that may not be addressed in the manuals.

Please feel free to distribute this information in compliance with the terms of Microsoft.

Fast Tips

Forms (Specific)

Forms/Reports (Common)

General

Import/Export/Attach

Btrieve

Excel/Lotus

Fox/Xbase

Other Access .MDB's

Other ODBC/ISAM Drivers

Other

Paradox

SQL Server/SPT.DLL

Text (Delimited)

Text (Fixed Width)

Interoperability

Macros

Non-Product/Non-Technical

Programming

Queries

Reports (Specific)

Security

Setup

Tables

Windows Issue

Printing


Other Access .MDB's

INF: Attached Table Must Be Opened as Dynaset from Modules

PRA: Record Count Incorrect with Multiuser Tables

PRB: "Maximum Size Reached" Error Attempting to Import File

PRB: Error Message If Path Info for Attached Databases Changes

PRB: TransferDatabase Macro Action Does Not Replace Table


Btrieve

INF: Btrieve 6.0 Data Type Does Not Work with Microsoft Access

INF: Definitions for Settings in WIN.INI Btrieve Section

INF: Export Btrieve Table Without Existing Xtrieve FILE.DDF

INF: Xtrieve Data Dictionary (.DDF) File Information

PRA: Attached Btrieve Table Rounds Time Values

PRA: Error Importing Filenames Without Extensions

PRB: "Btrieve-Out of Resources" Error Msg with Attached Table

PRB: "Internal Database Error (-5001)" Msg Using Btrieve NLM

PRB: "Out of Memory" Error Message When Exporting Table

PRB: "Unexpected Error from External Database Driver [20]"

PRB: "Unexpected Error from External Database Driver [22]"

PRB: 'Couldn't find object <tablename>' Error with Btrieve

PRB: Btrieve Files Created with Btrieve 6.0 NLM Not Supported

PRB: Empty Table List When Attaching Btrieve Table

PRB: Error Message When Attaching Btrieve Table

PRB: Error Message: Too Many Memo or OLE Fields

PRB: Exclusively Locked Error When Attaching to Btrieve Table

PRB: Incorrect Btrieve Error Message, [Btrieve ISAM] section


Excel/Lotus

INF: Access Table with Time Field Exports Strangely to Excel

INF: Imported Microsoft Excel Date Fields Are Off by 4 Years

INF: Sample DDE Macro Communicates with Microsoft Excel 4.0

PRA: Access Hangs Importing Big Lotus 1-2-3 Spreadsheets

PRA: GP Fault Importing Multiuser Microsoft Excel Spreadsheet

PRA: Importing Numeric Column Names in Spreadsheets

PRA: Problem Exporting "Single" Numeric Data to MS Excel

PRA: Table Export to Excel Does Not Set Database Name

PRA: TransferSpreadsheet Causes Error -1310

PRB: "Invalid Range" Error When Importing from MS Excel

PRB: 'Invalid Range' Error When Importing Spreadsheet Range

PRB: Microsoft Excel Custom Date Format Not Detected by Import

PRB: Paste Link to MS Excel Displays First Field Name Only

PRB: Type Conversion Failure when Importing Excel Data


Fox/Xbase

INF: Attaching to FoxPro Data in Microsoft Access

INF: dBASE SET DELETED Characteristic in Microsoft Access

INF: How MS Access Variable-Length Fields Export to dBASE

INF: How to Import FoxBase for Macintosh Files

INF: How to Import Several dBASE Databases Simultaneously

INF: Importing, Exporting, and Attaching FoxPro 2.0, 2.5 Data

PRA: Error Importing Filenames Without Extensions

PRA: Hang Importing .DBF Files Longer Than dBASE IV Max.

PRB: "Can't Update Currently Locked" Attaching FoxPro Table

PRB: Error While Importing FoxPro Table Structure

PRB: Irregular Characters in Attached dBASE IV Memo Field

PRB: MS Access Converts Extended Chars in Attached FoxPro DBF

PRB: Rounding Errors Importing/Exporting dBASE IV Values

PRB: Two Users Can Open the Same dBASE Database Exclusive


Other ODBC/ISAM Drivers

INF: Conversion of Oracle Data Types to Microsoft Access

INF: Data Source Dialog Box Does Not List ODBC Data Sources

INF: Filenames/Version Numbers, ODBC Files for MS Access V1.1

INF: Force MS Access to Use "Snapshot" Mode for Attached Data

INF: How to Optimize MS Access Using ODBC Data Sources

INF: How to Use Q+E to View SQL Server Tables

INF: Overview of the ORACLE ODBC Driver (1.x)

INF: Sample Function to Provide Password for Attached Tables

INF: Storing SQL Database Login IDs and Passwords Locally

INF: Upper Limit for QueryTimeout and LoginTimeout Parameters

INF: Using SQL Server ODBC Driver with Sybase Servers

PRA: Cannot Connect to SQL Server w/ NetWare, Workgroups

PRA: Error When Import dBASE, FoxPro, or Paradox Table

PRA: SQORA.DLL Does Not Allow Lengthy SQL Statements

PRA: SQORA.DLL Does Not Allow Lengthy SQL Statements

PRB: "ORA-00904: Invalid Column Name" Error Message in Query

PRB: 'Couldn't Find Installable ISAM' Error

PRB: GP Fault Attaching Tables with Old CTL3D.DLL File

PRB: Remote ODBC Tables Are Read-Only Without a Unique Index

PRB: TransferDatabase Macro Accepts Invalid File Names

PRB: Troubleshooting 'ODBC - couldn't find ODBC.DLL' Error


Other

INF: Attach R:BASE Table by Exporting dBASE Format in R:BASE

INF: Attached Table Must Be Opened as Dynaset from Modules

INF: Attaching Clipper Tables to Microsoft Access Databases

INF: Cannot Create Relationships with Attached Tables

INF: Case Sensitivity in Queries Differs with Attached Tables

INF: Differences Between Native and Attached Tables

INF: Exporting Queries to ASCII

INF: Five Parameters to Set in ISAM Section of MSACCESS.INI

INF: How to Export the Results of a Query

INF: How To Get Microsoft Works Files into Microsoft Access

INF: How to Import a Microsoft Windows Cardfile Data File

INF: How to Mark Records with Unmatched or Invalid Values

INF: How to Optimize MS Access Using ODBC Data Sources

INF: How to Remove Attached Tables with a Macro

INF: How to Use DataPerfect Data in Microsoft Access

INF: Import/Export Accepts Only 24-Hour Time Format

INF: Importing DataEase Data Files

INF: Microsoft Access and ORACLE ODBC Drivers

INF: Microsoft Access Data in a Word for Windows Print Merge

INF: New ODBC Driver for Microsoft Access Version 2.0

INF: Using Data from Access in a Word for Windows Print Merge

INF: Using Microsoft Access 2.0 Databases with Visual Basic

PRA: '#' Appears in Attached Table Name in Error Message

PRA: Cannot Export Paradox/dBase Tables

PRA: Import/Append Actions Return Errors for Each Record

PRA: Invalid Characters Added to IN Clause Arguments

PRB: "Out of Memory" Error Message When Exporting Table

PRB: Creating Multiple New Import/Export Specifications

PRB: Default Values of Attached Table Not Used

PRB: DoMenuItem Macro to Export Object Returns Error

PRB: Erroneous Characters Appear in Imported dBASE IV Database

PRB: Error When Opening Attached Table in Shared .MDB File

PRB: Export Table to Other Database Type Does Not Create Index

PRB: Export to Word for Windows Creates .TXT Filename

PRB: Exporting Date Fields to Text Includes Time Format

PRB: GP Fault Using an Out of Date ODBC Driver

PRB: System Defaults Not Showing in Import/Export Setup

PRB: TransferSpreadsheet Action Does Not Add File Extention


Paradox

INF: Error Msg "Operation Not Supported on Paradox Table..."

INF: How To Import or Attach Paradox for Windows 1.0 Files

INF: MS Access Cannot Attach or Import Paradox 4.0 Tables

INF: Paradox Tables, Indexes, and Multiple Connections

INF: Trapping SQL Server RAISERROR() Function Values

PRA: Bad Results Searching Multicolumn Paradox Indexes

PRA: Cannot Export Paradox/dBase Tables

PRA: Error Importing Filenames Without Extensions

PRA: Error Msg: Data Has Changed, Operation Aborted

PRA: Exporting Nulls to Paradox Actually Exports a Space

PRA: Fast Search on Indexed Paradox Column Fails

PRA: Microsoft Access Ignores Paradox Private Directory Rules

PRA: Ordered Query on Attached Paradox Table

PRB: "Couldn't Open File" Error Message Using Paradox Table

PRB: "Out of Memory" Error Message When Exporting Table

PRB: Cannot Attach Paradox Table on Read-Only Drive

PRB: Exporting Table with OLE Object or Memo Field to Paradox

PRB: Internal Database Error (-5207) When Attaching Tables

PRB: Out of Disk Space Error Makes Paradox Table Unusable

PRB: Paradox Character Translation Different in Win 3.0 & 3.1


SQL Server/SPT.DLL

INF: "Incorrect Syntax Near '-'" Using TransferDatabase Action

INF: Connecting to Sybase SQL Server from an ODBC Application

INF: Data Source Dialog Box Does Not List ODBC Data Sources

INF: Determining the Version of Catalog Stored Procedures

INF: Enforcing Transactions on Attached SQL Server Tables

INF: Force MS Access to Use "Snapshot" Mode for Attached Data

INF: How Microsoft Access 1.x Uses SQL Server Connections

INF: How MS Access Handles Logins to Attached SQL Tables

INF: How to Determine Version of INSTCAT.SQL File on Server

INF: How to Query SQL Server Tables Without Attaching

INF: How to Use a Main/Subform with Attached SQL Server Tables

INF: How to Use Q+E to View SQL Server Tables

INF: Implementing Counter Values on Attached SQL Server Tables

INF: ODBC Setup for Microsoft Access and SQL Server

INF: Parameter Queries, Wildcards, and SQL Server

INF: Performing an SQL Bulk Action Query from Access Basic

INF: Query Optimizing Tips for Attached SQL Database Tables

INF: Requirements to Connect to Sybase SQL Server

INF: SQL Server System Administrator Cannot See System Tables

INF: SQL Server Triggers and Key Values to and from MS Access

INF: SQL Server Views Read-Only When Attached

INF: Storing SQL Database Login IDs and Passwords Locally

INF: Unexpected Stored Procedures Found in SYSOBJECTS Table

INF: Unsupported SQL Keywords Not Listed in Microsoft Access

INF: Upper Limit for QueryTimeout and LoginTimeout Parameters

INF: Using SQL Server ODBC Driver with Sybase Servers

INF: Using the INSTCAT.SQL Script with an ODBC Application

INF: Using TransferDatabase Macro to Attach to SQL Server Data

INF: Using WIN.INI & ODBC.INI When Attaching SQL Server Table

PRA: SQL 4-Byte Values Incorrectly Mapped to Text

PRA: SQL Delete Triggers Function Incorrectly

PRA: Unable to Import a SQL Server View

PRB: "ODBC Call Failed" When Exporting Table to SQL Server

PRB: 'Unable to Load Communication Module'

PRB: Cannot Use SQL Pass-Through Command for Subreport

PRB: Connection Not Open Error Message

PRB: Driver Cannot Be Found When Attaching to SQL Server

PRB: Err: "Data Source Not Found, No Default Driver Specified"

PRB: ErrMsg: CREATE TABLE Permission Denied in Export to SQL

PRB: Error Message "Unable to Connect to Data Source"

PRB: Exporting to SQL Server Does Not Create Indexes

PRB: GP Fault Attaching Tables with Old CTL3D.DLL File

PRB: Incorrect Catalog Stored Procedures Error Message

PRB: Microsoft Access Can't Recognize SQL Server Double Index

PRB: Operation Stops when Editing Attached SQL Tables

PRB: Queries Sent to Remote SQL Server Run Slowly

PRB: Query Fails When Linked SQL Server Table Cannot Be Found

PRB: SQL Data Sources Dialog Box Lists No Servers

PRB: SQL Server Logon Error Message "Select Permission Denied"

PRB: Stored procedure 'PROCEDURE' not found -- Error Message

PRB: Unable to Connect to Attached SQL Server Table, Error Msg


Text (Delimited)

INF: How First Line of Data is Used to Import Delimited Text

INF: TransferText Action Removes Spaces from Field Names

PRA: "Invalid Argument" Error Message Exporting Table

PRA: Importing Delimited Text Files Strips Off Decimals

PRB: "Out of Memory" Error Message When Exporting Table

PRB: Access Adds Date Delimiters When Importing Text

PRB: Cannot Import YYMMDD Dates in Fixed-Width Text Files

PRB: Error Message When Importing Informix Delimited Text File

PRB: Subreport or Subform Data Missing from "Output To" Result


Text (Fixed Width)

INF: Importing Fixed-Width Text Files

INF: Sample Function to Insert CR/LF in Fixed-Width Files

PRA: Importing Delimited Text Files Strips Off Decimals

PRB: Access Adds Date Delimiters When Importing Text

PRB: Cannot Import YYMMDD Dates in Fixed-Width Text Files

PRB: Creating Multiple New Import/Export Specifications

PRB: Import/Export Setup Cancel Button Cancels Unsaved Changes

PRB: Subreport or Subform Data Missing from "Output To" Result

PRB: Unable to Import Portion of Fixed-Width Text Files


Interoperability
Microsoft Access Knowledge Base

Welcome to the Microsoft Access Knowledge Base help file.  This help system includes 1313 articles that relate to the Microsoft Access  for Windows.  These articles were developed by Microsoft's Product Support Engineers.  This help file is a snapshot of the Knowledge Base as of April 13, 1994.  New and updated articles can be found on both CompuServe, GENIE and Internet.  This help file also lists Training Centers in your local area, third party application and developers,  and User Groups.  This help file contains helpful tips, programming examples(INF), known problems(PRB, PRA), References, FastTips and other information that may not be addressed in the manuals.

Please feel free to distribute this information in compliance with the terms of Microsoft.

Fast Tips

Forms (Specific)

Forms/Reports (Common)

General

Import/Export/Attach

Interoperability

DDE Server Topics

Graphing

Interoperability  - Other

OLE Registration Problem

Print Merge with Word

Macros

Non-Product/Non-Technical

Programming

Queries

Reports (Specific)

Security

Setup

Tables

Windows Issue

Printing


DDE Server Topics

INF: DDE Link Cannot Find Data; Opens 2nd Copy of Server App

INF: How to Buffer SQL Strings Using DDE

INF: How to Communicate with NetDDE

INF: How to Direct DDE to a Specific Instance of a Server

INF: How to Execute Macro Actions Using DDE

INF: How to Get Field Data Types from a Table Using DDE

INF: How to Get SQL Pass-Through Functionality Using Q+E

INF: How to Run Access Basic Functions with DDE

INF: How to Use DDE to Communicate with a Run-Time Application

INF: MS Access Does Not Support Parameter Queries as DDE Topic

INF: Part 1: DDE in Visual Basic to Request MS Access Data

INF: Part 2, DDE in Visual Basic to Request Data from Access

INF: Running a MS Access Macro from Visual Basic Using DDE

INF: Sample DDE Macro Communicates with Microsoft Excel 4.0

INF: Sending the Current Record to Word for Windows with DDE

INF: Topics Supported by Microsoft Access as a DDE Server

INF: Using Microsoft Access as a DDE Server

INF: Using the DDE Item SQLText to Request the Text of a Query

PRA: Cannot DDE Execute RunSQL Command with Brackets

PRA: Cannot Paste Data from Clipboard Using DDE

PRA: DDEInitiate from Word Fails When Access Not Running

PRA: Timeout While Waiting for DDE Response

PRB: "Syntax Error in String" Error Using DDE() and DDESend()

PRB: "Syntax Error in String" Error Using DDE() and DDESend()

PRB: Bound SubReport Does Not Show DDE Data

PRB: DDE App Name for Access Is Incorrect in Manual

PRB: DDE Statements Invalid in List Box or Combo Box Control

PRB: Err Msg "The Other Application Quit" with MS Excel 4.0

PRB: Paste Link to MS Excel Displays First Field Name Only


Graphing

INF: Converting Graphs from Microsoft Graph Version 3.0 to 5.0

INF: Graphing Current Sales Compared with Accumulated Sales

INF: How to Change the Order of Columns in a Graph

INF: How to Create a Graph Bound to Two Combo Boxes

INF: How to Create a Graph Without a Title

INF: How to Order Data in a Graph

INF: Microsoft Graph Changes May Not Be Retained

INF: OLE: New Graph Object Frames are Blank

PRA: "Invalid Reference to Field in Query" Error Message

PRB: 'FastForward' Button Is Unavailable in Graph FormWizard

PRB: Graph Object Is Dimmed in Form View

PRB: GraphWizard Does Not Run or "Syntax Error" Is Displayed

PRB: Unable to Add All Fields in Graph FormWizard

PRB: Unable to Specify Label Order in Graph FormWizard


OLE-Create/Updt Embd Objects

INF: Calling RegQueryValue() to get an OLE Object Class Name

INF: Finding the OLE ClassKey of an Embedded Object

INF: How to Use In-Place Activation with OLE Objects

INF: How to Use In-Place Activation with OLE Objects

INF: How to Use SendKeys in a Macro to Change an OLE Link

INF: List of OLE 2.0 Features Supported in MS Access v. 2.0

INF: List of OLE 2.0 Features Supported in MS Access v. 2.0

INF: Users Can Edit but Not Commit Read-Only OLE Objects

PRA: GP Fault with MS Packager Object in Bound OLE Field

PRA: OLE Objects Clipped Using Fahrenheit Video Driver

PRA: OLE Objects Seem to Be Acceptable Filter Criteria

PRA: OLE Objects Seem to Be Acceptable Filter Criteria

PRA: Open OLE Objects Not Saved When Record Changes

PRB: Bound OLE Object Blank in Form View

PRB: Error Message: Too Many Memo or OLE Fields

PRB: How the Scaling Property Affects Embedded MS Draw Object

PRB: How the Scaling Property Affects Embedded MS Draw Object

PRB: Insert Object Dialog Box Has No "All Files" (*.*) Option

PRB: Insert Object Dialog Box Has No "All Files" (*.*) Option

PRB: Insert Object Dirties Record

PRB: New OLE Field is Created as Text Box in a New Form

PRB: New OLE Field is Created as Text Box in a New Form

PRB: No Error Given When Linked OLE Object Cannot be Found

PRB: OLE Excel Format Changes when Updated in Microsoft Access

PRB: OLE MS Excel, Windows Word Do Not Close When Form Closed


Interoperability  - Other

INF: Description of Vendor Independent Mail (VIM)

INF: How to Add an Icon to Program Manager Using DDE

INF: How to Create Tasks in MS Project for Windows Using DDE

INF: How to Pass Information to Microsoft Access Using DDE

INF: How to Use DDE to Fill a List Box

INF: How to Use DDE to Pass Information to MS Access v. 2.0

INF: How to Use the Quit Macro Action

INF: Links to Formatted DDE Items Result in Text

INF: OpenDatabase and CloseDatabase Pseudo Actions

INF: Sending a MAPI Mail Message Using Access Basic

INF: Topics Supported by Microsoft Access as a DDE Server

INF: Using Data from Access in a Word for Windows Print Merge

INF: Using Data from MS Access in a WordPerfect Mail Merge

INF: Using Microsoft Access 2.0 Databases with Visual Basic

INF: Using Microsoft Access as a DDE Server

INF: Using Version 1.1 Databases in Version 2.0

PRA: Report Section with Subreport Not Included In Output File

PRB: Cannot Auto Update an OLE-Linked Object in a Table

PRB: Cannot DDEPoke More Than 255 Characters of Text

PRB: DDEPoke to Word for Windows Incorrectly Formatted

PRB: Error While Importing FoxPro Table Structure

PRB: Network Problems May Cause "Segment Load Failure" Error

PRB: Random Characters in Text Box Bound to OLE Object Field

PRB: Wait Argument in SendKeys May Not Stop Macro Processing


Print Merge with Word

INF: Exporting WordPerfect Secondary Files to Microsoft Access

INF: Importing Word Print Merge Data Files to Microsoft Access

PRB: Cannot Connect DDE from Word 6.0 to Microsoft Access


Macros
Microsoft Access Knowledge Base

Welcome to the Microsoft Access Knowledge Base help file.  This help system includes 1313 articles that relate to the Microsoft Access  for Windows.  These articles were developed by Microsoft's Product Support Engineers.  This help file is a snapshot of the Knowledge Base as of April 13, 1994.  New and updated articles can be found on both CompuServe, GENIE and Internet.  This help file also lists Training Centers in your local area, third party application and developers,  and User Groups.  This help file contains helpful tips, programming examples(INF), known problems(PRB, PRA), References, FastTips and other information that may not be addressed in the manuals.

Please feel free to distribute this information in compliance with the terms of Microsoft.

Fast Tips

Forms (Specific)

Forms/Reports (Common)

General

Import/Export/Attach

Interoperability

Macros

Action Arguments

Actions

Condition Column

Macro Name

Other

Non-Product/Non-Technical

Programming

Queries

Reports (Specific)

Security

Setup

Tables

Windows Issue

Printing


Actions

INF: "Incorrect Syntax Near '-'" Using TransferDatabase Action

INF: AutoExec Macro Runs Only When Database Is Opened

INF: Checking for Last Or First Record in a Macro

INF: CopyObject Appears to Copy Wrong Object

INF: Error Msg: Cannot Hide the Control that Has Focus

INF: Errors When RunSQL Action Argument Exceeds 256 Characters

INF: Form Controls to Increment and Decrement a Date

INF: Form OnOpen Event May Not Set Values of Unbound Controls

INF: How to Create For Next Loops in a Macro

INF: How to Hide the Database Window at Startup

INF: How to Remove Attached Tables with a Macro

INF: How to Requery a Combo Box on Subform

INF: Macro to Check for Duplicate Values in a Field

INF: Macro to Enter Date Record Was Last Modified

INF: Minimized Popup Forms Cannot be Easily Restored

INF: Recent File List Displays Deleted .MDB Files

INF: Requery, Repaint, and Records Refresh

INF: Set Focus to a Subform Control Using GoToControl Action

INF: TransferText Action Removes Spaces from Field Names

INF: Using SendKeys to Change Option Menus

INF: Using TransferDatabase Macro to Attach to SQL Server Data

PRA: ApplyFilter Action Causes Form to be Read- Only

PRA: DoMenuItem Run Macro Causes GP Fault

PRA: GPF Using OpenForm Action to Hide Modal Pop- Up Form

PRA: Macro with Action on Different Line Does Not Work

PRA: Microsoft Access Closes Abnormally from a Macro

PRA: Problems Opening a Modal and Pop-Up Form as Dialog

PRA: RunMacro May Not Work with Large Repeat Count

PRB:  GoToRecord Macro Does Not Work on Subform

PRB: "Out of Stack Memory" Error Message with SendKeys Macro

PRB: Alert Appears When it Should Not When Running a Macro

PRB: CancelEvent Action in OnClose Macro Prevents Exit

PRB: Cannot Open a Database with a DoMenuItem Macro

PRB: Cannot Set Focus to Any Object Except MS Access Menu

PRB: DoMenuItem Macro to Export Object Returns Error

PRB: Echo Action Without Any Argument Causes Error

PRB: GoToControl to Control with Focus in AfterUpdate Ignored

PRB: Invalid Table Name Error with TransferSpreadsheet Action

PRB: Macro Action Argument Runs with False Condition

PRB: Macro with Two SendKeys Actions Loops Infinitely

PRB: MoveSize Action Affects Wrong Window

PRB: No AutoRepeat with GoToRecord/Next and DoMenuItem

PRB: OpenTable Action Ignores Data Mode If Table Open

PRB: Restore Macro Action Does Not Appear to Work

PRB: RunCode Macro May Not Evaluate Conditions

PRB: SendKeys Macro Does Not Run

PRB: SetWarnings Action Works Only While Macro Is Running

PRB: Unable to Close Microsoft Access from Control-Menu Box

PRB: UndoCurrentRecord In BeforeUpdate Property Causes Error

PRB: Wait Argument in SendKeys May Not Stop Macro Processing


Action Arguments

INF: "Incorrect Syntax Near '-'" Using TransferDatabase Action

INF: Close Action has Blank Line in Object Type Argument

INF: Errors When RunSQL Action Argument Exceeds 256 Characters

INF: Form Controls to Increment and Decrement a Date

INF: How to Fill Text Boxes on a Report with Access Basic

INF: How to Force a New Line in a MsgBox Statement

INF: How to Send the Contents of a Control with SendKeys

INF: Requery Control Err Msg: There Is No Control Called...

INF: RunApp Action Command has 255 Character Argument Limit

INF: SelectObject Action Does Not Display Attached Table Names

PRA: Problems Opening a Modal and Pop-Up Form as Dialog

PRB: "Out of Stack Memory" Error Message with SendKeys Macro

PRB: Cannot Open a Database with a DoMenuItem Macro

PRB: Echo Action Without Any Argument Causes Error

PRB: Filtering Form with OpenForm Action Causes "#Name?" Error

PRB: Invalid Reference to Field '<Value>' Using SetValue

PRB: Macro Action Argument Runs with False Condition

PRB: Macro with Two SendKeys Actions Loops Infinitely

PRB: Not Enough Stack Memory When Opening Form

PRB: OpenTable Action Argument Does Not List Attached Tables

PRB: TransferDatabase Macro Accepts Invalid File Names

PRB: TransferSpreadsheet Action Does Not Add File Extention

PRB: Using TransferDatabase to Export to Btrieve Format


Condition Column

INF: How to Create Do While/Do Until Loops in a Macro

INF: Macro to Check for Duplicate Values in a Field

INF: Temporarily Disabling a Macro Action

INF: Using a Conditional Macro to Confirm Changes to a Field

PRA: Macro with Action on Different Line Does Not Work

PRB: Macro Condition Evaluates True if Control Is Null


Macro Name

INF: All Duplicate Macro Names in Macro Group Are Executed

INF: Error Message Using AutoKeys Macro

PRB: BeforeUpdate Macro Running Twice

PRB: Space in Macro Name Column Stops Macro

PRB: Two Accelerator Keys in Custom Menu Show Only First Key


Other

INF: Checking for Last Or First Record in a Macro

INF: Cut and Paste Removes Blank Lines in Macro's Design View

INF: Deciding Between Macros and Access Basic for Programming

INF: How to Buffer SQL Strings Using DDE

INF: How to Execute Macro Actions Using DDE

INF: How to Fill Text Boxes on a Report with Access Basic

INF: Sample Macro for Repair/Compact Operations

INF: Tips on How to Troubleshoot Microsoft Access Macros

PRB: "Out of Stack Memory" Error Message with SendKeys Macro

PRB: Canceling a DoCmd Print Returns Error Messages

PRB: Cannot Add Security Items to Custom Menu

PRB: CTRL+HOME Navigation Problem in Macro Design View

PRB: Macro with Two SendKeys Actions Loops Infinitely

PRB: SendKeys Macro Action Does Not Work on Toggle Keys


Non-Product/Non-Technical
Microsoft Access Knowledge Base

Welcome to the Microsoft Access Knowledge Base help file.  This help system includes 1313 articles that relate to the Microsoft Access  for Windows.  These articles were developed by Microsoft's Product Support Engineers.  This help file is a snapshot of the Knowledge Base as of April 13, 1994.  New and updated articles can be found on both CompuServe, GENIE and Internet.  This help file also lists Training Centers in your local area, third party application and developers,  and User Groups.  This help file contains helpful tips, programming examples(INF), known problems(PRB, PRA), References, FastTips and other information that may not be addressed in the manuals.

Please feel free to distribute this information in compliance with the terms of Microsoft.

Fast Tips

Forms (Specific)

Forms/Reports (Common)

General

Import/Export/Attach

Interoperability

Macros

Non-Product/Non-Technical

Other

Programming

Queries

Reports (Specific)

Security

Setup

Tables

Windows Issue

Printing


Other

INF: Overview of MS Access Developer's Toolkit (ADT) v. 2.0


Openv

OpenvOs


OpenvOs

PRA: Using Task List to Exit Run Time Causes GP Fault


Access Specific Printing

Margins

Other

Print Preview not Match Output


Margins

PRA: Datasheet Header and Footer Print at Constant Locations


Other

INF: How to Print Text to Default Printer with Access Basic

INF: How to Use the PrtDevNames Property on Reports

INF: Improved Print Merge Feature In Microsoft Access 1.1

INF: Using SendKeys to Change Option Menus

PRA: GP Fault Printing Large Report with Low Disk Space

PRA: Printer Fonts Cause Text to Shift Down and Right

PRA: Printing "Data Only" Prints Gridlines

PRA: Sent Keys Lost if Microsoft Access Yields Processor

PRB: Choosing a New Printer Resets Some Printer Settings

PRB: Forms and Reports Print Slowly, Large Temporary Files

PRB: Moving Backward in Report Print Preview Window Is Slow

PRB: Subreport or Subform Data Missing from "Output To" Result

PRB: Tops of Letters May Be Cut Off with Some PostScript Fonts


Print Preview not Match Output

INF: Screen Fonts May Not Match Printer Output Fonts

PRB: Text Label Truncated Printing Form on Epson 9-Pin Printer

PRB: Two Labels on Top of Each Other Both Print

PRB: Unbound Controls in Form Datasheet Do Not Print Preview

PRB: Unbound Controls in Form Datasheet Do not Print Preview


Programming
Microsoft Access Knowledge Base

Welcome to the Microsoft Access Knowledge Base help file.  This help system includes 1313 articles that relate to the Microsoft Access  for Windows.  These articles were developed by Microsoft's Product Support Engineers.  This help file is a snapshot of the Knowledge Base as of April 13, 1994.  New and updated articles can be found on both CompuServe, GENIE and Internet.  This help file also lists Training Centers in your local area, third party application and developers,  and User Groups.  This help file contains helpful tips, programming examples(INF), known problems(PRB, PRA), References, FastTips and other information that may not be addressed in the manuals.

Please feel free to distribute this information in compliance with the terms of Microsoft.

Fast Tips

Forms (Specific)

Forms/Reports (Common)

General

Import/Export/Attach

Interoperability

Macros

Non-Product/Non-Technical

Programming

API/DLL Calls

Database Objects

Error Handling

Help Compiler

Libraries (MDA)

Other

Visual Basic Compatibility

Queries

Reports (Specific)

Security

Setup

Tables

Windows Issue

Printing


API/DLL Calls

INF: Connecting to the First Available Network Drive

INF: Conversions for C Data Types in Access Basic

INF: Creating Floating Popup Menus

INF: Determining How Many Instances of Application Are Active

INF: How to Activate an Application with Class Name

INF: How to Call the Windows Help Search Dialog Box

INF: How to Change the "Microsoft Access" Window Caption

INF: How to Change the Caption on the Microsoft Access Window

INF: How to Check a Menu Item Using Access Basic

INF: How to Convert Twips to Pixels

INF: How to Create a Function to Capture Screens of Your Forms

INF: How to Declare C++ Functions Called from Access Basic

INF: How to Determine if a Specific Windows Program Is Running

INF: How to Determine the Current Screen Resolution (Size)

INF: How to Determine the View in Which a Form Is Displayed

INF: How to Determine Whether a Form Is Minimized

INF: How to Determine Whether a Menu Item Is Checked

INF: How to Determine Windows and DOS Versions

INF: How to Dial a Phone Number in Microsoft Access

INF: How to Dim (Gray) Menu Items with Access Basic

INF: How to Disable the Menu Bar When Previewing a Report

INF: How to Display Immediate Window Without Module Window

INF: How to Find the Windows and System Paths

INF: How to List Users in a Given Group

INF: How to Minimize, Maximize, and Restore Microsoft Access

INF: How to Play .WAV Sounds on Events in Microsoft Access

INF: How to Position Microsoft Access on the Screen

INF: How to Print Text to Default Printer with Access Basic

INF: How to Remove the Caption Bar from a Form

INF: How to Retrieve Information from the Clipboard

INF: How to Retrieve Windows For Workgroups User Information

INF: How to Send Information to the Clipboard

INF: How to Tell if Windows for Workgroups Is Running

INF: How to Trap Keystrokes that Leave a Control on a Form

INF: How to Use a Function to Quit Windows

INF: How to Use Get, WritePrivateProfileString

INF: How to Use the CTL3D.DLL in Your MS Access Database

INF: How to Use the GetSystemMetrics() API Call

INF: How to Use the Windows OpenFile Dialog Box

INF: Obtain Name of Current User Database Using Access Basic

INF: Passing a Null Pointer to an External DLL

INF: Placing the User Login Name on a Form or in the Title Bar

INF: Sample Function to Determine the Access Startup Directory

INF: Sample Function to Use the COMMDLG Color Dialog Box

INF: Sample Functions to Send MCI Commands from Access Basic

INF: Sending a MAPI Mail Message Using Access Basic

INF: Using Access Basic CopyFile() Function to Copy Disk Files

INF: Using Microsoft Access Macro to Quit Windows

INF: Using SetSysModalWindow API Call in Access Basic

INF: Using the Windows 3.1 API to Connect to Network Resources

PRA: Crosstab Query with DLL Reference Fails

PRA: GP Fault with PostMessage() to an ADK Application


Error Handling

INF: Access Basic Error-Handling Supplemental Information

INF: DoEvents, SendKeys May Not Be Supported in UDFs

INF: Error() Function Does Not Return Detailed Information

INF: How to Create, Debug, and Use a Microsoft Access Library

INF: How to Find Access Basic Error Codes

INF: Sample Function to Determine Language Version

INF: Trapping for Library Being Opened Before Database

PRA: Opening Objects in Transactions Can Cause Rollback

PRB: Autokeys Macros with the Same Name Are Still Executed

PRB: Form Handle Not Released When Closed with Basic Code

PRB: Form Is Inaccessible When Debugging Run-Time Error


Help Compiler

INF: Description of HotSpot Editor and HotSpot Types

PRB: "Help Topic Does Not Exist" Invoking Custom Help File

PRB: Updated Help Compiler Needed for Word 6.0 RTF Files


Libraries (MDA)

INF: How to Add the ACC-KB.HLP File to the Help Menu

INF: How to Create, Debug, and Use a Microsoft Access Library

INF: How to Modify Toolbars

INF: How to Run Wizards or Open the WIZARD.MDA File

INF: List of Constants in Macros and Modules

INF: Trapping for Library Being Opened Before Database

INF: Using Undocumented CreateForm(), CreateReport() Functions

PRA: Run-Time Error Occurs Calling Financial Functions

PRB: Starting Analyzer Returns "Unknown Function Name"


Other

INF: Access Basic Is Both a Compiler and an Interpreter

INF: Accessing a Report Dynaset Requires a .Form Reference

INF: Calling RegQueryValue() to get an OLE Object Class Name

INF: Changing Area Codes Based on a Telephone Number Prefix

INF: Conversions for C Data Types in Access Basic

INF: Converting Julian Dates with Access Basic

INF: CreateControl() and CreateReportControl() Functions

INF: Criteria Parameters Require Concatenated References

INF: Currency is Significant to Four Digits

INF: Custom Domain Functions Similar to DFirst() and DLast()

INF: Cut, Copy, Paste for Immediate Window and SQL Window

INF: Data Type of Value Overrides Data Type of Variable

INF: dBASE's REPORT FORM Command in Access Basic

INF: Debugging & Troubleshooting Tips for Attached SQL Tables

INF: Deciding Between Macros and Access Basic for Programming

INF: DeleteControl, DeleteReportControl, and CreateGroupLevel

INF: Description of CreateForm() and CreateReport() Functions

INF: Description of PrtMip Property

INF: Error Messages When Concatenating Variables or Controls

INF: Explanation of "Option Compare Database" Statement

INF: Fill New Record with Data from Prev Record Automatically

INF: Filling a Multiple-Column List Box Using Access Basic

INF: FindEOM() Sample Function to Find Last Day of Month

INF: Finding the OLE ClassKey of an Embedded Object

INF: Flexible Formatting of Phone Numbers

INF: Function to Get Date of Monday Prior to Current Day

INF: How to Add an Icon to Program Manager Using DDE

INF: How to Add Items to the Help Menu

INF: How to Calculate a Credit Card Expiration Date

INF: How to Call Functions Using a String Variable

INF: How to Change the Status Bar Text Using SysCmd()

INF: How To Compute Moving Averages in Access Basic

INF: How to Convert Currency or Numbers into English Words

INF: How to Convert to and from Unsigned Integers

INF: How to Create a Custom Startup "Splash" Screen

INF: How to Create a Function to Capture Screens of Your Forms

INF: How to Create a Multiuser Custom Counter

INF: How to Create a Parameter In() Statement

INF: How to Create Custom Domain Function Similar to DCount()

INF: How to Create Custom Navigation (VCR) Buttons on a Form

INF: How to Create For Next Loops in a Macro

INF: How to Determine If a Form Exists in a Database

INF: How To Determine if a Record Is Being Edited

INF: How to Determine If a Table or Query Exists

INF: How to Determine if the Current Record Is the New Record

INF: How to Determine Number of Working Days Between Two Dates

INF: How to Direct DDE to a Specific Instance of a Server

INF: How to Disable the Close Command on the Control Menu

INF: How to Display Intervals Greater Than 24 Hours

INF: How to Fill an Array Using Access Basic

INF: How to Find a Record Using a Bound Control

INF: How to Find Attached Table's Database Name

INF: How to Find if an Object Exists in the Database

INF: How to Float Windows on Other Windows

INF: How to Get a List of Object Names in Microsoft Access

INF: How to Get Record Position Number from Record Selector

INF: How to Get Red, Green, or Blue Components from RGB Value

INF: How to Get SQL Pass-Through Functionality Using Q+E

INF: How to Get the Last Two Digits of the Year

INF: How to Implement a Timer

INF: How to Import a Data File to a Control on a Form

INF: How to Import a Microsoft Windows Cardfile Data File

INF: How to Index an Existing Field with DAO

INF: How to List the Related Tables in a Database in Version

INF: How to Make the Immediate Window Available at All Times

INF: How to Obtain the Number of Days in a Month

INF: How to Pass a Single Byte of Data to Windows API Calls

INF: How to Pass Information to Microsoft Access Using DDE

INF: How to Reference Controls or Fields on a Subform

INF: How to Replace a String with Another String

INF: How to Retrieve Information from the Clipboard

INF: How to Run Access Basic Functions with DDE

INF: How to Search for Characters or Strings in Records

INF: How to Specify a Custom Starting Page Number for a Report

INF: How to Speed Up Iterative Processes in Access Basic

INF: How to Use a Function to Quit Windows

INF: How to Use Access Basic to Derive Statistical Mode

INF: How to Use DDE to Fill a List Box

INF: How to Use DDE to Pass Information to MS Access v. 2.0

INF: How to Use the ColumnWidth Property

INF: How to Use the Status Bar Progress Meter

INF: How to Use TimeValue() to Calculate Difference in Times

INF: How to Wait for a Shelled Process to Finish

INF: Introduction to Windows Programming for MS-DOS Programmer

INF: Items in a Module Run Menu Are Unavailable (Grayed Out)

INF: New Version Argument for DoMenuItem in Version 2.0

INF: Obtain Name of Current User Database Using Access Basic

INF: Part 2, DDE in Visual Basic to Request Data from Access

INF: Practice Using Object Analyzer Commands

INF: Programmatically Add Counter Field to Table using DAO

INF: Programming with the Object Analyzer Engine and Utilities

INF: Reading, Storing, & Writing Binary Large Objects (BLOBs)

INF: Round or Truncate Values to Desired Number of Decimals

INF: Sample Function to Check Whether an Entry Exists

INF: Sample Function to Determine the Existence of a Query

INF: Sample Function to Find File Associations

INF: Sample Function to Generate a Random Temporary File Name

INF: Sample Function to Open a Form to a Particular Record

INF: Sample Function to Remove Alphas from a Numeric Field

INF: Sample Function to Return a Random Record

INF: Sample Function to Reverse a String

INF: Sorting Titles Without Leading Articles (The, An, etc.)

INF: Starting Another Application from a Text Box on a Form

INF: Tips for Debugging Access Basic Code

INF: Two Functions to Calculate Age in Months and Years

INF: Unsupported SQL Keywords Not Listed in Microsoft Access

INF: Using "Name" in Expressions

INF: Using Access Basic CopyFile() Function to Copy Disk Files

INF: Using Access Basic to Derive a Statistical Median

INF: Using Microsoft Word to Edit and Spell Check Memo Field

INF: Using SendKeys to Change Option Menus

INF: Variables for Controls Must Be String Data Type

INF: Writing Functions Called from Events or Expressions

PRA: Control Still Appears on Page After GotoPage Action

PRA: Creating Unbound Object Frame with CreateControl()

PRA: GP Fault When Allocating Huge Arrays

PRA: GP Fault When Passing User-Defined Type with Array

PRA: GP Fault When Using Erase Statement on String Array

PRA: GP Fault with Button Caption Text Longer Than 2048

PRA: GPF Referencing Form Dynaset with Form Variables

PRA: Opening Objects in Transactions Can Cause Rollback

PRA: Reserved Error (-1603) Previewing a Report

PRA: Run-Time Error Occurs Calling Financial Functions

PRA: Sent Keys Lost if Microsoft Access Yields Processor

PRA: Setting OLE Object Property May Cause GP Fault

PRA: StDevP() with All NULL Records Returns #ERROR

PRA: Text Not Replaced in All Modules with Replace All

PRA: Wrong Action Query Icon with CreateQueryDef Method

PRB: "Invalid Use of Null" or "#Error" in Defined Function

PRB: Access Basic Does Not Support Yes and No Action Arguments

PRB: Canceling a DoCmd Print Returns Error Messages

PRB: Cannot Check to See If Database Was Opened Exclusively

PRB: Cannot Open Multiple Instances of the Same Form

PRB: Cannot Rollback in Transaction without Closing Database

PRB: Cannot Set Focus to Any Object Except MS Access Menu

PRB: Compile All Command is Enabled After Saving a Module

PRB: Compile Error When Attempting to Use an AccessWizard

PRB: DateAdd 'w' Option Doesn't Work As Expected

PRB: DateDiff "W" Option Does Not Work

PRB: Domain Param. of Domain Function Cannot Be SQL Exp.

PRB: Error When Using OpenQueryDef Method on Parameter Query

PRB: Form Is Inaccessible When Debugging Run-Time Error

PRB: Full Path Causes Endless Loop in StartApp() Example

PRB: Hourglass May Not Change After Illegal Function Call

PRB: Index Example Incorrect in Introduction to Programming

PRB: Invalid Use of Null Alert Assigning Null Control

PRB: List Box Displays #Error

PRB: ListTables Method Returns Odd Names

PRB: Macro on Subform Control Executed by Main Form

PRB: Memo and OLE Fields in a Snapshot Are Not Static

PRB: Objects Cannot Be User-Defined Data Type Elements

PRB: Parameter Limit for Access Basic Functions in Validation

PRB: ReportWizard or FormWizard List Box Empty in ADK

PRB: Reserved Words Do Not Capitalize in Module Window

PRB: Rounding Errors Using Floating-Point Numbers

PRB: Scrolling to Bottom of Module Window Goes Past Typed Info

PRB: Type Mismatch Error Using CLng() With Hex Value

PRB: Val() Function Returns "Invalid Use of Null" Message


Visual Basic Compatibility

INF: Comparison of Visual Basic 3.0 and Microsoft Access 1.1

INF: How to Convert to and from Unsigned Integers


Database Objects

INF: "Fieldname" Is Not an Index in This Table

INF: Attached Table Must Be Opened as Dynaset from Modules

INF: Changing Area Codes Based on a Telephone Number Prefix

INF: Creating a Snapshot Is Slower Than Creating a Dynaset

INF: Criteria Parameters Require Concatenated References

INF: Enforcing Transactions on Attached SQL Server Tables

INF: Error Messages When Concatenating Variables or Controls

INF: Function to Delete Table Without Using DoMenuItem

INF: How to Add a User to a Group with CreateUser Method

INF: How to Avoid Abandoned Group Headers in Reports

INF: How to Create an SQL Pass-Through Query in Access Basic

INF: How to Fill a Combo Box with Table Names (1.x)

INF: How to Find Attached Table's Database Name

INF: How to Import a Data File to a Control on a Form

INF: How to Prevent Users from Adding New Records to a Form

INF: Microsoft Access Does Not Use Record Numbers

INF: Obtain Name of Current User Database Using Access Basic

INF: OpenQuery Is Not Method; Use OpenQueryDef Instead

INF: Performing an SQL Bulk Action Query from Access Basic

INF: Setting Form's Dynaset Property Puts Bookmark at EOF

INF: Short Description of a Dynaset

INF: Snapshot and Underlying Table Updated Until Snapshot Full

INF: Using a Form Reference Parameter Query in Access Basic

INF: Using Find Method to Find a Quotation Mark or Apostrophe

PRA: GetChunk on ODBC Table Returns "Invalid Argument"

PRA: GP Fault when Creating a Dynaset from Form Dynaset

PRA: GPF When Using ListParameters Method on Database

PRA: Incorrect Error Message Using OpenTable Method

PRB: "Invalid Database Object" Error Message

PRB: Cannot Perform OpenTable Method on an Attached Table

PRB: Cannot Rollback in Transaction without Closing Database

PRB: Close Dynaset Based on Form Multiple Times

PRB: Memo and OLE Fields in a Snapshot Are Not Static

PRB: RecordCount Property Returns Incorrect Number of Records

PRB: Seek Method Is Faster Than Find Method


ADK Printing specific

Printing Other


ADK Printing specific all

INF: Using PrtDevMode Property to Set Print Setup Dialog Box

PRA: Print Quality Always Defaults to Highest Mode


Printing: General Win Trouble Shooting

Installing printer drivers

Troubleshoot Printing Other


Installing printer drivers

PRB: Error Occurs in Print Preview Without Driver


Troubleshoot Printing Other

PRB: Limited to 65535 Pages in Print Dialog Box

PRB: Two Labels on Top of Each Other Both Print

PRB: White Lines or Missing Data When Printing Reports


Printing: Specific Win3.1 Drivers

Generic Text Only

HP II series (PCL 4)

IBM 4019/4029 native mode

Other Laser Postscript (Not Lvl 2)


HP II series (PCL 4)

INF: Printing Microsoft Access Reports on HP Laserjet


IBM 4019/4029 native mode

PRA: TrueType Fonts Shift Vertically on HP LJ4 Printer


Other Laser Postscript (Not Lvl 2)

PRB: Tops of Letters May Be Cut Off with Some PostScript Fonts


Generic Text Only

INF: Using the Generic Print Driver with Forms/Reports

PRB: "Generic/Text Only" Driver Print Quality List Error

PRB: Overlapped Printing an Access Query Using TTY.DRV


Queries
Microsoft Access Knowledge Base

Welcome to the Microsoft Access Knowledge Base help file.  This help system includes 1313 articles that relate to the Microsoft Access  for Windows.  These articles were developed by Microsoft's Product Support Engineers.  This help file is a snapshot of the Knowledge Base as of April 13, 1994.  New and updated articles can be found on both CompuServe, GENIE and Internet.  This help file also lists Training Centers in your local area, third party application and developers,  and User Groups.  This help file contains helpful tips, programming examples(INF), known problems(PRB, PRA), References, FastTips and other information that may not be addressed in the manuals.

Please feel free to distribute this information in compliance with the terms of Microsoft.

Fast Tips

Forms (Specific)

Forms/Reports (Common)

General

Import/Export/Attach

Interoperability

Macros

Non-Product/Non-Technical

Programming

Queries

Crosstab

Joins

Make Table/Update/Append/Delete

Other

Parameters/Referencing

Query not updatable/Row Fix-Up

Totals/Agg. Functions

Reports (Specific)

Security

Setup

Tables

Windows Issue

Printing


Totals/Agg. Functions

INF: Cannot Group By Memo or OLE Object Fields in Query

INF: How to Use a Query to Filter Unique Data

INF: How to Use Aggregate Functions in a Query

INF: Number of Times a Custom Function Executes in a Query

PRB: <Expression> Not Part of Aggregate Function or Grouping

PRB: Properties Do not Reset Between Crosstab and Make Table


Crosstab

INF: Creating a Crosstab Query with Multiple Value Fields

INF: Displaying Totals for Each Row in Crosstab Queries

INF: How to Create a Dynamic Crosstab Report

INF: Sample Table Design to Support Questionnaire Applications

PRA: Crosstab Query with DLL Reference Fails

PRA: Reserved Error -1001 with Linked Crosstab Subreport

PRB: Error Message "Can't Group on Fields Selected with '*'"

PRB: Incorrect Characters in Crosstab Query Column Headings

PRB: No Implicit Parameters on CrossTab Queries


Joins

INF: How to Compare Unequal Data with Query Criteria

INF: Join Type Mismatch Errors Caught at Runtime

INF: Row Fix-up in the NWIND.MDB Order Form

INF: Use AutoLookup Technique to Look Up Info Automatically

INF: Using a Subquery to Simulate a SQL Sub-SELECT Statement

INF: Using a Subtract Query to Find Unmatched Records

PRA: DISTINCTROW Keyword Ignored in a Cartesian Product

PRB: Join Is Broken by Value(s) in Fields '[Field Name]'

PRB: One Side of Join Line Not Attached to Table

PRB: Troubleshooting Out of Memory Errors in Queries


Make Table/Update/Append/Delete

INF: Changing the Relationship Between Two Existing Tables

INF: Creating Queries to Execute Cascading Updates

INF: Empty Table Created by SELECT INTO with No Matching Rows

INF: Equivalent of Microsoft Excel's Fill Down Functionality

INF: How to Delete Duplicate Records from a Table

INF: How to Force a Cascading Delete

INF: How to Mark Records with Unmatched or Invalid Values

INF: How to Query for Duplicate Records

INF: How to Update a Table Based on Values in a Second Table

INF: Sample Table Design to Support Questionnaire Applications

INF: Updating a Separate Table When a Value Changes on a Form

INF: Updating Summary Information with Data from Second Table

INF: Use a Query to Parse a Full Name into Two Fields

INF: Use Append Query to Set Initial Value of Counter Field

PRA: Database Corruption Message After Large Append

PRA: Datasheet and Run Buttons Disabled On Append Query

PRA: Erroneous "Lost Records" Error on Delete Query

PRA: GPF on Update Query Due to Query Design Option

PRA: Incorrect Action Query Message Box Text

PRA: Running Delete Query Gives Misleading Error Msg

PRB: "Permissions Denied" Running Macro with SQL Statements

PRB: "Record Lock Threshold Exceeded" with Large Action Query

PRB: Append Query Results in Duplicate Counter Numbers

PRB: Concatenation of Memo Fields Creates Text Field

PRB: Counter Starts at 2 in Table Created by Make-Table Query

PRB: Make-Table Query Causes Existing Table to Be Deleted

PRB: Make-Table Query Does Not Copy Field Descriptions

PRB: Make-Table Query Generates "Invalid" Error Message

PRB: Record Sort Order Is Different Than Expected

PRB: Update Queries Do Not Check Validation Rules

PRB: Update Query on More than One Table Gives Inaccurate Data


Query not updatable/Row Fix-Up

PRB: Cannot Edit Access Data Using Query with Attached dBASE


Other

INF: "#Name?" or Control is Blank on Form Based on a Query

INF: Adding a Dynamic Counter to a Query to Count Records

INF: Calculated Fields Must Be Shown to Perform Calculations

INF: Case Sensitivity in Queries Differs with Attached Tables

INF: Copy and Paste Operations from Forms to Queries

INF: Copying Query that Cannot Be Opened in Design View

INF: Count() Ignores Null Values

INF: Creating Virtual Indexes with SQL Data-Definition Queries

INF: Cut, Copy, Paste for Immediate Window and SQL Window

INF: Equivalent of Microsoft Excel's Fill Down Functionality

INF: Exporting Queries to ASCII

INF: How to Create a Parameter In() Statement

INF: How to Create an SQL Pass-Through Query in Access Basic

INF: How to Export the Results of a Query

INF: How to Obtain the Number of Days in a Month

INF: How to Query SQL Server Tables Without Attaching

INF: How to Search for Characters or Strings in Records

INF: How to Sort on Different Fields Dynamically

INF: How to Use Aggregate Functions in a Query

INF: Like vs. = with Wildcard Characters in Query Searches

INF: Limit on AND's in SQL Select Statement

INF: Macro to Check for Duplicate Values in a Field

INF: Online Help for Sigma Button Is Incorrect

INF: Operators as Field Names in Query Cause Error Message

INF: Overview of New Query Features in Version 2.0

INF: Queries Sort by Order of IN() Parameters

INF: Reporting the Median Value of a Group of Records

INF: Sample Function to Determine the Existence of a Query

INF: Sample Function to Reverse a String

INF: Sample Table Design to Support Questionnaire Applications

INF: Sorting String Values Based on their Numeric Values

INF: Sorting/Grouping a Query Using a Portion of Field's Value

INF: Unsupported SQL Keywords Not Listed in Microsoft Access

INF: Use of Constants as Field Names in a Query

INF: Using a Subtract Query to Find Unmatched Records

INF: Using Indexes in Microsoft Access

PRA: "Database Already in Use" Error After Running Query

PRA: Cannot Paste Column If Focus Is on One Cell in Query

PRA: Datasheet Header and Footer Print at Constant Locations

PRA: Descending Sort Query Returns Wrong Number of Rows

PRA: Error: Not Enough System Resources in Access

PRA: Opening Multiple-Column Query Causes Clause Truncation

PRA: Query Progress Meter Reports Status Incorrectly

PRA: RowSource Property Changes Commas to Semicolons

PRA: Syntax Error When "(" Is First Character in Criteria Cell

PRA: Unique Values Only Select Query Shows Duplicates

PRA: Wrong Action Query Icon with CreateQueryDef Method

PRB: "Circular Reference Caused by Alias" Error Message

PRB: "Field0" Appears in a Query But Not in the Source Table

PRB: "ORA-00904: Invalid Column Name" Error Message in Query

PRB: "Too Many Expressions in Distinct Output" Error

PRB: Cannot Scroll Query Grid with ARROW Key or Mouse

PRB: Cannot Use SQL Pass-Through Command for Subreport

PRB: Changed Field Names In Table Are Not Reflected In Query

PRB: Column in QBE Grid Keeps Focus After Clicking Field List

PRB: CTRL+C Does Not Copy SQL Statement in Windows 3.0

PRB: Error Message "Couldn't Find Input Table or Query"

PRB: Error Message "Expression Is Too Long for the QBE Grid"

PRB: Error Message: Query Must Have at Least One Output Field

PRB: Expression in Query Grid Does Not Show All Text

PRB: Long WHERE Clause Is Truncated After View SQL Command

PRB: Microsoft Access Cannot Paste Entire Column in Query Grid

PRB: NWIND.MDB Query with Criteria Displays Data in Odd Order

PRB: ORDER BYs Must Be Output Columns in DISTINCT Queries

PRB: Queries Sent to Remote SQL Server Run Slowly

PRB: Query by Form Returns No Rows When All Rows Expected

PRB: Query Error Caused by Colon in Field Name

PRB: Query Information Lost Switching to SQL-Specific Query

PRB: Rectangles Appear When Pasting in the Query Grid

PRB: Show All Records Menu Choice not Available

PRB: Sorting a Query on a Nested Expression Does Not Work

PRB: When Column Selected and Deleted, Query Grid Disappears


Parameters/Referencing

INF: How to Create a Parameter In() Statement

INF: How to Create a Query By Form (QBF)

INF: How to Dynamically Create a Filter

INF: How to Use the LIKE Operator in Parameter Queries

INF: Parameter Queries, Wildcards, and SQL Server

INF: Passing Values from a Form to a Parameter Query

INF: Query with Parameters to Evaluate Complex Criteria

INF: Returning Case-Sensitive Match in Queries

INF: Showing All Records (Including Null) in a Parameter Query

INF: Using "<", ">", and "=" Operators in Query Parameters

INF: Using a Form Reference Parameter Query in Access Basic

PRA: ERR: Undefined Function Referencing Column Property

PRA: Error Message "Internal Database Error -1310"

PRA: Hard-Coded and Passed Wildcards Different in Query

PRA: Invalid Characters Added to IN Clause Arguments

PRA: Report Prompts Twice for Same Parameter Value

PRB: Cannot Exit Extend Mode in Parameters Dialog Box

PRB: No Implicit Parameters on CrossTab Queries

PRB: No Prompt for Second Parameter in Query

PRB: Query Results in "Overflow" Error Message


Reports (Specific)
Microsoft Access Knowledge Base

Welcome to the Microsoft Access Knowledge Base help file.  This help system includes 1313 articles that relate to the Microsoft Access  for Windows.  These articles were developed by Microsoft's Product Support Engineers.  This help file is a snapshot of the Knowledge Base as of April 13, 1994.  New and updated articles can be found on both CompuServe, GENIE and Internet.  This help file also lists Training Centers in your local area, third party application and developers,  and User Groups.  This help file contains helpful tips, programming examples(INF), known problems(PRB, PRA), References, FastTips and other information that may not be addressed in the manuals.

Please feel free to distribute this information in compliance with the terms of Microsoft.

Fast Tips

Forms (Specific)

Forms/Reports (Common)

General

Import/Export/Attach

Interoperability

Macros

Non-Product/Non-Technical

Programming

Queries

Reports (Specific)

Layout

Mailing Labels

Other

Report Properties

Reports/Subreports

Sorting and Grouping

SubReports

Totaling

Security

Setup

Tables

Windows Issue

Printing


Mailing Labels

INF: Creating Mailing Labels for Dot-Matrix Printers

INF: Formatting a Label for Each Axis of a Graph

INF: Hints for Printing Mailing Labels

INF: How to Print Duplicate Mailing Labels for Each Record

INF: How to Skip Used Mailing Labels and Print Duplicates

INF: No Custom Printer Setup for Mailing Labels ReportWizard

PRB: Avery 4xxx-Series Labels Do Not Work on Laser Printer

PRB: Printing on Avery 5267 labels

PRB: Two Labels on Top of Each Other Both Print


Layout

INF: Currency Format Causes Report Alignment Problems

INF: Eliminating White Space in Reports with CanShrink and

INF: How to Create a Dynamic Crosstab Report

INF: How to Print Book Style Page Numbers

INF: How to Print Odd or Even Pages of a Report

INF: How to Print Total Number of Pages on Each Page of Report

INF: How to Specify a Custom Starting Page Number for a Report

INF: Page Header Will Span Full Width Of Multi-Column Report

INF: Sample Macro to Reset Page Number on Group Level Report

PRB: Default Width in Report Design Does Not Reflect Margins

PRB: Every Other Page Blank in Printed Reports

PRB: Inconsistent Line Spacing in Summary Reports

PRB: Margins Do Not Relate to Printable Area

PRB: ReportWizard Truncates Fields

PRB: Text Box Formatted as Currency Has a Space on the Right


Other

INF: Consecutively Numbering Pages for Two or More Reports

INF: Creating Reports to Mail Merge Microsoft Access Data

INF: Expressions to Count Yes, No, and Other Responses

INF: How to Create a "Top 10" Report

INF: How to Disable the Menu Bar When Previewing a Report

INF: How to Fill Text Boxes on a Report with Access Basic

INF: How to Print a Single Record from a Form in a Report

INF: How to Specify a Custom Starting Page Number for a Report

INF: Print a Sequential Number for Each Record/Group on Report

INF: Reporting the Median Value of a Group of Records

INF: Sample Preview Ignores Query

INF: Tips for Improving Combo and List Box Performance

INF: Tips for Improving Subform Performance

INF: Troubleshooting Tips for Error Values

PRA: Cannot Use First() and Last() Functions in a Report

PRA: Reserved Error (-1603) Previewing a Report

PRB: "Out of Memory" or "Query too Complex" Running Report

PRB: Do Not Have Permissions to Modify Secured Report

PRB: Duplicate Values Printed on Report

PRB: Toolbar Disappears When Printing a Document


Report Properties

INF: Explanation of the KeepTogether Property for Sections

INF: How to Fill Text Boxes on a Report with Access Basic

INF: How to Print a Conditional Page Header in a Report

INF: How to Simulate Changing RecordSource Property of Report

INF: MS Access Saves Printer Information with Each Form/Report

INF: Shrinking Empty or Null OLE Object on Report

INF: Two Methods to Refer to a Field in a Previous Record

PRA: Error Using SQL in Report RecordSource Property

PRA: GP Fault When RunningSum Tries to Evaluate #ERROR

PRA: Words Split When CanGrow=Yes and KeepTogether=No

PRB: CanGrow or CanShrink Problems in Report Header or Footer

PRB: Cannot Process Close Action in Report's OnOpen Property

PRB: Form or Report Cannot be Opened or Previewed

PRB: Print Setup Triggers Report's OnClose, OnOpen Properties

PRB: Report Property PageFooter Set to "Not With Rpt Ftr"


Reports/Subreports

INF: How to Refer To a Control On a Subform or Subreport


SubReports

PRA: Calculated Control on Subreport Displays Wrong Data

PRA: Datasheet Form Saved as Subreport Causes GP Fault

PRA: Error Previewing Subreports that Call Filter Macro

PRA: GPF Printing Subreport with Datasheet Default View

PRA: Invalid Results in Subreport When CanGrow = Yes

PRA: Report Prompts Twice for Same Parameter Value

PRA: Report Section with Subreport Not Included In Output File

PRA: Reserved Error -1001 with Linked Crosstab Subreport

PRB: "#ERROR" Message When Referencing Subreport Controls

PRB: Subform Layout Changes Not Saved


Sorting and Grouping

INF: "Continued..." Header for Groups on More than One Page

INF: Expressions to Count Yes, No, and Other Responses

INF: How to Avoid Abandoned Group Headers in Reports

INF: How to Calculate Averages That Exclude Zero Values

INF: How to Print a Conditional Page Header in a Report

INF: Repeat Group Name at the Top of New Column or Page

PRA: Cannot Use First() and Last() Functions in a Report

PRA: Run Time Partially Displays Sorting and Grouping

PRA: Screen Redraw Problems When Reordering Groups

PRB: Negative GroupOn Interval Reverses Sort Order

PRB: Report Detail Items Appear in Group Header

PRB: Report Grouping on Date/Time Field Incorrect


Totaling

INF: Expressions to Count Yes, No, and Other Responses

INF: How to Calculate Averages That Exclude Zero Values

PRA: Group Footer Controls Calculate Twice at Page Break


Security
Microsoft Access Knowledge Base

Welcome to the Microsoft Access Knowledge Base help file.  This help system includes 1313 articles that relate to the Microsoft Access  for Windows.  These articles were developed by Microsoft's Product Support Engineers.  This help file is a snapshot of the Knowledge Base as of April 13, 1994.  New and updated articles can be found on both CompuServe, GENIE and Internet.  This help file also lists Training Centers in your local area, third party application and developers,  and User Groups.  This help file contains helpful tips, programming examples(INF), known problems(PRB, PRA), References, FastTips and other information that may not be addressed in the manuals.

Please feel free to distribute this information in compliance with the terms of Microsoft.

Fast Tips

Forms (Specific)

Forms/Reports (Common)

General

Import/Export/Attach

Interoperability

Macros

Non-Product/Non-Technical

Programming

Queries

Reports (Specific)

Security

Security All

Setup

Tables

Windows Issue

Printing


Security All

INF: "Unexpected Error 1031" Using the SecurityWizard

INF: Changes in Security in Version 2.0

INF: Determining Which User You Are Logged

INF: Error in Object Permissions Table

INF: How to Create a Password Text Box

INF: How to Find Which Groups a User Belongs

INF: How to Give Users the Ability to Change Passwords

INF: How to List Users in a Given Group

INF: How to Use DAO to Assign or View Permissions

INF: How to Use Microsoft Access Database in Visual Basic

INF: Network Users Can Open Their Own SYSTEM.MDA Exclusively

INF: No Permission to Modify Data in a Table

INF: Overview of Conversion Issues from Version 1.1 to 2.0

INF: Planning Database Security

INF: Sample Function to List Groups in System Database

INF: Sample Function to Return Current User's Groups

INF: Sample Function to Return Users in Current System

INF: Security Settings for Modifying Data in a Query Dynaset

INF: Table Permissions Changes Not Effective with Open Form

PRA: Password Is Case-Sensitive But Verification Is Not

PRA: User with Full Permissions Cannot Run Query

PRB: "Permissions Denied" Running Macro with SQL Statements

PRB: Cannot db.OpenTable With Only Read Definition Permission

PRB: Do Not Have Permissions to Modify Secured Report

PRB: No Password Prompt Using Microsoft Access .MDB with ODBC

PRB: No System Table Permissions After Admin User Deleted

PRB: Removing User Admin from Admins Group Cannot Be Reversed

PRB: Unable to Change Permissions (Security)

PRB: User with Full Permissions Cannot Change a Query

WX0964: SecurityWizard and White Paper Application Note


Specltp

Special Topic*


Special Topic*

WX0928: Microsoft Access KB Help File AppNote Contents


Setup
Microsoft Access Knowledge Base

Welcome to the Microsoft Access Knowledge Base help file.  This help system includes 1313 articles that relate to the Microsoft Access  for Windows.  These articles were developed by Microsoft's Product Support Engineers.  This help file is a snapshot of the Knowledge Base as of April 13, 1994.  New and updated articles can be found on both CompuServe, GENIE and Internet.  This help file also lists Training Centers in your local area, third party application and developers,  and User Groups.  This help file contains helpful tips, programming examples(INF), known problems(PRB, PRA), References, FastTips and other information that may not be addressed in the manuals.

Please feel free to distribute this information in compliance with the terms of Microsoft.

Fast Tips

Forms (Specific)

Forms/Reports (Common)

General

Import/Export/Attach

Interoperability

Macros

Non-Product/Non-Technical

Programming

Queries

Reports (Specific)

Security

Setup

ADK Setup Wizard

Hangs on disk x

Network Installation

ODBC

Other

Problems

Bad disk

Network

Window Setup - Other

Tables

Windows Issue

Printing


Bad disks

INF: How to Use the CreateIniKeyValue Command in STFSETUP.IN_

INF: Setup Files Utility Appears to Hang

PRA: Cannot Include Comma in App Name Using SetupWizard

PRA: Setup Ignores $(AppPath); Puts Files in MS-SETUP.T

PRB: ADK Custom Setup Hangs During Installation

PRB: Background Bitmap in Custom Setup Cannot Be Altered

PRB: Custom Setup Creates Too Many Program Groups

PRB: Directory Name in ADK SUFiles Setup Utility Not


Hangs on disk x

PRB: Memory or Disk Space Problems Using MS-DOS 6.0


StpNet

INF: "Invalid Path" Error Message on Network Installation


Network Installation

INF: Access Workstation Setup (/N) Instructions Are Confusing

INF: How to Prevent Workstation Setup from Installing Locally

INF: Installing Microsoft Access on a Diskless Workstation

INF: Microsoft Access and Untested Networks

INF: README.TXT File and Novell Locking Issues

INF: Running MS-DOS SHARE with Windows for Workgroups

PRA: Cannot Connect to SQL Server w/ NetWare, Workgroups

PRA: File Truncation on Password-Protected Servers

PRA: Incorrect Install Directory with Workstation Setup

PRA: Network Setup (/N) Fails After Network Error

PRB: "Error Writing to File 'MSAIN100.DLL'" During 1.1 Install

PRB: Databases Truncated with LAN Manager 2.1a and Earlier

PRB: Error Message: Must Run SETUP /A Before Running SETUP

PRB: Error Using Automatic ODBC Setup with Auto Switch

PRB: Error When Installing Access on DEC Pathworks Network

PRB: Two Error Messages with Database on Workgroups Server


ODBC

INF: Upper Limit for QueryTimeout and LoginTimeout Parameters

PRB: Error Using Automatic ODBC Setup with Auto Switch


Other

INF: Contents: MS Access 1.0 Disks 4-6 (1/14/93, 3.5-Inch)

INF: Custom Setup May Show Zero or Negative Disk Space Needed

INF: How to Make Welcome to MS Access Opening Screen Display

INF: How to Quickly Open the STFSETUP.IN_ File for Editing

INF: How to Uninstall Microsoft Access Version 2.0

INF: List of Articles Relating to MSACCESS.INI File

INF: Microsoft Access 1.0 (1/14/93) Disks 1-3 Contents (1.44M)

INF: Microsoft Access 1.0 Disk Contents (3.5 inch, 1.44 MB)

INF: Microsoft Access 1.0 Disks 1-4 Contents (5.25 Inch 1.2MB)

INF: Microsoft Access 1.0 Disks 5-9 (5.25 inch, 1.2 MB)

INF: ODBC Disk Contents (1/14/93, 3.5-Inch, MS Access 1.0)

INF: Setup Options Dialog Box Lists Disk Space Info Twice

INF: Troubleshooting Setup and Installation Problems

INF: Version 1.1 Online Help and Text Files

INF: Version 1.1 Online Help and Text Files

PRA: MS Graph Not Registered Correctly in Network Setup

PRA: Setup Program Not Handling All Palette Messages

PRB: Cannot Install Cue Cards Without Installing Help in Versi

PRB: Directory Name in ADK SUFiles Setup Utility Not

PRB: Hourglass in Setup Changes to Arrow During Copy

PRB: Memory or Disk Space Problems Using MS-DOS 6.0

PRB: Microsoft Access Cannot Find DESKEDIT.EXE File


Problems

INF: Could not Find SYSTEM.MDA or UTILITY.MDA File

INF: Setup Files Utility Appears to Hang

PRA: Cue Cards Cannot Be Started from Workstation

PRA: Setup (STFSETUP) GP Faults in Windows Standard Mode

PRA: Setup Cannot Recognize Forward Slash in Path

PRA: Setup Leaves MS-SETUP.T Directory and Files on Disk

PRA: Setup Writes Over Newer CTL3D.DLL File

PRB: "Not Enough Memory to Run SETUP.EXE" Error Message

PRB: "Outdated COMMDLG.DLL" Error Message During Setup Program

PRB: ADK Custom Setup Hangs During Installation

PRB: Cannot Write README.TXT Error Msg During Installation

PRB: Error Message "Couldn't Open Table MSysAccounts"

PRB: Error Message: Cannot Change Working Directory to Default

PRB: Setup Program STFSETUP.EXE Causes GP Fault


Window Setup - Other

INF: Older Versions of Shared DLLs Cause Problems with Access


ADK Setup Wizard

INF: How to Use the CreateIniKeyValue Command in STFSETUP.IN_

INF: Setup Files Utility Appears to Hang

PRA: Cannot Include Comma in App Name Using SetupWizard

PRB: ADK Custom Setup Hangs During Installation

PRB: Background Bitmap in Custom Setup Cannot Be Altered

PRB: Custom Setup Creates Too Many Program Groups


Tables
Microsoft Access Knowledge Base

Welcome to the Microsoft Access Knowledge Base help file.  This help system includes 1313 articles that relate to the Microsoft Access  for Windows.  These articles were developed by Microsoft's Product Support Engineers.  This help file is a snapshot of the Knowledge Base as of April 13, 1994.  New and updated articles can be found on both CompuServe, GENIE and Internet.  This help file also lists Training Centers in your local area, third party application and developers,  and User Groups.  This help file contains helpful tips, programming examples(INF), known problems(PRB, PRA), References, FastTips and other information that may not be addressed in the manuals.

Please feel free to distribute this information in compliance with the terms of Microsoft.

Fast Tips

Forms (Specific)

Forms/Reports (Common)

General

Import/Export/Attach

Interoperability

Macros

Non-Product/Non-Technical

Programming

Queries

Reports (Specific)

Security

Setup

Tables

Data Types

Database Design

Field Properties

Modify

Other

Primary Key/Indexes

Validation

Windows Issue

Printing


Data Types

INF: Access Table with Time Field Exports Strangely to Excel

INF: Conversion of Oracle Data Types to Microsoft Access

INF: Field Size of 0 Treated as 255

INF: How to Create a Multiuser Custom Counter

INF: Implementing Counter Values on Attached SQL Server Tables

INF: Maximum Number of Rows in Table When Counter is the Key

INF: Use Append Query to Set Initial Value of Counter Field

INF: Using Date/Time Data Type and Calculating Elapsed Time

PRA: Changing Font Size Causes Subscript Text

PRA: List Separator Setting Causes Table Design Errors

PRB: Append Query Results in Duplicate Counter Numbers

PRB: Cannot Use "y," "n," "t," or "f" in Yes/No Field

PRB: Concatenation of Memo Fields Creates Text Field

PRB: New OLE Field is Created as Text Box in a New Form


Database Design

INF: How to Create a Multiuser Custom Counter

INF: Nulls Allowed in Foreign Key with Referential Integrity

INF: Sample Table Design to Support Questionnaire Applications

PRA: Null Boolean Values Default to False

PRB: Cannot Change Combo Box Value If ControlSource Is Counter

PRB: Cannot Check to See If Database Was Opened Exclusively

PRB: Error Message: Too Many Memo or OLE Fields

PRB: New OLE Field is Created as Text Box in a New Form

PRB: Unknown Reference or Function in Validation Expression

PRB: ValidationRule Parses Function Name w/o Parens to String


Field Properties

INF: Error Message with Blank or Incorrect Data Type

INF: Must Save Table to Use Input Mask Wizard

INF: Snapshot and Underlying Table Updated Until Snapshot Full

INF: System Objects Retain System Object Properties

INF: Using the AllowZeroLength and Required Properties

PRA: Formatted Memo Truncates Data at 255 Characters

PRB: Cannot Save a Blank Record in a Table or Form

PRB: Cannot Undo Property Settings in Table Design View

PRB: Datasheet Fields Ignore Show or Hide Settings

PRB: Default Values Used Only with a Bound Control

PRB: Error Message: Query Must Have at Least One Output Field

PRB: Nulls Not Concatenated with "+" Operator


Modify

INF: Deleting Duplicate Records from Two Tables

INF: Equivalent of Microsoft Excel's Fill Down Functionality

INF: How to Delete Duplicate Records from a Table

INF: How to Programmatically Create a Table

INF: Programmatically Add Counter Field to Table using DAO

PRA: "Table Does Not Exist" Error Message When Deleting Table

PRA: Reserved Error -1051 Pasting Over Primary Key Field

PRA: Transaction Limit Can Cause 'Out of Memory' Error

PRB: Changed Field Names In Table Are Not Reflected In Query

PRB: Using "Save As" from Table Design View Does Not Copy Data


Other

INF: Attached Table Must Be Opened as Dynaset from Modules

INF: Cannot Create Relationships with Attached Tables

INF: Database Normalization Basics

INF: Date/Time Data Type Provides Current Year Automatically

INF: Equivalent of Microsoft Excel's Fill Down Functionality

INF: Function to Delete Table Without Using DoMenuItem

INF: Hiding Rows and Columns in Tables

INF: How NWIND.MDB Employee Field Photographs Were Created

INF: How to Quickly Delete Multiple Tables

INF: How to Use TimeValue() to Calculate Difference in Times

INF: Snapshot and Underlying Table Updated Until Snapshot Full

INF: System Objects Retain System Object Properties

INF: Troubleshooting Tips for Error Values

PRB: Error When Opening Attached Table in Shared .MDB File

PRB: Error When Trying to Enforce Referential Integrity

PRB: Report or Form Bound to a Table Locks the Table

PRB: Sizing Rows and Columns to Zero Works Differently


Primary Key/Indexes

INF: Compound Indexes Must Restrict First Indexed Field

INF: Incrementing the Numeric Portion of a String

PRB: Form's Record Sort Order Depends on AllowUpdating

PRB: Index Does Not Work in AB Function with NWIND.MDB

PRB: Record Sort Order Is Different Than Expected


Validation

INF: Validating Data with Values From Another Table

INF: Validation Rule to Require Uppercase in a Field

PRB: Parameter Limit for Access Basic Functions in Validation

PRB: Table Design Does Not Check Validity of Default Value

PRB: Validation Rules Evaluate Expressions in Unexpected Ways


Windows Issue
Microsoft Access Knowledge Base

Welcome to the Microsoft Access Knowledge Base help file.  This help system includes 1313 articles that relate to the Microsoft Access  for Windows.  These articles were developed by Microsoft's Product Support Engineers.  This help file is a snapshot of the Knowledge Base as of April 13, 1994.  New and updated articles can be found on both CompuServe, GENIE and Internet.  This help file also lists Training Centers in your local area, third party application and developers,  and User Groups.  This help file contains helpful tips, programming examples(INF), known problems(PRB, PRA), References, FastTips and other information that may not be addressed in the manuals.

Please feel free to distribute this information in compliance with the terms of Microsoft.

Fast Tips

Forms (Specific)

Forms/Reports (Common)

General

Import/Export/Attach

Interoperability

Macros

Non-Product/Non-Technical

Programming

Queries

Reports (Specific)

Security

Setup

Tables

Windows Issue

Control Panel

File Manager

Operating Environment - Other

Program Manager

UAE/GP Fault caused by Windows

Usage - Other

Printing


Control Panel

PRA: Setup Program Not Handling All Palette Messages

PRB: Minimizing, Maximizing the Desktop Flashes Slightly

PRB: Property List Boxes Show Two-Word Options on Two Lines


File Manager

INF: How to Use a Function to Quit Windows


UAE/GP Fault caused by Windows

PRA: GPF Declaring New Object Variable During Break Mode

PRA: GPF Printing Subreport with Datasheet Default View

PRA: GPF Using Empty String with CVDate() or IsDate()

PRA: GPF Using OpenForm Action to Hide Modal Pop- Up Form

PRA: HPPCL5A Printer in DEBUG Windows Causes GP Fault

PRA: Machine Hangs When Relationships Box is Displayed

PRA: System Hangs When Minimizing Microsoft Access Window

PRB: Hewlett-Packard Dashboard GP Faults in Microsoft Access

PRB: Microsoft Access GP Faults with ATI Ultra Video Card


Operating Environment - Other

INF: Microsoft Access, Scanners, and Scanning Software

INF: Network Users Can Open Their Own SYSTEM.MDA Exclusively

INF: Norton Desktop 1.x Not Compatible with Microsoft Access

INF: Older Versions of Shared DLLs Cause Problems with Access

INF: Opening Databases as Read-Only Causes Error Message

INF: Using SHARE.EXE and VSHARE.386 with Microsoft Access 2.0

INF: Using SHARE.EXE and VSHARE.EXE with Microsoft Access

PRA: Microsoft Access Changes MS-DOS Screen/Text Colors

PRA: Non-TrueType Fonts with 8514.DRV Cause GP Fault

PRB: '|' Isn't A Valid Path Error Message on Start

PRB: Arrange Icons Does Not Work on More Than 40 Windows

PRB: GPF with Diamond Viper VESA Local Bus Video Driver V1.01

PRB: Help Gives Error Importing File From Floppy Disk

PRB: Insert Object Dialog Box Has No "All Files" (*.*) Option

PRB: Invalid Path Error Message Using UNC with 10+ Characters

PRB: Low Number of Share Locks Can Cause Error Message

PRB: Memory or Disk Space Problems Using MS-DOS 6.0

PRB: Stacker 3.0 CHECK.EXE Reports Database Files as Corrupt

PRB: Text May be Hard to Read on an EGA Screen

PRB: Undo Cut Does Not Restore Previous Clipboard Contents


Program Manager

PRB: Microsoft Access Cannot Find DESKEDIT.EXE File


Usage - Other

INF: How to Use Command Line Switches

INF: Microsoft Access, Scanners, and Scanning Software

INF: Tile, Cascade Menu Options Inconsistent with Prog Manager

PRB: Arrange Icons Does Not Locate Icons in Correct Place

PRB: Cursor Position Unchanged in Undo Paste Command

PRB: Out Of Memory When Pasting Text Into Module

PRB: SCSI Drives Can Generate Corrupt Error Loading Database

PRB: Undo Cut Does Not Restore Previous Clipboard Contents